]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (no_undefine_flag) [solaris*]: Don't set this flag
authorTim Van Holder <tim.van.holder@pandora.be>
Tue, 11 Sep 2001 03:18:52 +0000 (03:18 +0000)
committerGary V. Vaughan <gary@gnu.org>
Tue, 11 Sep 2001 03:18:52 +0000 (03:18 +0000)
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.

ChangeLog
doc/PLATFORMS
libltdl/ltdl.c
libtool.m4
ltdl.m4

index b4fe46563fcf361040acfbcc2827fb93c57ca2f1..15660d710626a8a409a2d85d4b95cb5d50b2a688 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+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
index 9f3a12e9c1c870475682caa6e46518063366f157..de20baa797bcfcee866ab41cacd817e136c36f05 100644 (file)
@@ -59,7 +59,7 @@ i*86-*-netbsd1.3I               gcc      1.2e     ok
 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
@@ -128,13 +128,16 @@ rs6000-ibm-aix4.1.4.0           gcc      1.2f     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
index c47e31867690846cc501de423410b2d29bd3e5a4..19293f4d0942442c5418684f7aaac764b61311a0 100644 (file)
@@ -86,8 +86,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #  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"
 
index 46c37bb706c5c5cc98a6b67fbac18e06828bf8fe..066bf6a5ce6dca41fad64dc0ad26ab172d94b6ac 100644 (file)
@@ -149,6 +149,27 @@ _LT_AC_LTCONFIG_HACK
 
 ])
 
+# 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],
@@ -1708,7 +1729,35 @@ else
     ;;
 
   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'
diff --git a/ltdl.m4 b/ltdl.m4
index 491a08b17465c7c034940b1b3a23045b05a2217c..615c4bc3f02a531f89141535995b4ff827f3a968 100644 (file)
--- a/ltdl.m4
+++ b/ltdl.m4
@@ -32,6 +32,7 @@ AC_REQUIRE([AC_PROG_CC])
 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])