<div><div dir="auto">Hello,</div></div><div dir="auto"><br></div><div dir="auto">Just a few quick observations.<br></div><div dir="auto">- It looks like you may have downloaded the linux arm toolchain. For bare metal you probably wanted the Arm embedded toolchain, <a href="https://developer.arm.com/open-source/gnu-toolchain/gnu-rm">https://developer.arm.com/open-source/gnu-toolchain/gnu-rm</a></div><div dir="auto">-- That toolchain will have newlib rather than glibc, I don't know whether it will have one pre-compiled for v4 though. If not you may have to find an older toolchain or build newlib youtself.</div><div dir="auto">- The bare-metal driver in clang (arm-none-eabi) is not multilib aware and won't put the paths to the libraries on the link line, the -L flag</div><div dir="auto">-- I have found that following the samples in the gnu embedded toolchain with gcc using the -v flag to get the paths it is using, then use these with lld.</div><div dir="auto"><br></div><div dir="auto">If you can let us know what problems you are seeing building compiler-rt then we may be able to help. I'm not sure there is anyone building it for arm v4 so you may be hitting new problems. I'm away at a conference today and tomorrow but I can try later in the week.</div><div dir="auto"><br></div><div dir="auto">Peter</div><div><br><div class="gmail_quote"><div dir="ltr">On Tue, 4 Dec 2018 at 12:21, cscheuer via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am currently trying to compile a pretty simple program to work on an <br>
experimental board. It contains an (FPGA-version of) an ARMv4 processor.<br>
So basically, I try this (on my Ubuntu 18.04.1 LTS):<br>
clang -v --target=arm-none-eabi -c barehello.c -o barehelloCLANG.o<br>
clang -v --target=arm-none-eabi -c io.c -o io.o<br>
clang -v --target=arm-none-eabi barehelloCLANG.o io.o -o <br>
helloCLANGstatic -static -fuse-ld=lld<br>
<br>
Which results in<br>
<br>
clang version 8.0.0 (<a href="https://git.llvm.org/git/clang.git/" rel="noreferrer" target="_blank">https://git.llvm.org/git/clang.git/</a> <br>
a152c7a4b7ba8f4cb9532ead9a38a7121db43d50) <br>
(<a href="https://git.llvm.org/git/llvm.git/" rel="noreferrer" target="_blank">https://git.llvm.org/git/llvm.git/</a> <br>
1959ce6f3e01241919968ac1911fd45660239d23)<br>
Target: arm-none-unknown-eabi<br>
Thread model: posix<br>
InstalledDir: /usr/local/my_clang/bin<br>
  "/usr/local/my_clang/bin/ld.lld" barehelloCLANG.o io.o -Bstatic <br>
-L/usr/local/my_clang/lib/clang/8.0.0/lib/baremetal -lc -lm <br>
-lclang_rt.builtins-arm.a -o helloCLANGstatic<br>
ld.lld: error: unable to find library -lc<br>
ld.lld: error: unable to find library -lm<br>
ld.lld: error: unable to find library -lclang_rt.builtins-arm.a<br>
clang-8: error: ld.lld command failed with exit code 1 (use -v to see <br>
invocation)<br>
<br>
on the linking part. I downloaded a sysroot from <br>
<a href="https://developer.arm.com/open-source/gnu-toolchain/gnu-a/downloads/8-2-2018-08" rel="noreferrer" target="_blank">https://developer.arm.com/open-source/gnu-toolchain/gnu-a/downloads/8-2-2018-08</a> <br>
and tried to include it via --sysroot=/my/path/to/it, but clang acted <br>
unimpressed with the same errors. So I'm missing clang_rt.builtins-arm.a <br>
I guess, but that does not exist on my system.<br>
So next, I tried basically every version of "how to cross-compile <br>
llvm/clang/compiler-rt" That google came up with, but was not able to <br>
get a single one to actually work. Any ideas how to get this running?<br>
Thanks in advance!<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>