Make the bug 24465209 workaround implementation clearer.
Or at least "less intermingled with unrelated configuration".
Change-Id: I2551e58c3a710e0be0efd39cf70fe7f95604f3ca
diff --git a/libc/Android.bp b/libc/Android.bp
index 943d41f..40215a7 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1,5 +1,3 @@
-// Define the common source files for all the libc instances
-// =========================================================
package {
default_applicable_licenses: ["bionic_libc_license"],
}
@@ -114,6 +112,26 @@
tidy_disabled_srcs: ["upstream-*/**/*.c"],
}
+// Workaround for b/24465209.
+// We're unlikely to be able to remove this before we just
+// remove ILP32 support completely.
+// Note that we also still have `pack_relocations: false`
+// for both libc and libm, even on LP64.
+// ========================================================
+cc_defaults {
+ name: "bug_24465209_workaround",
+ arch: {
+ arm: {
+ pack_relocations: false,
+ ldflags: ["-Wl,--hash-style=both"],
+ },
+ x86: {
+ pack_relocations: false,
+ ldflags: ["-Wl,--hash-style=both"],
+ }
+ },
+}
+
// Defaults for native allocator libs/includes to make it
// easier to change.
// ========================================================
@@ -1529,6 +1547,7 @@
defaults: [
"libc_defaults",
"libc_native_allocator_defaults",
+ "bug_24465209_workaround",
],
name: "libc_library_defaults",
product_variables: {
@@ -1586,10 +1605,7 @@
arch: {
arm: {
- // TODO: This is to work around b/24465209. Remove after root cause is fixed.
- pack_relocations: false,
ldflags: [
- "-Wl,--hash-style=both",
// Since we are preserving the debug_frame, do not compress
// in this case to make unwinds as fast as possible.
"-Wl,--compress-debug-sections=none",
@@ -1633,10 +1649,6 @@
},
},
x86: {
- // TODO: This is to work around b/24465209. Remove after root cause is fixed.
- pack_relocations: false,
- ldflags: ["-Wl,--hash-style=both"],
-
version_script: ":libc.x86.map",
no_libcrt: true,
@@ -1916,7 +1928,10 @@
// ========================================================
cc_library {
- defaults: ["libc_defaults"],
+ defaults: [
+ "libc_defaults",
+ "bug_24465209_workaround",
+ ],
include_dirs: ["bionic/libstdc++/include"],
srcs: [
"bionic/__cxa_guard.cpp",
@@ -1941,12 +1956,8 @@
},
},
- //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
arch: {
arm: {
- // TODO: This is to work around b/24465209. Remove after root cause is fixed.
- pack_relocations: false,
- ldflags: ["-Wl,--hash-style=both"],
version_script: ":libstdc++.arm.map",
},
arm64: {
@@ -1956,8 +1967,6 @@
version_script: ":libstdc++.riscv64.map",
},
x86: {
- pack_relocations: false,
- ldflags: ["-Wl,--hash-style=both"],
version_script: ":libstdc++.x86.map",
},
x86_64: {