-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Chuck,
I attached two patches for libtool for your consideration: 1) 2.2-export-all-symbols.patch: On Cygwin, the --export-all-symbols linker flag is required; - --export-dynamic has no effect (see http://sourceware.org/bugzilla/show_bug.cgi?id=6744). This patch fixes two problems: 1) LT_SYS_DLOPEN_SELF returns a false negative; 2) Using the -export-dynamic libtool flag does not affect the resulting binary. 2) 2.2-gcc4-libs.patch: With gcc4 providing shared libs, it should now perfectly legitimate to add any of these libs to the libtool link command. Right now, though, libtool can't find these libraries because $sys_lib_search_path_spec is hard-coded to ignore it, and libtool will refuse to link against any library it can't find (even though the linker itself can). Instead, this patch simply adds /usr/lib/w32api to the default gcc-specific search path. The m4_if() makes sure that w32api is added only once, as is done with Darwin a few lines later. Yaakov -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAknKwJIACgkQpiWmPGlmQSPW5gCg/GZFiM5txCIWxu45tSFY+bi+ NSsAn0W0YaD3m+Casxtc/yH1OlVmQtIa =9w+D -----END PGP SIGNATURE-----
On Cygwin, the --export-all-symbols linker flag is required; --export-dynamic has no effect (see http://sourceware.org/bugzilla/show_bug.cgi?id=6744). This patch fixes two problems: 1) LT_SYS_DLOPEN_SELF returns a false negative; 2) Using the -export-dynamic libtool flag does not affect the resulting binary. * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) [cygwin*|mingw*|pw32*|cegcc*]: Define export_dynamic_flag_spec as -Wl,--export-all-symbols, as required by GNU ld for PE-COFF. --- origsrc/libtool-2.2.6/libltdl/m4/libtool.m4 2008-09-05 06:54:41.000000000 -0500 +++ src/libtool-2.2.6/libltdl/m4/libtool.m4 2009-03-25 16:25:45.239000000 -0500 @@ -4322,6 +4322,7 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
With gcc4 providing shared libs, it should now perfectly legitimate to add any of these libs to the libtool link command. Right now, though, libtool can't find these libraries because $sys_lib_search_path_spec is hard-coded to ignore it, and libtool will refuse to link against any library it can't find (even though the linker itself can). Instead, this patch simply adds /usr/lib/w32api to the default gcc-specific search path. The m4_if() makes sure that w32api is added only once, as is done with Darwin a few lines later. * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) [cygwin*]: Add w32api to sys_lib_search_path_spec without overriding gcc's own search path. --- origsrc/libtool-2.2.6/libltdl/m4/libtool.m4 2008-09-05 06:54:41.000000000 -0500 +++ src/libtool-2.2.6/libltdl/m4/libtool.m4 2009-03-25 16:25:45.239000000 -0500 @@ -2228,7 +2228,8 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix
-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/