Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Stump <mikestump@comcast.net>
To: "gcc-patches@gcc.gnu.org Patches" <gcc-patches@gcc.gnu.org>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Eric Botcazou <ebotcazou@adacore.com>
Subject: -static-libstdc++ breaks building gdb
Date: Tue, 03 Sep 2013 21:39:00 -0000	[thread overview]
Message-ID: <CBD32A0D-4296-49CA-B5A5-6147011AEA84@comcast.net> (raw)

I'm on a openSUSE 11.4 system with a:

gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]

host compiler.  When I building gdb trunk, I get a failure to build because configure tests g++ to see if these work, but gdb links with gcc and 4.5.1 errors out with the flag.  You can't set LDFLAGS, because that is given to gcc, without testing the flag with gcc.  So, either:

AC_LANG_PUSH(C++)

goes away, or we need to exclude 4.5 as well.  I tested the first approach and while it gives a message, it doesn't fail the link, so short of rewriting the test, we need to bump the minor number up 1.  I make no claim that 4.6.0 doesn't also fail.

If someone knows when the driver was made to error out with the proper return code, it would be better to put that into the test instead.

Here is the failure trying to make the first approach work:

configure:4926: checking whether gcc accepts -static-libstdc++ -static-libgcc
configure:4937: gcc -o conftest -g -O2   -static-libstdc++ -static-libgcc conftest.c  >&5
gcc: unrecognized option '-static-libstdc++'
configure:4937: $? = 0
configure:4938: result: yes


Ok?


diff --git a/binutils/configure b/binutils/configure
index a2671fb..d9cb7b8 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -4981,7 +4981,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
 #error -static-libstdc++ not implemented
 #endif
 int main() {}
diff --git a/binutils/configure.ac b/binutils/configure.ac
index 04cf83f..c819263 100644
--- a/binutils/configure.ac
+++ b/binutils/configure.ac
@@ -1269,7 +1269,7 @@ if test "$GCC" = yes; then
   AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
   AC_LANG_PUSH(C++)
   AC_LINK_IFELSE([
-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
 #error -static-libstdc++ not implemented
 #endif
 int main() {}],


             reply	other threads:[~2013-09-03 21:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 21:39 Mike Stump [this message]
2013-09-03 21:54 ` Mike Stump
2013-09-03 22:07 ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CBD32A0D-4296-49CA-B5A5-6147011AEA84@comcast.net \
    --to=mikestump@comcast.net \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox