aboutsummaryrefslogtreecommitdiffstats
path: root/cc/util.go
diff options
context:
space:
mode:
authorZhizhou Yang <zhizhouy@google.com>2018-02-08 18:32:11 -0800
committerYi Kong <yikong@google.com>2018-02-14 21:21:14 +0800
commit51be632b95c0693641b7fdf8ec08e797ce804198 (patch)
tree396ff830ca3541e144f2368776c9500f0379f02b /cc/util.go
parent3bb5f2f2fa11092f25517200cd94f0c81c2e868e (diff)
downloadbuild_soong-51be632b95c0693641b7fdf8ec08e797ce804198.tar.gz
build_soong-51be632b95c0693641b7fdf8ec08e797ce804198.tar.bz2
build_soong-51be632b95c0693641b7fdf8ec08e797ce804198.zip
Fix llvm-ar error caused by using lto and sanitizer together
LLVM-AR does not allow passing --plugin options more than once. The --plugin ARFLAGS that lto want to add, may already exist if sanitizer is also turned on. Fixed this by adding a new bool Flags.ArGoldPlugin. Set this variable to true whenever LLVM gold plugin is needed for ArFlags. In function TransformObjToStaticLib(), add this option to arFlags using global value ${config.LLVMGoldPlugin} if the bool value is true. Bug: http://b/73160350 Test: build the image with make and succeeded. Change-Id: I62785829b0a4b663225926e4aed98defc1b6da2c (cherry picked from commit 4917049f6efe2d08e67eb26ec77e21dcce5172c5)
Diffstat (limited to 'cc/util.go')
-rw-r--r--cc/util.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/cc/util.go b/cc/util.go
index 5131b09a..92a32bc9 100644
--- a/cc/util.go
+++ b/cc/util.go
@@ -84,6 +84,7 @@ func flagsToBuilderFlags(in Flags) builderFlags {
systemIncludeFlags: strings.Join(in.SystemIncludeFlags, " "),
groupStaticLibs: in.GroupStaticLibs,
+ arGoldPlugin: in.ArGoldPlugin,
}
}