Open 7f1138a3-b229-4707-9203-bbc9684dbd73 opened 7 years ago
It seems it has been fixed with LLVM 9.0
I think you're right, this issue does not belong to LLD.
Does not seem LLD behavior is incorrect. I think it matches -l option description. I think clang should either generate "-l:libclang_rt.builtins-arm.a" or "-lclang_rt.builtins-arm", but not "-lclang_rt.builtins-arm.a".
(https://linux.die.net/man/1/ld): "Add the archive or object file specified by namespec to the list of files to link. This option may be used any number of times. If namespec is of the form :filename, ld will search the library path for a file called filename, otherwise it will search the library path for a file called libnamespec.a.
On systems which support shared libraries, ld may also search for files other than libnamespec.a. Specifically, on ELF and SunOS systems, ld will search a directory for a library called libnamespec.so before searching for one called libnamespec.a. (By convention, a ".so" extension indicates a shared library.) Note that this behavior does not apply to :filename, which always specifies a file called filename."
Oops, this one is likely to belong to lld, not cfe
(sorry, typo: s/arm-non-eabi/arm-none-eabi/)
(sorry, typo: s/arm-non-eabi/arm-none-abi/)
Extended Description
main.c: int main(void) {return 0;}
$ clang-5.0 -target arm-non-eabi main.c /usr/local/clang50/bin/ld.lld: error: unable to find library -lc /usr/local/clang50/bin/ld.lld: error: unable to find library -lm /usr/local/clang50/bin/ld.lld: error: unable to find library -lclang_rt.builtins-arm.a clang-5.0: error: ld.lld command failed with exit code 1 (use -v to see invocation)
Clang generates "-lclang_rt.builtins-arm.a" rather than "-lclang_rt.builtins-arm", which makes ld.lld to search for "libclang_rt.builtins-arm.a.a" rather than "libclang_rt.builtins-arm.a"
BTW, is there an option switch to disable standard libraries but keep linking with builtins?