Turn off Global ThinLTO for LP32 again
LP32 has many subtle issues and less test coverage.
Bug: 290859519
Bug: 169004486
Test: presubmit
Change-Id: I33fcf1a08b9e7a905ba81030250a9578532da5a0
diff --git a/cc/cc_test.go b/cc/cc_test.go
index fe54463..7534db2 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -4979,7 +4979,6 @@
conly := []string{"-fPIC", "${config.CommonGlobalConlyflags}"}
cppOnly := []string{"-fPIC", "${config.CommonGlobalCppflags}", "${config.DeviceGlobalCppflags}", "${config.ArmCppflags}"}
- ltoFlags := []string{"-flto=thin", "-fsplit-lto-unit"}
cflags := []string{"-Werror", "-std=candcpp"}
cstd := []string{"-std=gnu17", "-std=conly"}
@@ -5006,17 +5005,17 @@
{
name: "c",
src: "foo.c",
- expected: combineSlices(baseExpectedFlags, conly, expectedIncludes, cflags, ltoFlags, cstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}),
+ expected: combineSlices(baseExpectedFlags, conly, expectedIncludes, cflags, cstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}),
},
{
name: "cc",
src: "foo.cc",
- expected: combineSlices(baseExpectedFlags, cppOnly, expectedIncludes, cflags, ltoFlags, cppstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}),
+ expected: combineSlices(baseExpectedFlags, cppOnly, expectedIncludes, cflags, cppstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}),
},
{
name: "assemble",
src: "foo.s",
- expected: combineSlices(baseExpectedFlags, []string{"${config.CommonGlobalAsflags}"}, expectedIncludes, ltoFlags, lastIncludes),
+ expected: combineSlices(baseExpectedFlags, []string{"${config.CommonGlobalAsflags}"}, expectedIncludes, lastIncludes),
},
}
diff --git a/cc/lto.go b/cc/lto.go
index e334af9..44361db 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -74,6 +74,9 @@
} else if ctx.Host() {
// Performance and binary size are less important for host binaries.
ltoDefault = false
+ } else if ctx.Arch().ArchType.Multilib == "lib32" {
+ // LP32 has many subtle issues and less test coverage.
+ ltoDefault = false
}
// Then, determine the actual LTO mode to use. If different from `ltoDefault`, a variant needs