[PING^2.5months] Build libstdc++ as a DLL on Windows.

Dave Korn dave.korn.cygwin@googlemail.com
Mon Sep 28 11:45:00 GMT 2009


    Hi all,

  Stage 1 is imminently drawing to an end, so here once more and hopefully for
the final time, is the patch I've been repeatedly posting and keeping updated
to head since mid-July.  It's already been approved from the w32/i386 backend
and build machinery POV, and just needs an OK from a v3 maintainer.

  Ben K. expressed an interest in reviewing the patch, mentioning also that he
had some reservations; if I understood correctly, about the uglification of
adding the _GLIBCXX_IMPORT markup tag, and he wanted to explore a
visibility-based approach.  Unfortunately he got bogged down in build
environment difficulties, and I haven't heard back from him in a week now, so
I can only assume he's swamped in work or otherwise AFK in this matter, and am
posting the patch once more to try and scrounge up a bit more "maintainer
resource" :-)

  I don't know if he's close to getting his alternate approach working, but it
would be a real shame if yet another major release series of GCC goes out the
door still not supporting shared libstdc++ on Windows platforms, and we can
always take the annotations out again if a better way of doing it becomes
available, and indeed that would be a more minor change probably allowable in
stage 3, but right now this is a new feature and so I'd like to have it
approved as part of stage 1, even if we decide I shouldn't check it in
straight away until Ben has had a chance to get back to us.

  Bootstrapped on i686-pc-cygwin, tests are still running currently but there
is no reason to expect any change in the consistently positive results that
this patch has been showing since I first posted it two and a half months ago.

  Ok for head?

gcc/ChangeLog:

	* configure.ac (USE_CYGWIN_LIBSTDCXX_WRAPPERS): Define to reflect
	status of AC_CHECK_FUNC for Cygwin DLL libstdc++ support wrappers.
	* configure: Regenerate.
	* config.in: Regenerate.

	* config/i386/cygwin.h (CXX_WRAP_SPEC_LIST): Define list of --wrap
	options for Cygwin DLL libstdc++ support wrappers.
	(CXX_WRAP_SPEC_OPT): Define spec to use wrappers or not by default
	according to defined value of USE_CYGWIN_LIBSTDCXX_WRAPPERS.
	(CXX_WRAP_SPEC): Define entire wrapper spec in or out according to
	whether USE_CYGWIN_LIBSTDCXX_WRAPPERS is even defined or not.
	(LINK_SPEC): Include CXX_WRAP_SPEC.
	* config/i386/cygming.opt (muse-libstdc-wrappers): New option for
	Cygwin targets. Update copyright year.

	* gcc.c (LINK_COMMAND_SPEC): Allow and ignore -static-libstdc++
	similarly to -static.

gcc/cp/ChangeLog:

	* g++spec.c (SKIPOPT): Delete.
	(lang_specific_driver): Do not skip -static-libstdc++ option.

