[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: 19-gary-solaris-no-undefined-FINAL.patch
From: |
Gary V. Vaughan |
Subject: |
FYI: 19-gary-solaris-no-undefined-FINAL.patch |
Date: |
Tue, 11 Sep 2001 04:24:15 +0100 |
User-agent: |
Mutt/1.3.22.1i |
Index: ChangeLog
from Gary V. Vaughan <address@hidden>, Albert Chin <address@hidden>. Tim
Van Holder <address@hidden>
* 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.
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.166.2.26
diff -u -p -u -r1.166.2.26 libtool.m4
--- libtool.m4 2001/09/11 03:09:14 1.166.2.26
+++ libtool.m4 2001/09/11 03:17:53
@@ -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
+ # <address@hidden>, 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'
Index: ltdl.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/ltdl.m4,v
retrieving revision 1.21.2.3
diff -u -p -u -r1.21.2.3 ltdl.m4
--- ltdl.m4 2001/09/03 03:26:13 1.21.2.3
+++ ltdl.m4 2001/09/11 03:17:54
@@ -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])
Index: doc/PLATFORMS
===================================================================
RCS file: /cvsroot/libtool/libtool/doc/PLATFORMS,v
retrieving revision 1.42
diff -u -p -u -r1.42 PLATFORMS
--- doc/PLATFORMS 2001/04/24 18:07:31 1.42
+++ doc/PLATFORMS 2001/09/11 03:17:54
@@ -59,7 +59,7 @@ i*86-*-netbsd1.3I gcc
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
(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: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.134.2.5
diff -u -p -u -r1.134.2.5 ltdl.c
--- libltdl/ltdl.c 2001/09/06 23:36:45 1.134.2.5
+++ libltdl/ltdl.c 2001/09/11 03:18:01
@@ -86,8 +86,11 @@ Foundation, Inc., 59 Temple Place, Suite
# 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"
--
())_. Gary V. Vaughan gary@(oranda.demon.co.uk|gnu.org)
( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____
/ )= GNU Hacker http://www.gnu.org/software/libtool \' `&
`(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: 19-gary-solaris-no-undefined-FINAL.patch,
Gary V. Vaughan <=