This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-static-libstdc++ breaks building gdb


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() {}],


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]