|
From: | Peter O'Gorman |
Subject: | Re: flat, no all-load for darwin |
Date: | Wed, 28 Jul 2004 11:54:14 +0900 |
User-agent: | Mozilla Thunderbird 0.6 (Macintosh/20040502) |
Geoffrey Keating wrote:
Libtool was using -all_load to get all the members of a convenience archive. Unfortunately, -all_load applies to *every* library in the link, so this would cause it to pull in everything from, say, libstdc++, causing huge binary bloat and occasionally link errors when a library is listed twice on the link line. Also, libtool is changed to use -flat_namespace for C++. This is usually what you want, especially for libstdc++ itself. I've tested a version of this patch that applied to an earlier libtool (1.5.2, I think) by building all of GCC with it, and running its testsuite. I'm pretty sure I don't have write access, so could someone commit this for me?
Two problems with your patch:1) -all_load does indeed cause bloat, but there is a reason I have not removed it thus far. If you are building fat, then -all_load will happily work with the fat archive, if not then the ar x stuff to get the archive members will fail. Removing -all_load will cause fat convenience libraries to stop working iirc. However now that I have a working fat unarchive func in cvs HEAD I plan to backport it to branch-1-5 in the near future and then remove the -all_load stuff (and maybe make a 1.5.8 release).
2) If I apply the -flat_namespace thing Ben Reed will be very angry with me as he'll no longer be able to build KDE. While you can add Wl,-flat_namespace to your LDFLAGS currently, and glibtool will pass it through and honour it, if you have specified -flat_namespace in the allow_undefined_flag, but you really want twolevel_namespace, it is impossible to add it to the flags:
ld: can't specify both -twolevel_namespace and -flatname_space (note the flag name in the linker error, please file a bug at Apple for me :).If you can explain why you need the flat_namespace stuff in the allow_undefined_flag maybe we can figure something out. I'll have to ask Ben about KDE.
Sorry, Peter -- Peter O'Gorman - http://www.pogma.com
[Prev in Thread] | Current Thread | [Next in Thread] |