[llvm] f37e6fa - [gn build] Use llvm-ar when clang_base_path is specified
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed May 11 10:41:22 PDT 2022
Author: Arthur Eubanks
Date: 2022-05-11T10:40:54-07:00
New Revision: f37e6faf523d237a04b91fa3d736659a6ef8a9c6
URL: https://github.com/llvm/llvm-project/commit/f37e6faf523d237a04b91fa3d736659a6ef8a9c6
DIFF: https://github.com/llvm/llvm-project/commit/f37e6faf523d237a04b91fa3d736659a6ef8a9c6.diff
LOG: [gn build] Use llvm-ar when clang_base_path is specified
Only applies linux for now.
This prevents warnings with use_thinlto like
bfd plugin: LLVM gold plugin has failed to create LTO module: Not an int attribute (Producer: 'LLVM15.0.0git' Reader: 'LLVM 13.0.1')
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D125399
Added:
Modified:
llvm/utils/gn/build/toolchain/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn
index 69a68b92a75fe..29da00c29fcad 100644
--- a/llvm/utils/gn/build/toolchain/BUILD.gn
+++ b/llvm/utils/gn/build/toolchain/BUILD.gn
@@ -174,7 +174,11 @@ template("unix_toolchain") {
unix_toolchain("unix") {
if (current_os != "ios" && current_os != "mac") {
- ar = "ar"
+ if (clang_base_path != "") {
+ ar = rebase_path(clang_base_path, root_build_dir) + "/bin/llvm-ar"
+ } else {
+ ar = "ar"
+ }
}
toolchain_args = {
More information about the llvm-commits
mailing list