bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtool 1.5.26: link fails on Darwin 5.5 because of wrong detection


From: Peter O'Gorman
Subject: Re: libtool 1.5.26: link fails on Darwin 5.5 because of wrong detection of -single_module flag support
Date: Wed, 26 Mar 2008 21:56:17 -0500
User-agent: Thunderbird 2.0.0.9 (X11/20071115)

Török Edwin wrote:
> Hi,
> 
> Nigel Horne reported that building shared libraries fails on  Darwin 5.5
> Power Macintosh with a libtool error.
> 
> It incorrectly detects that -single_module is supported (see below, the
> compiler gave an error, but configure says yes)


This should fix it (patch for libtool HEAD, not likely to apply on
1.5.x, should not be too difficult to patch it "by hand" if you really
want to).

Sorry it took so long. I still have not tested on Mac OS X 10.1, I would
have to remove 10.2 and find the install media for 10.1 etc etc and I am
apparently too lazy to do that :)

I believe that the problem was that ${wl} was not set at the time that
this macro was run, so instead of the linker seeing the flag
-single_module, gcc saw it, warned, and did not pass it along to the linker.

The patch hardcodes -Wl, and logs to config.log.

Ok?

Peter
-- 
Peter O'Gorman
http://pogma.com
2008-03-26  Peter O'Gorman  <address@hidden>

        * libltdl/m4/libtool.m4 [_LT_REQUIRED_DARWIN_CHECKS]: Fix the
        test for -single_module and log it to config.log.
        Reported by Torok Edwin and Nigel Home.

Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /sources/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.144
diff -u -r1.144 libtool.m4
--- libltdl/m4/libtool.m4       17 Mar 2008 22:39:05 -0000      1.144
+++ libltdl/m4/libtool.m4       27 Mar 2008 02:48:19 -0000
@@ -905,14 +905,20 @@
        # by either setting the environment variable LT_MULTI_MODULE
        # non-empty at configure time, or by adding -multi_module to the
        # link flags.
+       rm -rf libconftest.dylib*
        echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >& AS_MESSAGE_LOG_FD
        $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-         -dynamiclib ${wl}-single_module conftest.c
-       if test -f libconftest.dylib; then
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       if test -f libconftest.dylib && test ! -s conftest.err && test 
$_lt_result = 0; then
          lt_cv_apple_cc_single_mod=yes
-         rm -rf libconftest.dylib*
+       else
+         cat conftest.err >& AS_MESSAGE_LOG_FD
        fi
-       rm conftest.c
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
       fi])
     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
       [lt_cv_ld_exported_symbols_list],

reply via email to

[Prev in Thread] Current Thread [Next in Thread]