Hi there, This is a first patch of a couple with the desire to make Libtool work better on CYGWIN and MinGW, and to reconcile local changes of their respective Libtool packages (or common use) into GNU Libtool proper.
First, please excuse the cross-post to two mailing lists (and the long lines). As the mingw-users list is not writable for non-members, you may want to remove it in followup posts. As far as I can see, --enable-auto-image-base works on cygwin/mingw/pw targets, and its use has indeed been either suggested or is routinely useby developers from both systems. The last bug report I could find about this is [1], and AFAICS that's been resolved more than two years ago now. Are there any issues with this patch? Maybe with respect to cross compilation? Can we assume this to work on supported mingw/cygwin installations? Does this patch change the necessity for relinking upon installation in any way (maybe under some circumstances)? I believe not, and CVS HEAD should not be relinking at all anyway. (BTW, Earnie, you have more changes to $archive_cmds in your hacked version of `libtool', but I believe they require a separate discussion, whereas this should be pretty straightforward.) So, is there any reason I should not commit this to Libtool CVS HEAD and similarly to branch-1-5? Cheers, and thanks for your attention, Ralf [1] http://lists.gnu.org/archive/html/bug-binutils/2005-02/msg00067.html 2005-09-07 Charles Wilson <[EMAIL PROTECTED]> * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [ cygwin, mingw, pw32 ]: Use --enable-auto-image-base instead of a fixed image base address. Index: libltdl/m4/libtool.m4 =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v retrieving revision 1.15 diff -u -r1.15 libtool.m4 --- libltdl/m4/libtool.m4 6 Sep 2005 20:58:34 -0000 1.15 +++ libltdl/m4/libtool.m4 7 Sep 2005 19:21:37 -0000 @@ -3917,7 +3917,7 @@ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then @@ -3926,7 +3926,7 @@ echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -5175,7 +5175,7 @@ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then @@ -5184,7 +5184,7 @@ echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi