[PATCH] Build libstdc++ as a DLL on Windows, updated for new autotools.

Dave Korn dave.korn.cygwin@googlemail.com
Fri Aug 28 23:21:00 GMT 2009


[ 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  ]


    Hi all,

  The recent autotools updates necessitated a minor tweak to my patch to build
libstdc++ DLLs on Windows.  While I was doing that, I realised that the linker
specs need to exclude doing the --wrap trick (see earlier posts) when
statically linking libstdc++, so I've updated it to do that(*), and I've also
updated it to take advantage of the new -bindir option just added to
libtool(**).  It's already received build and w32 maintainer approval, and Ben
(Cc'd) has offered to review the C++ side, which is the last bit that needs it.

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 status of USE_CYGWIN_LIBSTDCXX_WRAPPERS.
	(LINK_SPEC): Include CXX_WRAP_SPEC_OPT.
	* config/i386/cygming.opt (muse-libstdc-wrappers): New option for
	Cygwin targets. Update copyright year.

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.

  Bootstrapped on i686-pc-cygwin, tests still running.  Assuming no
regressions (as seen on prior testruns), OK for HEAD?

    cheers,
      DaveK
-- 
(*)  - but see http://gcc.gnu.org/ml/gcc-patches/2009-08/msg01569.html
(**) - http://gcc.gnu.org/ml/gcc-patches/2009-08/msg01073.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libstdc-dll-respun-newtools.diff
Type: text/x-c
Size: 35225 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090828/6ccc004d/attachment.bin>


More information about the Gcc-patches mailing list