libstdc++-v3/ChangeLog:

	* src/Makefile.am (libstdc___la_LDFLAGS): Add -no-undefined and
	-bindir switches.
	* src/Makefile.in: Regenerate.

	* config/os/newlib/os_defines.h (_GLIBCXX_IMPORT): Define to
	dllimport when indicated by _GLIBCXX_DLL.
	* config/os/mingw32/os_defines.h (_GLIBCXX_IMPORT): Likewise.
	* include/bits/c++config (_GLIBCXX_IMPORT): Add empty definition
	for non-dllimport targets.

	* include/std/iostream (cin): Annotate with _GLIBCXX_IMPORT.
	(cout, cerr, clog): Likewise.
	* include/std/stdexcept (class logic_error, domain_error,
	invalid_argument, length_error, out_of_range, runtime_error,
	range_error, underflow_error): Likewise.
	* include/ext/concurrence.h (class __concurrence_lock_error,
	__concurrence_unlock_error): Likewise.
	* include/bits/locale_classes.tcc (template class collate<char>,
	collate_byname<char>, collate<wchar_t>,
	collate_byname<wchar_t>): Likewise.
	* include/bits/locale_facets.tcc (template class numpunct<char>,
	numpunct_byname<char>, num_get<char>, num_put<char>,
	ctype_byname<char>, numpunct<wchar_t>, numpunct_byname<wchar_t>,
	num_get<wchar_t>, num_put<wchar_t>, ctype_byname<wchar_t>): Likewise.
	* include/bits/locale_classes.h (class locale, facet, id, _Impl,
	locale::facet, locale::id, locale::_Impl): Likewise.
	* include/bits/locale_facets.h (template class ctype<char>,
	ctype<wchar_t>): Likewise.
	* include/bits/basic_ios.tcc (template class basic_ios<char>,
	basic_ios<wchar_t>): Likewise.
	* include/bits/ios_base.h (class ios_base, failure, Init): Likewise.
	* include/bits/istream.tcc (template class basic_istream<char>,
	basic_iostream<char>, basic_istream<wchar_t>,
	basic_iostream<wchar_t>): Likewise.
	* include/bits/codecvt.h (template class codecvt_byname<char, char,
	mbstate_t>, codecvt_byname<wchar_t, char, mbstate_t>): Likewise.
	* include/bits/ostream.tcc (template class basic_ostream<char>,
	basic_ostream<wchar_t>): Likewise.
	* include/bits/sstream.tcc (template class basic_stringbuf<char>,
	basic_istringstream<char>, basic_ostringstream<char>,
	basic_stringstream<char>, basic_stringbuf<wchar_t>,
	basic_istringstream<wchar_t>, basic_ostringstream<wchar_t>,
	basic_stringstream<wchar_t>): Likewise.
	* include/bits/basic_string.tcc (template class basic_string<char>,
	basic_string<wchar_t>, related overloaded operator<<, operator>>,
	getline): Likewise.
	* include/bits/locale_facets_nonio.tcc (template class
	moneypunct<char, false>, moneypunct<char, true>,
	moneypunct_byname<char, false>, moneypunct_byname<char, true>,
	money_get<char>, money_put<char>, __timepunct<char>, time_put<char>,
	time_put_byname<char>, time_get<char>, time_get_byname<char>,
	messages<char>, messages_byname<char>, moneypunct<wchar_t, false>,
	moneypunct<wchar_t, true>, moneypunct_byname<wchar_t, false>,
	moneypunct_byname<wchar_t, true>, money_get<wchar_t>,
	money_put<wchar_t>, __timepunct<wchar_t>, time_put<wchar_t>,
	time_put_byname<wchar_t>, time_get<wchar_t>, time_get_byname<wchar_t>,
	messages<wchar_t>, messages_byname<wchar_t>): Likewise.
	* include/bits/streambuf.tcc (template class basic_streambuf<char>,
	basic_streambuf<wchar_t>): Likewise.
	* include/bits/fstream.tcc (template class basic_filebuf<char>,
	basic_ifstream<char>, basic_ofstream<char>, basic_fstream<char>,
	basic_filebuf<wchar_t>, basic_ifstream<wchar_t>,
	basic_ofstream<wchar_t>, basic_fstream<wchar_t>): Likewise.
	* include/backward/strstream (class strstreambuf, istrstream,
	ostrstream, strstream): Likewise.
	* libsupc++/typeinfo (class type_info, bad_cast,
	bad_typeid): Likewise.
	* libsupc++/exception (class exception, bad_exception): Likewise.
	* libsupc++/new (class bad_alloc): Likewise.

	* testsuite/lib/libstdc++.exp (proc libstdc++_init): Adjust
	DEFAULT_CXXFLAGS and ld_library_path_tmp for Cygwin.

    cheers,
      DaveK

-- 
[ refs:   The original series of patches at
   [0/4]  http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01042.html
   [1/4]  http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01044.html
   [2/4]  http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01046.html
   [3/4]  http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01047.html
   [4/4]  http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01048.html
  and the tweaked respin at
          http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01631.html
  and the updated tweaked respin at
          http://gcc.gnu.org/ml/gcc-patches/2009-08/msg00877.html
  and the updated updated tweaked respin at
          http://gcc.gnu.org/ml/gcc-patches/2009-08/msg01570.html
  and the tweaked updated updated tweaked respin at
          http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00209.html
  and the tweaked tweaked updated updated tweaked respin at
          http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00500.html ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygwin-libstdc-final.diff
Type: text/x-c
Size: 39957 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20090928/0fbc5cac/attachment.bin>


More information about the Libstdc++ mailing list