[PATCH] Use correct export_dynamic_flag_spec for PE-COFF $hosts
* 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. Original patch by Yaakov Selkowitz. As he explained: 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. Tested in combination with several other cygwin patches, as part of the recent cygwin official 2.2.7a-N libtool release(s): http://cygwin.com/ml/cygwin-announce/2009-03/msg00080.html http://cygwin.com/ml/cygwin-announce/2009-03/msg00081.html No regressions. Okay to push? --- libltdl/m4/libtool.m4 |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 477f6e3..15612c0 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -4275,6 +4275,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 -- 1.6.1.2
Re: [PATCH] Use correct export_dynamic_flag_spec for PE-COFF $hosts
On Sun, 29 Mar 2009, Charles Wilson wrote: * 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. Original patch by Yaakov Selkowitz. As he explained: 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. Tested in combination with several other cygwin patches, as part of the recent cygwin official 2.2.7a-N libtool release(s): http://cygwin.com/ml/cygwin-announce/2009-03/msg00080.html http://cygwin.com/ml/cygwin-announce/2009-03/msg00081.html No regressions. Okay to push? If you are sure that --export-all-symbols will work with older (within reason) Cygwin and MinGW installs, then this seems ok to push. I do see support for --export-all-symbols in my archaic MinGW install so the risk of problems seems low. Bob libltdl/m4/libtool.m4 |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 477f6e3..15612c0 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -4275,6 +4275,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 -- 1.6.1.2 -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
Re: [PATCH] Use correct export_dynamic_flag_spec for PE-COFF $hosts
Bob Friesenhahn wrote: No regressions. Okay to push? If you are sure that --export-all-symbols will work with older (within reason) Cygwin and MinGW installs, then this seems ok to push. I do see support for --export-all-symbols in my archaic MinGW install so the risk of problems seems low. auto-export was added more than 10 years ago: Mon Nov 9 16:41:30 1998 DJ Delorie ... * emultempl/pe.em (gld_i386_list_options): list dll-specific options. * pe-dll.c (process_def_file): auto-export everything if nothing is otherwise exported. and IIRC --export-all-symbols was part of that addition. I know I updated the (scanty, at the time) documentation for --export-all-symbols in 2001: 2001-08-02 Charles Wilson ... * ld.texinfo: add additional documentation for --export-all-symbols. Document --out-implib, --enable-auto-image-base, --disable-auto-image-base, --dll-search-prefix, --enable-auto-import, and --disable-auto-import. * ldint.texinfo: Add detailed documentation on auto-import implementation. So I think we're good... -- Chuck