From: Charles Wilson Date: Sat, 1 Jun 2002 14:09:50 +0000 (+0000) Subject: * NEWS: Updated. X-Git-Tag: release-1-5~109 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7cb0a065a5fba68e86fc4e3979131714b0c52d83;p=thirdparty%2Flibtool.git * NEWS: Updated. * libtool.m4: use $NM to create the symbol list on cygwin, not $ltdll_cmds as on mingw. For all tags, (and host=cygwin) set allow_undefined_flag="" so that the --auto-import magic works properly. For all tags (and host=cygiwn) set always_export_symbols=no -- it is unnecessary thanks to binutils' auto-export magic. * libltdl/ltdl.c: Don't force cygwin to use the LoadLibrary wrapper; use cygwin's builtin implementatino of dl*. * cdemo/Makefile.am: the downside of unsetting 'allow_undefined_flag' -- we must include -no-undefined in the _la_LDFLAGS variable. * depdemo/l1/Makefile.am: ditto. * depdemo/l2/Makefile.am: ditto. * depdemo/l3/Makefile.am: ditto. * depdemo/l4/Makefile.am: ditto. * mdemo/Makefile.am: ditto. * tagdemo/Makefile.am: ditto. * demo/Makefile.am: ditto. But also, we must make special provision to clean up the hell0 wrapper script. * pdemo/Makefile.am: ditto -no-undefined. ditto hell0. And use 'hell_static' instead of 'hell.static'. * tests/pdemo-inst.test: use 'hell_static' instead of 'hell.static'. * tests/pdemo-exec.test: ditto. --- diff --git a/ChangeLog b/ChangeLog index 442862f5f..146246c0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2002-05-31 Charles Wilson + + * NEWS: Updated. + * libtool.m4: use $NM to create the symbol list on cygwin, not + $ltdll_cmds as on mingw. For all tags, (and host=cygwin) set + allow_undefined_flag="" so that the --auto-import magic + works properly. For all tags (and host=cygiwn) set + always_export_symbols=no -- it is unnecessary thanks to + binutils' auto-export magic. + * libltdl/ltdl.c: Don't force cygwin to use the LoadLibrary + wrapper; use cygwin's builtin implementatino of dl*. + * cdemo/Makefile.am: the downside of unsetting + 'allow_undefined_flag' -- we must include -no-undefined + in the _la_LDFLAGS variable. + * depdemo/l1/Makefile.am: ditto. + * depdemo/l2/Makefile.am: ditto. + * depdemo/l3/Makefile.am: ditto. + * depdemo/l4/Makefile.am: ditto. + * mdemo/Makefile.am: ditto. + * tagdemo/Makefile.am: ditto. + * demo/Makefile.am: ditto. But also, we must make special + provision to clean up the hell0 wrapper script. + * pdemo/Makefile.am: ditto -no-undefined. ditto hell0. + And use 'hell_static' instead of 'hell.static'. + * tests/pdemo-inst.test: use 'hell_static' instead + of 'hell.static'. + * tests/pdemo-exec.test: ditto. + 2002-05-30 Charles Wilson * tests/build-relink2.test: look for installed libl3.la diff --git a/NEWS b/NEWS index 739a4fa9f..b1f2f52b3 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ NEWS - list of user-visible changes between releases of GNU Libtool New in 1.4f: 2002-??-??; CVS version 1.4e, Libtool team: +* libltdl will now use cygwins dlopen API instead of always forcing + LoadLibrary. * Support auto-import patch to binutils on cygwin for much improved dll support. * Bug fixes. diff --git a/cdemo/Makefile.am b/cdemo/Makefile.am index 4f9d2930a..62c930f87 100644 --- a/cdemo/Makefile.am +++ b/cdemo/Makefile.am @@ -8,6 +8,7 @@ noinst_LTLIBRARIES = libfoo.la libfoo_la_SOURCES = foo.c libfoo_la_LIBADD = $(LIBM) +libfoo_la_LDFLAGS = -no-undefined noinst_HEADERS = foo.h diff --git a/demo/Makefile.am b/demo/Makefile.am index 08eb0895c..02340faf6 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -8,14 +8,14 @@ EXTRA_DIST = acinclude.m4 lib_LTLIBRARIES = libhello.la libhello_la_SOURCES = hello.c foo.c libhello_la_LIBADD = $(LIBM) -libhello_la_LDFLAGS = -version-info 3:12:1 +libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1 include_HEADERS = foo.h if BINARY_HELLDL BUILD_helldl = helldl else -BUILD_helldl = +BUILD_helldl = endif bin_PROGRAMS = hell hell_static $(BUILD_helldl) @@ -125,16 +125,20 @@ libhell0_a_SOURCES = hello.c foo.c EXTRA_LTLIBRARIES = libhell1.la libhell2.la libhell1_la_SOURCES = hell1.c libhell1_la_LIBADD = -L. -lhell0 -libhell1_la_LDFLAGS = -rpath $(libdir) +libhell1_la_LDFLAGS = -no-undefined -rpath $(libdir) libhell1_la_DEPENDENCIES = libhell0.a libhell2_la_SOURCES = hell2.c libhell2_la_LIBADD = -L. -lhell0 -libhell2_la_LDFLAGS = -rpath $(libdir) +libhell2_la_LDFLAGS = -no-undefined -rpath $(libdir) libhell2_la_DEPENDENCIES = libhell0.a EXTRA_PROGRAMS = hell0 hell0_SOURCES = main.c hell0_LDADD = libhell1.la libhell2.la $(LIBM) -CLEANFILES += $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) +# 'hell0' in EXTRA_PROGRAMS gets translated to 'hell0.exe'; but we +# must explicitly list the wrapper script 'hell0'. (bin_PROGRAMS +# are handled seamlessly by automake rules; the extra step is only +# necessary for EXTRA_PROGRAMS) +CLEANFILES += $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) hell0 deplibs-check: hell0$(EXEEXT) diff --git a/depdemo/l1/Makefile.am b/depdemo/l1/Makefile.am index 2e2d37cb9..00d99835d 100644 --- a/depdemo/l1/Makefile.am +++ b/depdemo/l1/Makefile.am @@ -6,3 +6,4 @@ INCLUDES = -I$(top_srcdir) lib_LTLIBRARIES = libl1.la libl1_la_SOURCES = l1.c l1.h +libl1_la_LDFLAGS = -no-undefined diff --git a/depdemo/l2/Makefile.am b/depdemo/l2/Makefile.am index 63924398b..d3255b9c9 100644 --- a/depdemo/l2/Makefile.am +++ b/depdemo/l2/Makefile.am @@ -6,4 +6,5 @@ INCLUDES = -I$(top_srcdir) lib_LTLIBRARIES = libl2.la libl2_la_SOURCES = l2.c l2.h +libl2_la_LDFLAGS = -no-undefined libl2_la_LIBADD = $(top_builddir)/l1/libl1.la diff --git a/depdemo/l3/Makefile.am b/depdemo/l3/Makefile.am index 873fca7e7..3a71e807f 100644 --- a/depdemo/l3/Makefile.am +++ b/depdemo/l3/Makefile.am @@ -8,4 +8,5 @@ extradir = $(libdir)/extra lib_LTLIBRARIES = libl3.la libl3_la_SOURCES = l3.c l3.h +libl3_la_LDFLAGS = -no-undefined libl3_la_LIBADD = $(top_builddir)/l1/libl1.la $(top_builddir)/l2/libl2.la diff --git a/depdemo/l4/Makefile.am b/depdemo/l4/Makefile.am index 133e9d2d4..0dd4acfbf 100644 --- a/depdemo/l4/Makefile.am +++ b/depdemo/l4/Makefile.am @@ -6,4 +6,5 @@ INCLUDES = -I$(top_srcdir) lib_LTLIBRARIES = libl4.la libl4_la_SOURCES = l4.c l4.h +libl4_la_LDFLAGS = -no-undefined libl4_la_LIBADD = $(top_builddir)/l3/libl3.la $(LIBM) diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 326e690ec..40b8bcec6 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -911,11 +911,7 @@ lt_estrdup (str) /* --- DLOPEN() INTERFACE LOADER --- */ -/* Older Cygwin dlopen implementations print a spurious error message to - stderr if the call to LoadLibrary() fails for any reason. We can - mitigate this by not using the Cygwin implementation, and falling - back to our own LoadLibrary() wrapper. */ -#if HAVE_LIBDL && !defined(__CYGWIN__) +#if HAVE_LIBDL /* dynamic linking with dlopen/dlsym */ @@ -1734,7 +1730,7 @@ lt_dlinit () handles = 0; user_search_path = 0; /* empty search path */ -#if HAVE_LIBDL && !defined(__CYGWIN__) +#if HAVE_LIBDL errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen"); #endif #if HAVE_SHL_LOAD diff --git a/libtool.m4 b/libtool.m4 index 0fa0c1730..e0d35df6f 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -2584,8 +2584,7 @@ case $host_os in # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(always_export_symbols, $1)=no if $LD --help 2>&1 | egrep 'auto-import' > /dev/null; then _LT_AC_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' @@ -3164,7 +3163,7 @@ if AC_TRY_EVAL(ac_compile); then done # Clean up. - rm -f a.out + rm -f a.out a.exe else echo "libtool.m4: error: problem compiling C++ test program" fi @@ -4496,8 +4495,7 @@ EOF # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(always_export_symbols, $1)=no if $LD --help 2>&1 | egrep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' @@ -4797,7 +4795,6 @@ EOF # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index fe8866e3e..2141e0d2f 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -10,7 +10,7 @@ lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la foo1_la_SOURCES = foo1.c foo1_la_LIBADD = $(LIBM) libsub.la -foo1_la_LDFLAGS = -module -avoid-version +foo1_la_LDFLAGS = -no-undefined -module -avoid-version libfoo2_la_SOURCES = foo2.c libfoo2_la_LIBADD = $(LIBM) libsub.la diff --git a/pdemo/Makefile.am b/pdemo/Makefile.am index a3537c00c..204be61c8 100644 --- a/pdemo/Makefile.am +++ b/pdemo/Makefile.am @@ -8,17 +8,17 @@ EXTRA_DIST = acinclude.m4 lib_LTLIBRARIES = libhello.la libhello_la_SOURCES = longer_file_name_hello.c longer_file_name_foo.c longer_file_name_foo2.c libhello_la_LIBADD = $(LIBM) -libhello_la_LDFLAGS = -version-info 3:12:1 +libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1 include_HEADERS = foo.h if BINARY_HELLDL BUILD_helldl = helldl else -BUILD_helldl = +BUILD_helldl = endif -bin_PROGRAMS = hell hell.static $(BUILD_helldl) +bin_PROGRAMS = hell hell_static $(BUILD_helldl) # Build hell from longer_file_name_main.c and libhello.la hell_SOURCES = longer_file_name_main.c @@ -125,16 +125,20 @@ libhell0_a_SOURCES = longer_file_name_hello.c longer_file_name_foo.c EXTRA_LTLIBRARIES = libhell1.la libhell2.la libhell1_la_SOURCES = longer_file_name_hell1.c libhell1_la_LIBADD = -L. -lhell0 -libhell1_la_LDFLAGS = -rpath $(libdir) +libhell1_la_LDFLAGS = -no-undefined -rpath $(libdir) libhell1_la_DEPENDENCIES = libhell0.a libhell2_la_SOURCES = longer_file_name_hell2.c libhell2_la_LIBADD = -L. -lhell0 -libhell2_la_LDFLAGS = -rpath $(libdir) +libhell2_la_LDFLAGS = -no-undefined -rpath $(libdir) libhell2_la_DEPENDENCIES = libhell0.a EXTRA_PROGRAMS = hell0 hell0_SOURCES = longer_file_name_main.c hell0_LDADD = libhell1.la libhell2.la $(LIBM) -CLEANFILES += $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) +# 'hell0' in EXTRA_PROGRAMS gets translated to 'hell0.exe'; but we +# must explicitly list the wrapper script 'hell0'. (bin_PROGRAMS +# are handled seamlessly by automake rules; the extra step is only +# necessary for EXTRA_PROGRAMS) +CLEANFILES += $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) hell0 deplibs-check: hell0 diff --git a/tagdemo/Makefile.am b/tagdemo/Makefile.am index 9baf15b0e..db5ae4aa5 100644 --- a/tagdemo/Makefile.am +++ b/tagdemo/Makefile.am @@ -10,10 +10,12 @@ noinst_LTLIBRARIES = libfoo.la lib_LTLIBRARIES = libbaz.la libfoo_la_SOURCES = foo.cpp +libfoo_la_LDFLAGS = -no-undefined libfoo_la_LIBADD = $(LIBM) # Test some of the ILD support when using tagged configurations. libbaz_la_SOURCES = baz.cpp +libbaz_la_LDFLAGS = -no-undefined libbaz_la_LIBADD = libfoo.la noinst_HEADERS = foo.h baz.h diff --git a/tests/pdemo-exec.test b/tests/pdemo-exec.test index 38b44ab26..6c38aae72 100755 --- a/tests/pdemo-exec.test +++ b/tests/pdemo-exec.test @@ -20,9 +20,9 @@ fi echo "Executing uninstalled programs in ../pdemo" status=0 -if ../pdemo/hell.static| grep 'Welcome to GNU Hell'; then : +if ../pdemo/hell-static| grep 'Welcome to GNU Hell'; then : else - echo "$0: cannot execute ../pdemo/hell.static" 1>&2 + echo "$0: cannot execute ../pdemo/hell_static" 1>&2 status=1 fi diff --git a/tests/pdemo-inst.test b/tests/pdemo-inst.test index 0c54ec70c..a23d8a578 100755 --- a/tests/pdemo-inst.test +++ b/tests/pdemo-inst.test @@ -25,9 +25,9 @@ $make install || exit 1 echo "= Executing installed programs" status=0 -if $prefix/bin/hell.static | grep 'Welcome to GNU Hell'; then : +if $prefix/bin/hell_static | grep 'Welcome to GNU Hell'; then : else - echo "$0: cannot execute $prefix/bin/hell.static" 1>&2 + echo "$0: cannot execute $prefix/bin/hell_static" 1>&2 status=1 fi