+2001-09-11 Gary V. Vaughan <gary@gnu.org>, Albert Chin <china@thewrittenword.com>. Tim Van Holder <tim.van.holder@pandora.be>
+
+ * libtool.m4 (no_undefine_flag) [solaris*]: Don't set this flag
+ if GCC < 3.0 with native ld, which introduces a dependency on
+ libgcc.a under certain circumstances, which in turn violates
+ -no-undefined. Also display a prominent configure time warning if
+ the buggy combination of GCC and ld is detected.
+ (AC_LIBTOOL_HEADER_ASSERT): libltdl falls foul of this bug
+ because assert requires __eprintf from libgcc.a. This macro
+ detects the combination of GCC and ld that produce this problem,
+ and pretends that assert.h does not exist...
+ * libltdl/ltdl.c (HAVE_ASSERT_H): ...so that assertions can be
+ disabled in libltdl. Otherwise the library would only be useable
+ when linking using gcc, or by manually adding libgcc.a to the link
+ line of the application that uses libltdl.
+ * ltdl.m4 (AC_LIB_LTDL): Require AC_LIBTOOL_HEADER_ASSERT.
+ * doc/PLATFORMS: Updated.
+
2001-06-25 Daniel Harvey <daniel@amristar.com.au>
* libtool.m4 (ltdll_cmds): [$]0 doesn't appear to translate through
i*86-*-netbsd1.2 gcc 0.9g ok
i*86-*-linux-gnu gcc 1.3e ok (1.901)
(Red Hat 7.0, gcc "2.96")
-i*86-*-linux-gnu gcc 1.3e ok (1.911)
+i*86-*-linux-gnu gcc 1.4.2 ok
(SuSE 7.0, gcc 2.95.2)
i*86-*-linux-gnulibc1 gcc 1.2f ok
i*86-*-openbsd2.5 gcc 1.3c ok
(gcc-2.7.2)
rs6000-ibm-aix3.2.5 gcc 1.0i ok
rs6000-ibm-aix3.2.5 xlc 1.0i ok
-sparc-sun-solaris2.8 gcc 1.3e ok (1.913)
- (gcc-2.95.3 & native ld)
+sparc-sun-solaris2.8 gcc 1.4.2 ok
+ (gcc-2.95.2 & native ld)
+sparc-sun-solaris2.8 gcc 1.4.2 ok
+ (gcc-3.0.1 & GNU ld 2.11.2)
sparc-sun-solaris2.7 gcc 1.3e ok (1.913)
(gcc-2.95.3 & native ld)
sparc-sun-solaris2.6 gcc 1.3e ok (1.913)
(gcc-2.95.3 & native ld)
-sparc-sun-solaris2.5.1 gcc 1.3e ok (1.911)
+sparc-sun-solaris2.5.1 gcc 1.4.2 ok
+ (gcc-2.95.1 & GNU ld 2.9.1)
sparc-sun-solaris2.5 gcc 1.3b ok
(egcs-1.1.2, GNU ld 2.9.1 & native ld)
sparc-sun-solaris2.5 cc 1.3b ok
# include <argz.h>
#endif
-/* I have never seen a system without this: */
-#include <assert.h>
+#if HAVE_ASSERT_H
+# include <assert.h>
+#else
+# define assert(arg) ((void) 0)
+#endif
#include "ltdl.h"
])
+# AC_LIBTOOL_HEADER_ASSERT
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
+[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
+ [lt_cv_func_assert_works],
+ [case $host in
+ *-*-solaris*)
+ if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
+ case `$CC --version 2>/dev/null` in
+ [[12]].*) lt_cv_func_assert_works=no ;;
+ *) lt_cv_func_assert_works=yes ;;
+ esac
+ fi
+ ;;
+ esac])
+
+if test "x$lt_cv_func_assert_works" = xyes; then
+ AC_CHECK_HEADERS(assert.h)
+fi
+])# AC_LIBTOOL_HEADER_ASSERT
+
# _LT_AC_CHECK_DLFCN
# --------------------
AC_DEFUN([_LT_AC_CHECK_DLFCN],
;;
solaris*)
- no_undefined_flag=' -z text'
+ # gcc --version < 3.0 without binutils cannot create self contained
+ # shared libraries reliably, requiring libgcc.a to resolve some of
+ # the object symbols generated in some cases. Libraries that use
+ # assert need libgcc.a to resolve __eprintf, for example. Linking
+ # a copy of libgcc.a into every shared library to guarantee resolving
+ # such symbols causes other problems: According to Tim Van Holder
+ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
+ # (to the application) exception stack for one thing.
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ case `$CC --version 2>/dev/null` in
+ [[12]].*)
+ cat <<EOF 1>&2
+
+*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
+*** create self contained shared libraries on Solaris systems, without
+*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
+*** -no-undefined support, which will at least allow you to build shared
+*** libraries. However, you may find that when you link such libraries
+*** into an application without using GCC, you have to manually add
+*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
+*** upgrade to a newer version of GCC. Another option is to rebuild your
+*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
+
+EOF
+ no_undefined_flag=
+ ;;
+ esac
+ fi
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
AC_REQUIRE([AC_C_CONST])
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([AC_HEADER_DIRENT])
+AC_REQUIRE([AC_LIBTOOL_HEADER_ASSERT])
AC_REQUIRE([_LT_AC_CHECK_DLFCN])
AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])
AC_REQUIRE([AC_LTDL_SHLIBEXT])