The llvm-driver, enabled with LLVM_TOOL_LLVM_DRIVER_BUILD combines many llvm executables
into one to save overall toolchain size. This patch adds the capability for lld to be part of the
llvm-driver.
Details
- Reviewers
MaskRay beanz - Commits
- rG1fda6f6859aa: [llvm-driver] Add lld
Diff Detail
Unit Tests
Event Timeline
Please add -DLLVM_TOOL_LLVM_DRIVER_BUILD=on to the summary. [llvm-driver] isn't clear.
Note: by using this, we lose the property to make clang and lld separately profile-guided optimized.
Since you work at Google, can I request that you fix llvm-project-overlay/lld/BUILD.bazel similar to llvm-project-overlay/clang/BUILD.bazel clang_main?
Otherwise it would cause some integration trouble...
llvm/test/tools/llvm-driver/passthrough-lld.test | ||
---|---|---|
5 | may not be necessary to test -15 variants. |
I was considering holding off on this patch till after D127800 so that the diff would be simpler there. Or would you rather move ahead here first?
Done
Note: by using this, we lose the property to make clang and lld separately profile-guided optimized.
Yeah, that's a good observation I hadn't thought about. Likely the way clang and lld utilize libObject is very different for example. I can look into adding something along the lines of a LLVM_DRIVER_EXCLUDE_TOOLS list so it can chosen if some tools should be omitted.
Since you work at Google, can I request that you fix llvm-project-overlay/lld/BUILD.bazel similar to llvm-project-overlay/clang/BUILD.bazel clang_main?
Otherwise it would cause some integration trouble...
Done
It actually didn't complicate things at all...
lld/include/lld/Common/Driver.h | ||
---|---|---|
28 | Seem unnecessary? |
lld/include/lld/Common/Driver.h | ||
---|---|---|
28 | I don't understand why, but T** doesn't implicitly convert to const T **, and the only way I could find to add the const qualifier to the inner pointer was through const_cast so I can either keep this as const char ** and const_cast in from lld_main or keep this as char **. WDYT? |
lld/include/lld/Common/Driver.h | ||
---|---|---|
28 | This should be fine. const is the preferred one (I just want to decouple unrelated changes....) |
Seem unnecessary?