[MacPorts] #33207: clang-3.1 LTO broken
MacPorts
noreply at macports.org
Fri Feb 10 05:38:12 PST 2012
#33207: clang-3.1 LTO broken
--------------------------------+-------------------------------------------
Reporter: mmoll@… | Owner: jeremyhu@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.0.3
Keywords: llvm clang LTO | Port: clang-3.1
--------------------------------+-------------------------------------------
Take the following minimal program called, say, test.cpp:
{{{
int main(int,char**) { return 0; }
}}}
and compile it with -O4. This is what I see:
{{{
clang++-mp-3.1 -O4 test.cpp -o test -v
clang version 3.1 (trunk 149973)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
"/opt/local/libexec/llvm-3.1/bin/clang" -cc1 -triple x86_64-apple-
macosx10.7.0 -emit-llvm-bc -disable-free -main-file-name test.cpp -pic-
level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 127.2 -v -resource-dir
/opt/local/libexec/llvm-3.1/bin/../lib/clang/3.1 -fmodule-cache-path
/var/folders/5x/k48hkr0n2mx5qz3_0xw516800000gn/T/clang-module-cache -I
/opt/local/include -O3 -fdeprecated-macro -fdebug-compilation-dir
/Users/mmoll/omplapp/build/Release -ferror-limit 19 -fmessage-length 97
-stack-protector 1 -mstackrealign -fblocks -fobjc-runtime-has-arc -fobjc-
runtime-has-weak -fobjc-dispatch-method=mixed -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/5x/k48hkr0n2mx5qz3_0xw516800000gn/T/test-HHZUrL.o -x c++
test.cpp
clang -cc1 version 3.1 based upon LLVM 3.1svn default target x86_64-apple-
darwin11.3.0
ignoring nonexistent directory "/usr/include/c++/4.2.1/i686-apple-
darwin10/x86_64"
ignoring nonexistent directory "/usr/include/c++/4.0.0"
ignoring nonexistent directory "/usr/include/c++/4.0.0/i686-apple-
darwin8/"
ignoring nonexistent directory "/usr/include/c++/4.0.0/backward"
#include "..." search starts here:
#include <...> search starts here:
/opt/local/include
/usr/include/c++/4.2.1
/usr/include/c++/4.2.1/backward
/usr/local/include
/opt/local/libexec/llvm-3.1/bin/../lib/clang/3.1/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
"/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld" -demangle
-object_path_lto /var/folders/5x/k48hkr0n2mx5qz3_0xw516800000gn/T/cc-
bK5Nhp.o -dynamic -arch x86_64 -macosx_version_min 10.7.0 -o test
-lcrt1.10.6.o /var/folders/5x/k48hkr0n2mx5qz3_0xw516800000gn/T/test-
HHZUrL.o -lstdc++ -lSystem
ld: in /var/folders/5x/k48hkr0n2mx5qz3_0xw516800000gn/T/test-HHZUrL.o,
could not parse object file
/var/folders/5x/k48hkr0n2mx5qz3_0xw516800000gn/T/test-HHZUrL.o: Invalid
MODULE_CODE_FUNCTION record for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
}}}
If I explicitly use the LLVM linker I get an executable that can't be run:
{{{
> clang++-mp-3.1 -O4 test.cpp -o test.o -c
> llvm-ld-mp-3.1 -o test test.o -lstdc++ -lSystem
> ./test
./test: line 3: exec: lli: not found
}}}
--
Ticket URL: <https://trac.macports.org/ticket/33207>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list