[Bug bootstrap/37660] [4.4 Regression] Error Building libssp, recent update

dannysmith at users dot sourceforge dot net gcc-bugzilla@gcc.gnu.org
Thu Jan 15 02:39:00 GMT 2009



------- Comment #3 from dannysmith at users dot sourceforge dot net  2009-01-15 02:39 -------
I believe that this failure reflects the fact that PE_COFF dll's do not allow
undefined symbols. Because of that, the rule to decide shared vs static libgcc 
in  gcc.c init_gcc_spec, namely the case for building a shared lib:
        "%{shared:", shared_name, "}"
is not quite right.   It should be (I think)
       "%{shared:", shared_name, , static_name "}"
However, since a shared libgcc is a new thing on cygwin and mingw, it may be
better for this release to actually require an explicit -shared-libgcc to get
the shared lib. That is what mingw32 does, by defining its own
REAL_LIBGCC_SPEC.

Does this patch fix the problem for you?

Index: config/i386/cygwin.h
===================================================================
--- config/i386/cygwin.h        (revision 143259)
+++ config/i386/cygwin.h        (working copy)
@@ -49,9 +49,17 @@
    GCC without making a new CYGWIN.DLL, so we leave it.  Profiling is handled
    by calling the init function from main.  */

-#undef LIBGCC_SPEC
-#define LIBGCC_SPEC \
-  "%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} -lgcc      \
+#
+#ifdef ENABLE_SHARED_LIBGCC
+#define SHARED_LIBGCC_SPEC "%{shared-libgcc:-lgcc_s}
%{!shared-libgcc:-lgcc_eh}"
+#else
+#define SHARED_LIBGCC_SPEC /*empty*/
+#endif
+#undef REAL_LIBGCC_SPEC
+#define REAL_LIBGCC_SPEC \
+  "%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} \
+   "SHARED_LIBGCC_SPEC" \
+   -lgcc \
    %{mno-cygwin:-lmoldname -lmingwex -lmsvcrt}"

 /* We have to dynamic link to get to the system DLLs.  All of libc, libm and


-- 

dannysmith at users dot sourceforge dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dannysmith at users dot
                   |                            |sourceforge dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37660



More information about the Gcc-bugs mailing list