aboutsummaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-05-06 17:28:56 +0000
committerColin Cross <ccross@android.com>2019-05-06 17:29:49 +0000
commit619cd098b6008d81876f310e2d83ebf141c4061e (patch)
treedb063ba5ae63200c1a5a9f452553a1fb7122fd85 /cc
parentbd475367c3dcb4478a70409c99b959ebdb117be3 (diff)
downloadbuild_soong-619cd098b6008d81876f310e2d83ebf141c4061e.tar.gz
build_soong-619cd098b6008d81876f310e2d83ebf141c4061e.tar.bz2
build_soong-619cd098b6008d81876f310e2d83ebf141c4061e.zip
Revert "Strip libgcc to only keep fallback symbols"
This reverts commit bd475367c3dcb4478a70409c99b959ebdb117be3. Reason for revert: b/130267141 Bug: 29275768 Bug: 130267141 Merged-In: I5b349fa6138e51663bf3b67109b880b4356da8e8 Change-Id: Ieab56390b27240ef7f2f52a48a673809da7bcf8e
Diffstat (limited to 'cc')
-rw-r--r--cc/builder.go4
-rw-r--r--cc/cc_test.go4
-rw-r--r--cc/linker.go8
-rw-r--r--cc/strip.go17
-rw-r--r--cc/testing.go7
-rw-r--r--cc/toolchain_library.go16
6 files changed, 12 insertions, 44 deletions
diff --git a/cc/builder.go b/cc/builder.go
index c42f56cc..c64243f6 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -255,7 +255,6 @@ type builderFlags struct {
groupStaticLibs bool
stripKeepSymbols bool
- stripKeepSymbolsList string
stripKeepMiniDebugInfo bool
stripAddGnuDebuglink bool
stripUseGnuStrip bool
@@ -824,9 +823,6 @@ func TransformStrip(ctx android.ModuleContext, inputFile android.Path,
if flags.stripKeepSymbols {
args += " --keep-symbols"
}
- if flags.stripKeepSymbolsList != "" {
- args += " -k" + flags.stripKeepSymbolsList
- }
if flags.stripUseGnuStrip {
args += " --use-gnu-strip"
}
diff --git a/cc/cc_test.go b/cc/cc_test.go
index f3d5e60d..05d74b99 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -1833,13 +1833,13 @@ func TestStaticLibDepExport(t *testing.T) {
// Check the shared version of lib2.
variant := "android_arm64_armv8-a_core_shared"
module := ctx.ModuleForTests("lib2", variant).Module().(*Module)
- checkStaticLibs(t, []string{"lib1", "libclang_rt.builtins-aarch64-android", "libatomic", "libgcc_stripped"}, module)
+ checkStaticLibs(t, []string{"lib1", "libclang_rt.builtins-aarch64-android", "libatomic", "libgcc"}, module)
// Check the static version of lib2.
variant = "android_arm64_armv8-a_core_static"
module = ctx.ModuleForTests("lib2", variant).Module().(*Module)
// libc++_static is linked additionally.
- checkStaticLibs(t, []string{"lib1", "libc++_static", "libclang_rt.builtins-aarch64-android", "libatomic", "libgcc_stripped"}, module)
+ checkStaticLibs(t, []string{"lib1", "libc++_static", "libclang_rt.builtins-aarch64-android", "libatomic", "libgcc"}, module)
}
var compilerFlagsTestCases = []struct {
diff --git a/cc/linker.go b/cc/linker.go
index e063e441..b279c065 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -228,10 +228,10 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
// libclang_rt.builtins, libgcc and libatomic have to be last on the command line
if !Bool(linker.Properties.No_libcrt) {
deps.LateStaticLibs = append(deps.LateStaticLibs, config.BuiltinsRuntimeLibrary(ctx.toolchain()))
- deps.LateStaticLibs = append(deps.LateStaticLibs, "libatomic")
- deps.LateStaticLibs = append(deps.LateStaticLibs, "libgcc_stripped")
- } else if !Bool(linker.Properties.No_libgcc) {
- deps.LateStaticLibs = append(deps.LateStaticLibs, "libatomic")
+ }
+
+ deps.LateStaticLibs = append(deps.LateStaticLibs, "libatomic")
+ if !Bool(linker.Properties.No_libgcc) {
deps.LateStaticLibs = append(deps.LateStaticLibs, "libgcc")
}
diff --git a/cc/strip.go b/cc/strip.go
index 7122585e..02397f4e 100644
--- a/cc/strip.go
+++ b/cc/strip.go
@@ -15,19 +15,15 @@
package cc
import (
- "strings"
-
"android/soong/android"
)
type StripProperties struct {
Strip struct {
- None *bool `android:"arch_variant"`
- All *bool `android:"arch_variant"`
- Keep_symbols *bool `android:"arch_variant"`
- Keep_symbols_list []string `android:"arch_variant"`
- Use_gnu_strip *bool `android:"arch_variant"`
- } `android:"arch_variant"`
+ None *bool
+ All *bool
+ Keep_symbols *bool
+ }
}
type stripper struct {
@@ -46,14 +42,9 @@ func (stripper *stripper) strip(ctx ModuleContext, in android.Path, out android.
} else {
if Bool(stripper.StripProperties.Strip.Keep_symbols) {
flags.stripKeepSymbols = true
- } else if len(stripper.StripProperties.Strip.Keep_symbols_list) > 0 {
- flags.stripKeepSymbolsList = strings.Join(stripper.StripProperties.Strip.Keep_symbols_list, ",")
} else if !Bool(stripper.StripProperties.Strip.All) {
flags.stripKeepMiniDebugInfo = true
}
- if Bool(stripper.StripProperties.Strip.Use_gnu_strip) {
- flags.stripUseGnuStrip = true
- }
if ctx.Config().Debuggable() && !flags.stripKeepMiniDebugInfo {
flags.stripAddGnuDebuglink = true
}
diff --git a/cc/testing.go b/cc/testing.go
index 8d76c2f5..2f41de1a 100644
--- a/cc/testing.go
+++ b/cc/testing.go
@@ -69,13 +69,6 @@ func GatherRequiredDepsForTest(os android.OsType) string {
src: "",
}
- toolchain_library {
- name: "libgcc_stripped",
- vendor_available: true,
- recovery_available: true,
- src: "",
- }
-
cc_library {
name: "libc",
no_libgcc: true,
diff --git a/cc/toolchain_library.go b/cc/toolchain_library.go
index 8ab8bc94..ae08b1c7 100644
--- a/cc/toolchain_library.go
+++ b/cc/toolchain_library.go
@@ -34,8 +34,6 @@ type toolchainLibraryProperties struct {
type toolchainLibraryDecorator struct {
*libraryDecorator
- stripper
-
Properties toolchainLibraryProperties
}
@@ -47,7 +45,7 @@ func (*toolchainLibraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
func (library *toolchainLibraryDecorator) linkerProps() []interface{} {
var props []interface{}
props = append(props, library.libraryDecorator.linkerProps()...)
- return append(props, &library.Properties, &library.stripper.StripProperties)
+ return append(props, &library.Properties)
}
func ToolchainLibraryFactory() android.Module {
@@ -77,17 +75,7 @@ func (library *toolchainLibraryDecorator) link(ctx ModuleContext,
return android.PathForSource(ctx, "")
}
- srcPath := android.PathForSource(ctx, *library.Properties.Src)
-
- if library.stripper.StripProperties.Strip.Keep_symbols_list != nil {
- fileName := ctx.ModuleName() + staticLibraryExtension
- outputFile := android.PathForModuleOut(ctx, fileName)
- buildFlags := flagsToBuilderFlags(flags)
- library.stripper.strip(ctx, srcPath, outputFile, buildFlags)
- return outputFile
- }
-
- return srcPath
+ return android.PathForSource(ctx, *library.Properties.Src)
}
func (library *toolchainLibraryDecorator) nativeCoverage() bool {