Skip to content

Instantly share code, notes, and snippets.

@heatd
Created July 23, 2022 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heatd/671702f95533817010f815560773b64d to your computer and use it in GitHub Desktop.
Save heatd/671702f95533817010f815560773b64d to your computer and use it in GitHub Desktop.
[pfalcato@PC-PEDRO-ARCH Onyx]$ clang -v -fuse-ld=lld -target=aarch64-elf main.c
clang-14: error: unknown argument '-target=aarch64-elf'; did you mean '--target=aarch64-elf'?
clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/12.1.0
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
[pfalcato@PC-PEDRO-ARCH Onyx]$ clang -v -fuse-ld=lld --target=aarch64-elf main.c
clang version 14.0.6
Target: aarch64-unknown-unknown-elf
Thread model: posix
InstalledDir: /usr/bin
"/usr/bin/clang-14" -cc1 -triple aarch64-unknown-unknown-elf -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -mrelocation-model static -mframe-pointer=non-leaf -fmath-errno -ffp-contract=on -fno-rounding-math -fno-verbose-asm -mconstructor-aliases -nostdsysteminc -target-cpu generic -target-feature +neon -target-feature +v8a -target-abi aapcs -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/pfalcato/Onyx -resource-dir /usr/lib/clang/14.0.6 -internal-isystem /usr/lib/clang/14.0.6/include -internal-isystem /usr/bin/../lib/clang-runtimes/aarch64-elf/include -fdebug-compilation-dir=/home/pfalcato/Onyx -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -o /tmp/main-02ac32.o -x c main.c
clang -cc1 version 14.0.6 based upon LLVM 14.0.6 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/bin/../lib/clang-runtimes/aarch64-elf/include"
ignoring duplicate directory "/usr/lib/clang/14.0.6/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/clang/14.0.6/include
End of search list.
"/usr/bin/ld.lld" /tmp/main-02ac32.o -Bstatic -L/usr/bin/../lib/clang-runtimes/aarch64-elf/lib -L/usr/lib/clang/14.0.6/lib/baremetal -lc -lm -lclang_rt.builtins-aarch64 -o a.out
ld.lld: error: unable to find library -lc
ld.lld: error: unable to find library -lm
ld.lld: error: unable to find library -lclang_rt.builtins-aarch64
clang-14: error: ld.lld command failed with exit code 1 (use -v to see invocation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment