llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
25.94k stars 10.58k forks source link

[Driver] clang --ld-path doesn't recognize 'llvm ld.lld' #90433

Open Andarwinux opened 2 weeks ago

Andarwinux commented 2 weeks ago

If LLVM_TOOL_LLVM_DRIVER_BUILD is enabled, it is possible to call lld by means of llvm ld.lld, but clang's --ld-path does not support this.

Normally direct call ld.lld symbolic link would suffice, but for instrumentation BOLT training, this can cause problems, as BOLT training cannot be done simply by:

./llvm-bolt -instrument ./llvm -o ./llvm.instr --instrumentation-file=./llvm.fdata
LLD_IN_TEST=1 ./llvm.instr clang -O3 -flto=thin -fuse-ld=lld --ld-path='llvm.instr ld.lld' ./test.c
llvmbot commented 2 weeks ago

@llvm/issue-subscribers-clang-driver

Author: None (Andarwinux)

If `LLVM_TOOL_LLVM_DRIVER_BUILD` is enabled, it is possible to call lld by means of `llvm ld.lld`, but clang's `--ld-path` does not support this. Normally direct call ld.lld symbolic link would suffice, but for instrumentation BOLT training, this can cause problems, as BOLT training cannot be done simply by: ``` ./llvm-bolt -instrument ./llvm -o ./llvm.instr --instrumentation-file=./llvm.fdata LLD_IN_TEST=1 ./llvm.instr clang -O3 -flto=thin -fuse-ld=lld --ld-path='llvm.instr ld.lld' ./test.c ```
MaskRay commented 2 weeks ago

--ld-path= accepts a literal path name and does not intend to parse path/to/llvm lld. In this case I think a symlink is needed, possibly done by the build system.