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

Re: [PATCH] Build libgcc_s on Windows


On Wed, Aug 27, 2008 at 11:30 AM, Dave Korn <dave.korn@artimi.com> wrote:

> Danny Smith wrote on 19 August 2008 04:11:
>
>> While your at it you may as well clean up the use of
>> GetModuleHandle/GetProcAddress to get  in cygming-crtbegin.
>
> ... ?
>
If we add this to specs, as was done in the gcc-4.2.1 experimental
release that I
uploaded to mingw release page

/* Weak symbols do not get resolved if using a Windows dll import lib.
   Make the unwind registration references strong undefs.  */
#if DWARF2_UNWIND_INFO
#define SHARED_LIBGCC_UNDEFS_SPEC \
 "%{shared-libgcc: -u ___register_frame_info -u ___deregister_frame_info}"
#else
#define SHARED_LIBGCC_UNDEFS_SPEC ""
#endif

#undef  SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
  { "shared_libgcc_undefs", SHARED_LIBGCC_UNDEFS_SPEC }

#define LINK_SPEC "%{mwindows:--subsystem windows} \
  %{mconsole:--subsystem console} \
  %{shared: %{mdll: %eshared and mdll are not compatible}} \
  %{shared: --shared} %{mdll:--dll} \
  %{static:-Bstatic} %{!static:-Bdynamic} \
  %{shared|mdll: -e _DllMainCRTStartup@12 --enable-auto-image-base} \
  %(shared_libgcc_undefs)"


then we  make the refs to the undefined externals strong so they will
always be pullled in from the import lib.  Hence no need for the
runtime linkage.

The "downside" of this is that  we  force user to always add
"-shared-libgcc" to gcc command line rather than allow the clever user
to rely on a libgcc.dll.a vs libgcc.a  link order diff.


Danny


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