Problems cross-compiling with clang 3.7 & 3.9 on 10.6

Mojca Miklavec mojca at macports.org
Tue Mar 28 00:46:49 UTC 2017


On 27 March 2017 at 22:26, Jeremy Huddleston Sequoia wrote:
>> On Mar 27, 2017, at 08:14, Mojca Miklavec wrote:
>>
>> Hi,
>>
>> After a long time I tried cross-compiling a few things on 10.6, but
>> most attempts failed:
>>
>>> clang-mp-3.4 -arch ppc test.c -o test
>>
>> [OK]
>
> IIRC, cfe just spawns llvm-gcc-4.2 when using -arch ppc in older versions.  I suspect 3.4 does that which is why it "works"

Thanks. (It nevertheless breaks at some other point, so it's still useless.)

I knew that ppc has never been supported properly, but there was this
crazy "clang on ppc tiger" project that just kept going and each
version of clang worked slightly better. I just checked and it seems
that the author apparently started working for Google in 2015 and
there were no commits to llvm/clang forks since 2014. I didn't realize
that the project actually "died" in the meantime.

>>> clang-mp-3.9 test.c -o test
>> ld: library not found for -lto_library
>> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>>
>> Any hints about how to fix these issues?
>
> What's the output of with '-v -Wl,-v'?

> clang-mp-3.9 -v -Wl,-v test.c -o test
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-3.9/bin
 "/opt/local/libexec/llvm-3.9/bin/clang" -cc1 -triple
x86_64-apple-macosx10.6.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name test.c
-mrelocation-model pic -pic-level 2 -mthread-model posix
-mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 136 -v -dwarf-column-info -debugger-tuning=lldb
-resource-dir /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1
-fdebug-compilation-dir /Users/context-osx/app/texlive/svn/Build
-ferror-limit 19 -fmessage-length 175 -stack-protector 1 -fblocks
-fobjc-runtime=macosx-10.6.0 -fencode-extended-block-signature
-fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/Qr/QrzZQ3sbHSybp2W5GAvzYU+++TI/-Tmp-/test-afae7b.o -x c
test.c
clang -cc1 version 3.9.1 based upon LLVM 3.9.1 default target
x86_64-apple-darwin10.8.0
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/opt/local/libexec/llvm-3.9/bin/ld" -demangle -lto_library
/opt/local/libexec/llvm-3.9/lib/libLTO.dylib -dynamic -arch x86_64
-macosx_version_min 10.6.0 -o test -lcrt1.10.6.o -v
/var/folders/Qr/QrzZQ3sbHSybp2W5GAvzYU+++TI/-Tmp-/test-afae7b.o
-lSystem /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld  PROJECT:ld64-127.2
configured to support archs: i386 x86_64 ppc ppc64 armv6 armv7
Library search paths:
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
ld: library not found for -lto_library
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Mojca


More information about the macports-dev mailing list