Move -fvisibility-inlines-hidden to global device cppflags
It was previously set on arm[64] and mips[64], this will cause it
to be set for x86[_64] too.
Bug: 68855788
Test: m checkbuild
Change-Id: I75af16e7d259963ad633cc664929144332bb435d
diff --git a/cc/compiler.go b/cc/compiler.go
index 268a663..4112930 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -318,6 +318,7 @@
flags.GlobalFlags = append(flags.GlobalFlags, instructionSetFlags)
flags.ConlyFlags = append([]string{"${config.CommonGlobalConlyflags}"}, flags.ConlyFlags...)
+ flags.CppFlags = append([]string{fmt.Sprintf("${config.%sGlobalCppflags}", hod)}, flags.CppFlags...)
if flags.Clang {
flags.AsFlags = append(flags.AsFlags, tc.ClangAsflags())
diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go
index 13e9a08..c206675 100644
--- a/cc/config/arm64_device.go
+++ b/cc/config/arm64_device.go
@@ -45,9 +45,7 @@
"-Wl,--icf=safe",
}
- arm64Cppflags = []string{
- "-fvisibility-inlines-hidden",
- }
+ arm64Cppflags = []string{}
arm64CpuVariantCflags = map[string][]string{
"cortex-a53": []string{
diff --git a/cc/config/arm_device.go b/cc/config/arm_device.go
index 6703969..5c050fa 100644
--- a/cc/config/arm_device.go
+++ b/cc/config/arm_device.go
@@ -42,9 +42,7 @@
"-fomit-frame-pointer",
}
- armCppflags = []string{
- "-fvisibility-inlines-hidden",
- }
+ armCppflags = []string{}
armLdflags = []string{
"-Wl,--icf=safe",
diff --git a/cc/config/global.go b/cc/config/global.go
index de4fa11..92cd98b 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -71,6 +71,10 @@
"-Werror=format-security",
}
+ deviceGlobalCppflags = []string{
+ "-fvisibility-inlines-hidden",
+ }
+
deviceGlobalLdflags = []string{
"-Wl,-z,noexecstack",
"-Wl,-z,relro",
@@ -83,6 +87,8 @@
hostGlobalCflags = []string{}
+ hostGlobalCppflags = []string{}
+
hostGlobalLdflags = []string{}
commonGlobalCppflags = []string{
@@ -122,8 +128,10 @@
pctx.StaticVariable("CommonGlobalCflags", strings.Join(commonGlobalCflags, " "))
pctx.StaticVariable("CommonGlobalConlyflags", strings.Join(commonGlobalConlyflags, " "))
pctx.StaticVariable("DeviceGlobalCflags", strings.Join(deviceGlobalCflags, " "))
+ pctx.StaticVariable("DeviceGlobalCppflags", strings.Join(deviceGlobalCppflags, " "))
pctx.StaticVariable("DeviceGlobalLdflags", strings.Join(deviceGlobalLdflags, " "))
pctx.StaticVariable("HostGlobalCflags", strings.Join(hostGlobalCflags, " "))
+ pctx.StaticVariable("HostGlobalCppflags", strings.Join(hostGlobalCppflags, " "))
pctx.StaticVariable("HostGlobalLdflags", strings.Join(hostGlobalLdflags, " "))
pctx.StaticVariable("NoOverrideGlobalCflags", strings.Join(noOverrideGlobalCflags, " "))
diff --git a/cc/config/mips64_device.go b/cc/config/mips64_device.go
index 487b11a..9b5d4d9 100644
--- a/cc/config/mips64_device.go
+++ b/cc/config/mips64_device.go
@@ -40,9 +40,7 @@
"-fintegrated-as",
}...)
- mips64Cppflags = []string{
- "-fvisibility-inlines-hidden",
- }
+ mips64Cppflags = []string{}
mips64Ldflags = []string{
"-Wl,--allow-shlib-undefined",
diff --git a/cc/config/mips_device.go b/cc/config/mips_device.go
index f178b97..a8c48b4 100644
--- a/cc/config/mips_device.go
+++ b/cc/config/mips_device.go
@@ -38,9 +38,7 @@
"-fintegrated-as",
}...)
- mipsCppflags = []string{
- "-fvisibility-inlines-hidden",
- }
+ mipsCppflags = []string{}
mipsLdflags = []string{
"-Wl,--allow-shlib-undefined",
diff --git a/cc/makevars.go b/cc/makevars.go
index f84ae24..7befb11 100644
--- a/cc/makevars.go
+++ b/cc/makevars.go
@@ -171,6 +171,7 @@
}, " "))
ctx.Strict(makePrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
"${config.CommonGlobalCppflags}",
+ fmt.Sprintf("${config.%sGlobalCppflags}", hod),
toolchain.Cppflags(),
}, " "))
ctx.Strict(makePrefix+"GLOBAL_LDFLAGS", strings.Join([]string{
@@ -217,6 +218,7 @@
}, " "))
ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
"${config.CommonClangGlobalCppflags}",
+ fmt.Sprintf("${config.%sGlobalCppflags}", hod),
toolchain.ClangCppflags(),
}, " "))
ctx.Strict(clangPrefix+"GLOBAL_LDFLAGS", strings.Join([]string{