[MacPorts] #19679: llvm 2.5 port fails to support Link Time Optimization
MacPorts
noreply at macports.org
Fri Nov 27 00:38:48 PST 2009
#19679: llvm 2.5 port fails to support Link Time Optimization
-------------------------------+--------------------------------------------
Reporter: macports@… | Owner: erickt@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 1.7.1
Keywords: llvm lto | Port: llvm llvm-gcc42
-------------------------------+--------------------------------------------
Comment(by macports@…):
Yes, this is still an issue. The easiest way to test this is to compile
something in llvm-gcc42 with "-O4". If libLTO.dylib is not accessible, the
linker will complain that the object files (which are really bitcode files
in this case) are not of the required architecture. I see several ways to
fix this:
A) Install a symlink to /opt/local/lib/libLTO.dylib in /usr/lib/
B) Configure compilers with "--with-ld=/Developer/usr/bin/ld"
C) Install a symlink to /Developer/usr/bin/ld in
/opt/local/libexec/gcc/i686-apple-darwin${os.major}/4.2.1/
D) Provide a custom [http://opensource.apple.com/source/ld64/ ld64] in
macports and make it available in /opt/local/libexec/gcc/i686-apple-
darwin${os.major}/4.2.1/
No option is really perfect. I'd say that D) would be the cleanest
solution, but sadly that is not an option right now because the public
ld64 sources seem to be [http://lists.apple.com/archives/Darwin-
dev/2009/Sep/msg00025.html incomplete and unusable]. I'm happily living
with option A) for several months now under 10.5, but I understand that
installing files outside the macports hierarchy is not welcome. Options B)
and C) rely on the llvm libraries that come bundled with XCode >=3.1. But
it strikes me that you end up using mismatched versions of llvm and
libLTO.dylib this way. And option B), which is
[http://pdb.finkproject.org/pdb/package.php/llvm-gcc42 what fink does] in
their llvm-gcc42 package, doesnt seem to work for clang.
I have attached diffs for option A) and option C) and verified that both
approaches enable llvm-gcc and clang to compile with "-O4" when installed
in the /opt/local hierarchy.
--
Ticket URL: <http://trac.macports.org/ticket/19679#comment:3>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list