Open SzateX opened 1 year ago
@llvm/issue-subscribers-clang-driver
Try adding -fuse-ld=lld
to the clang command line for linking.
Try adding
-fuse-ld=lld
to the clang command line for linking.
Still the same problem. I have tried it also on Apline Docker Image, and it doesn't work also until I install gcc.
clang .\kernel.c -fuse-ld=lld -target i386-pc-none-elf -march=i386 -ffreestanding -nostdlib -v
clang version 15.0.6
Target: i386-pc-none-elf
Thread model: posix
InstalledDir: E:\LLVM\bin
"E:\\LLVM\\bin\\clang.exe" -cc1 -triple i386-pc-none-elf -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name kernel.c -mrelocation-model sta
tic -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -ffreestanding -target-cpu i386 -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v "-fcoverage-compilation-dir=E:\\Opt
imaX" -resource-dir "E:\\LLVM\\lib\\clang\\15.0.6" "-fdebug-compilation-dir=E:\\OptimaX" -ferror-limit 19 -fmessage-length=232 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -o "C:\\Users\\jaksz\\AppData\\Local\\Temp\\kernel-b25
365.o" -x c ".\\kernel.c"
clang -cc1 version 15.0.6 based upon LLVM 15.0.6 default target x86_64-pc-windows-msvc
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
E:\LLVM\lib\clang\15.0.6\include
End of search list.
"gcc" -fuse-ld=lld -nostdlib -m32 -o a.out "C:\\Users\\jaksz\\AppData\\Local\\Temp\\kernel-b25365.o"
clang: error: unable to execute command: program not executable
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
Hi! I got and issue while try to use clang on my home-brew OS development.
When I try to compile this empty file (It is a minimum thing to reproduce, because I'm trying to compose CMake file):
I got this result:
I have no idea why it try to search in Linux-like directories, and try to issue GCC.
I will be very glad for your quick response :)