Merge "Enable safe ICF with LLD."
diff --git a/cc/config/clang.go b/cc/config/clang.go
index 5c82604..bbc78fa 100644
--- a/cc/config/clang.go
+++ b/cc/config/clang.go
@@ -86,7 +86,6 @@
// Ldflags that should be filtered out when linking with clang lld
var ClangUnknownLldflags = sorted([]string{
"-fuse-ld=gold",
- "-Wl,--icf=safe",
"-Wl,--fix-cortex-a8",
"-Wl,--no-fix-cortex-a8",
"-Wl,-m,aarch64_elf64_le_vec",
diff --git a/cc/object.go b/cc/object.go
index 0010621..552f639 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -39,6 +39,10 @@
baseLinker: NewBaseLinker(nil),
}
module.compiler = NewBaseCompiler()
+
+ // Clang's address-significance tables are incompatible with ld -r.
+ module.compiler.appendCflags([]string{"-fno-addrsig"})
+
module.stl = &stl{}
return module.Init()
}