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/4.4 Regression] Fix PR37660 libssp build failure during bootstrap on Cygwin.


    Hello everyone,

  This patch is my suggestion to fix PR37660.  The failure occurs during
linking libssp against shared libgcc.  The _chkstk function is added to libgcc
by declaring it in LIB1ASMFUNCS, but as it is target-specific it is not
declared in the ABI and map file and so does not get exported, meaning it
cannot be found when linking with -lgcc_s.  (A further problem would be
manifest WRT the _ctors.o module, if the build had completed and if DW-2 EH
had been enabled, as this holds the head of the CTORS and DTORS lists and must
be statically linked into the executable, and cannot pulled in from a shared
library.)

  One approach to fixing this (proposed by Danny in the PR) would be to pull
static libgcc into the shared link, and let it fill out any missing symbols.
The approach I've taken here is an alternative strategy that has been working
well in the Cygwin and MinGW distributions for some time: we exclude the
chkstk and ctors modules from the final link of the DLL, and insert them
wholesale into the DLL's supporting import library (a static archive with
stubs that import references from the DLL).

  This patch affects only target-specific code for Cygwin.  Tested by
completing a bootstrap, eyeballing the command line in the build log for
correctness and verifying the contents of DLL and import library were correct
by using 'nm'.  Testsuite is still running, nothing surprising showing up (I
appear to have run into PR31827 for unrelated reasons); there's not a proper
baseline to compare it to, since it's been broken for a bit, but I'll make
sure the results are comparable with the most recent results on the
-testresults list, which were done with --disable-shared (which is why they
didn't hit this problem).

  OK for HEAD?

gcc/ChangeLog

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

	PR bootstrap/37660
	* config.gcc (cygwin target stanza):  Order t- frags from generic
	in tmake_file to specific to enable inheritance/override.
	* config/i386/t-cygwin (gen_shell_filter_in,
	gen_shell_filter_out):  Add new helper macro definitions.
	(SHLIB_LINK):  Override t-mingw definition and use them to place
	chkstk and ctors into import library wholesale.

    cheers,
      DaveK

Attachment: libgcc_s-chkstk-patch.diff
Description: Binary data


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