Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc 4.2 on 10.4 tiger: ld: unknown flag: -compatibility_version



YJZ wrote:
> I find four separate copies of "libtool" in ~/gtk/ where the "jhbuild" process builds "gettext 0.16". Please find their "--config" output below. I also find other libtools throughout my box, but only the top two listed below accepts the "--config", whose output I can provide if necessary. Since Apple's gcc 4.2.1 builds gettext 0.17 fine, could the issue be attributed to gettext 0.16 using the bug-infected libtool? 
> 
> A side question I have now is: How come there's no /path/to/4.2.1/libtool?
> 
> ./opt/gtk/bin/libtool
> ./usr/local/apr/build/libtool

These two are GNU libtool.

> ./Developer/usr/bin/libtool
> ./Developer/usr/libexec/gcc/i686-apple-darwin8/4.0.1/libtool
> ./Developer/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/libtool

These are Apple's libtool.

> ./opt/gtk/share/libtool
GNU
> ./usr/bin/libtool
> ./usr/libexec/gcc/i686-apple-darwin8/4.0.1/libtool
> ./usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/libtool
Apple
> ./usr/share/libtool
GNU (but it is a directory).

See man glibtool and libtool on Mac OS X for some more information

Some time ago I added support for IBM's xlc to GNU libtool (I have since
removed it). At that time, both xlc and gcc used /usr/bin/libtool to
create shared libraries, but xlc did not grok -compatibility_version
etc, so I quoted it with -Wl, and all was well.

Recently Apple changed to not use /usr/bin/libtool to create shared
libraries (a good thing), that change broke building gcc but nothing
else, I think because gcc continued to use collect2 to link shared
libraries and that did understand -compatibility_version etc.

Now, I can only assume, gcc calls ld directly, so all such older
versions of libtool will fail.

Easiest solutions are to update the libtool version in the package that
you are attempting to build (autoreconf -fi) or simple sed out ${wl}
before the -compatibility_version etc in ltmain.sh

This is what I committed when the gcc build problem was reported:

http://git.savannah.gnu.org/gitweb/?p=libtool.git;a=commitdiff;h=eee885d7c58eea2b9fef52798ef2a1e7adb9be4f

Using sed to remove the '${wl}' from verstring in ltmain.sh before
configure should work fine:
sed -e '/verstring=/s/\${wl}//g' < ltmain.sh > ltmain.fixed; mv
ltmain.fixed ltmain.sh
(untested)

Peter
-- 
Peter O'Gorman
http://pogma.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >gcc 4.2 on 10.4 tiger: ld: unknown flag: -compatibility_version (From: "YJZ" <email@hidden>)
 >Re: gcc 4.2 on 10.4 tiger: ld: unknown flag: -compatibility_version (From: Terry Lambert <email@hidden>)
 >Re: gcc 4.2 on 10.4 tiger: ld: unknown flag: -compatibility_version (From: Boyd Waters <email@hidden>)
 >Re: gcc 4.2 on 10.4 tiger: ld: unknown flag: -compatibility_version (From: "YJZ" <email@hidden>)
 >Re: gcc 4.2 on 10.4 tiger: ld: unknown flag: -compatibility_version (From: Peter O'Gorman <email@hidden>)
 >Re: gcc 4.2 on 10.4 tiger: ld: unknown flag: -compatibility_version (From: "YJZ" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.