[MacPorts] #33207: clang LTO doesn't work with older ld64

MacPorts noreply at macports.org
Sat Mar 24 11:22:38 PDT 2012


#33207: clang LTO doesn't work with older ld64
--------------------------------+-------------------------------------------
 Reporter:  mmoll@…             |       Owner:  jeremyhu@…           
     Type:  defect              |      Status:  assigned             
 Priority:  Normal              |   Milestone:                       
Component:  ports               |     Version:  2.0.3                
 Keywords:  llvm clang LTO      |        Port:  clang-3.1            
--------------------------------+-------------------------------------------

Comment(by jeremyhu@…):

 I can reproduce it by forcing an old libLTO into /usr/lib:

 {{{
 sudo mv /usr/lib/libLTO.dylib /usr/lib/libLTO.dylib.bak
 sudo cp /opt/local/libexec/llvm-2.9/lib/libLTO.dylib /usr/lib

 clang++-mp-3.1 -O4 test.cpp -c
 /usr/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.7.0 -o test
 -lcrt1.10.6.o test.o -lstdc++ -lSystem
 /opt/local/libexec/llvm-3.1/bin/../lib/clang/3.1/lib/darwin/libclang_rt.osx.a
 }}}

 And I can work around it in either of these ways:
 {{{
 DYLD_LIBRARY_PATH=/opt/local/libexec/llvm-3.1/lib /usr/bin/ld -dynamic
 -arch x86_64 -macosx_version_min 10.7.0 -o test -lcrt1.10.6.o test.o
 -lstdc++ -lSystem
 /opt/local/libexec/llvm-3.1/bin/../lib/clang/3.1/lib/darwin/libclang_rt.osx.a
 }}}

 {{{
 cd /opt/local/libexec/llvm-3.0/bin
 sudo ln -s /usr/bin/ld
 ...
 /opt/local/libexec/llvm-3.1/bin/ld -dynamic -arch x86_64
 -macosx_version_min 10.7.0 -o test -lcrt1.10.6.o test.o -lstdc++ -lSystem
 /opt/local/libexec/llvm-3.1/bin/../lib/clang/3.1/lib/darwin/libclang_rt.osx.a
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/33207#comment:5>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list