PATCH: mingw32.h: define JCR_SECTION_NAME when cross compiling and weak symbols are not supported by the build machine

Danny Smith
Wed Jul 2 07:15:00 GMT 2008

On Mon, Jun 30, 2008 at 1:14 PM, Marcelo Slomp <> wrote:
> Problem: cross compiling GCC 4.x series for the mingw32 target fails in gcc/config/i386/cygming-crtbegin.c due to a__JCR_LIST__ conflict.
> There is a post in the mingw-users list archives that expose this issue:
> Solution: JCR_SECTION_NAME is defined only if weak symbols are supported. (gcc/defaults.h:363)
> This is valid, for example, in a native mingw32 build, but this is not ever true when cross compiling,
> depending on the build machine (here, i686-pc-linux-gnu).
> In these cases, we need define it, because TARGET_USE_JCR_SECTION is always 1, causing the problem
> mentioned in the post above (now gcc/config/i386/cygming-crtbegin.c:80 - no :72).
> Marcelo A. B. Slomp

The problem was that we were always  using .,jcr section  without
regard for GAS_HAVE_WEAK
I have applied this patch to fix.

2008-07-02  Danny Smith  <>

	* config/i386/mingw32.h (TARGET_USE_JCR_SECTION): Undef to let
	defaults.h definition apply.

Index: config/i386/mingw32.h
--- config/i386/mingw32.h	(revision 137339)
+++ config/i386/mingw32.h	(working copy)
@@ -160,9 +160,8 @@

-/* JCR_SECTION works on mingw32.  */
+/* Let defaults.h definition of TARGET_USE_JCR_SECTION apply. */


More information about the Gcc-patches mailing list