This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[patch mingw]: Cleanup about static/shared libgcc


Hi,

this patch synchronize handling - and fixes latent bug - of
static/shared flags with cygwin-host.
in static case prior code added to linker-script reference to shared
libgcc, which is obviously wrong.
Due link-order the shared version doesn't get actual linked, but
nevertheless there is a latent issue.

ChangeLog

2012-11-29  Kai Tietz

	* config/i386/mingw32.h (SHARED_LIBGCC_SPEC): Synchronize with
	cygwin-host.

Tested for i686-w64-mingw32, and x86_64-w64-mingw32.  I will apply
tomorrow if there aren't any objections.

Regards,
Kai

Index: mingw32.h
===================================================================
--- mingw32.h	(Revision 193925)
+++ mingw32.h	(Arbeitskopie)
@@ -121,15 +121,24 @@

 /* Include in the mingw32 libraries with libgcc */
 #ifdef ENABLE_SHARED_LIBGCC
-#define SHARED_LIBGCC_SPEC "%{shared-libgcc:-lgcc_s}
%{!shared-libgcc:-lgcc_eh}"
+#define SHARED_LIBGCC_SPEC " \
+ %{static|static-libgcc:-lgcc -lgcc_eh} \
+ %{!static: \
+   %{!static-libgcc: \
+     %{!shared: \
+       %{!shared-libgcc:-lgcc -lgcc_eh} \
+       %{shared-libgcc:-lgcc_s -lgcc} \
+      } \
+     %{shared:-lgcc_s -lgcc} \
+    } \
+  } "
 #else
-#define SHARED_LIBGCC_SPEC /*empty*/
+#define SHARED_LIBGCC_SPEC " -lgcc "
 #endif
 #undef REAL_LIBGCC_SPEC
 #define REAL_LIBGCC_SPEC \
   "%{mthreads:-lmingwthrd} -lmingw32 \
    "SHARED_LIBGCC_SPEC" \
-   -lgcc \
    -lmoldname -lmingwex -lmsvcrt"

 #undef STARTFILE_SPEC


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