[patch i386]: PR/39356 name collision of __chkstk

Danny Smith dansmister@gmail.com
Mon Mar 23 21:02:00 GMT 2009


> We used to generate for (64-bit) the tool gendef (an earlier and a bit
> adjusted version of it). So we simply used the approach export each
> symbol from default DLLs. Yes it seem so, that on 64-bit systems the
> __chkstk (for older OSes the chkstk.o) is getting exported by
> kernel32.dll and ntdll.dll.
>
>> How does the ntdll.dll export of  "_chkstk" cause you problems in 4.4
>> but not in 4.3.
>> WTF  has changed.
>
> The change is the shared libgcc.dll. This symbol is now exported by
> it. For 4.3 the static version was used. So the exports from
> kernel32/ntdll can collide with libgcc version, when the link order is
> changed in that way, that kernel32 is linked before libgcc.

On my builds on 32 bit mingw.,  libgcc_s*.dll does not export symbol's
in cygwin.o
Does it do so on mingw64?  Why?

This recent revision may be relevant:

2009-01-31  Dave Korn  <dave.korn.cygwin@gmail.com>

	PR target/38904
	* mkmap-flat.awk (END):  Use pe_dll command-line arg to pass
	LIBRARY name in, instead of hard-coding it.
	* config.gcc (i[34567]86-*-pe | i[34567]86-*-cygwin*):  Add an
	extra target make frag to tmake_files according to EH model.
	(i[34567]86-*-mingw* | x86_64-*-mingw*):  Likewise.
	* config/i386/t-dw2-eh, config/i386/t-sjlj-eh:  Add new target
	frags that define makefile variable EH_MODEL appropriately.
	* config/i386/cygming.h (DWARF2_UNWIND_INFO):  Add comment.
	* config/i386/cygwin.h (LIBGCC_EH_EXTN):  Define to nothing or
	to "-sjlj" according to type of EH configured.
	(LIBGCC_SONAME):  Concatenate it to shared library base name.
	* config/i386/mingw32.h (LIBGCC_EH_EXTN):  Define to "_dw2" or
	to "_sjlj" according to type of EH configured.
	(LIBGCC_SONAME):  Concatenate it to shared library base name.
	* config/i386/t-cygming (SHLIB_SONAME):  Use EH_MODEL.
	(SHLIB_LINK):  Add missing semicolon to if-else construct.
	(SHLIB_MKMAP_OPTS):  Pass library name to mkmap-flat.awk as
	string value of "pe_dll" command-line option.
	* config/i386/t-cygwin (SHLIB_EH_EXTENSION):  New helper.
	(SHLIB_SONAME):  Use it when overriding t-cygming default.
	(SHLIB_IMPLIB):  Override t-cygming default.
	(SHLIB_MKMAP_OPTS):  Pass library name to mkmap-flat.awk as
	string value of "pe_dll" command-line option.l



More information about the Gcc-patches mailing list