Skip to content

Commit ad39c60

Browse files
committed
Make the bug 24465209 workaround implementation clearer.
Or at least "less intermingled with unrelated configuration". Change-Id: I2551e58c3a710e0be0efd39cf70fe7f95604f3ca
1 parent e0db79d commit ad39c60

File tree

2 files changed

+29
-21
lines changed

2 files changed

+29
-21
lines changed

libc/Android.bp

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Define the common source files for all the libc instances
2-
// =========================================================
31
package {
42
default_applicable_licenses: ["bionic_libc_license"],
53
}
@@ -114,6 +112,26 @@ cc_defaults {
114112
tidy_disabled_srcs: ["upstream-*/**/*.c"],
115113
}
116114

115+
// Workaround for b/24465209.
116+
// We're unlikely to be able to remove this before we just
117+
// remove ILP32 support completely.
118+
// Note that we also still have `pack_relocations: false`
119+
// for both libc and libm, even on LP64.
120+
// ========================================================
121+
cc_defaults {
122+
name: "bug_24465209_workaround",
123+
arch: {
124+
arm: {
125+
pack_relocations: false,
126+
ldflags: ["-Wl,--hash-style=both"],
127+
},
128+
x86: {
129+
pack_relocations: false,
130+
ldflags: ["-Wl,--hash-style=both"],
131+
}
132+
},
133+
}
134+
117135
// Defaults for native allocator libs/includes to make it
118136
// easier to change.
119137
// ========================================================
@@ -1529,6 +1547,7 @@ cc_defaults {
15291547
defaults: [
15301548
"libc_defaults",
15311549
"libc_native_allocator_defaults",
1550+
"bug_24465209_workaround",
15321551
],
15331552
name: "libc_library_defaults",
15341553
product_variables: {
@@ -1586,10 +1605,7 @@ cc_defaults {
15861605

15871606
arch: {
15881607
arm: {
1589-
// TODO: This is to work around b/24465209. Remove after root cause is fixed.
1590-
pack_relocations: false,
15911608
ldflags: [
1592-
"-Wl,--hash-style=both",
15931609
// Since we are preserving the debug_frame, do not compress
15941610
// in this case to make unwinds as fast as possible.
15951611
"-Wl,--compress-debug-sections=none",
@@ -1633,10 +1649,6 @@ cc_defaults {
16331649
},
16341650
},
16351651
x86: {
1636-
// TODO: This is to work around b/24465209. Remove after root cause is fixed.
1637-
pack_relocations: false,
1638-
ldflags: ["-Wl,--hash-style=both"],
1639-
16401652
version_script: ":libc.x86.map",
16411653
no_libcrt: true,
16421654

@@ -1916,7 +1928,10 @@ cc_library_headers {
19161928
// ========================================================
19171929

19181930
cc_library {
1919-
defaults: ["libc_defaults"],
1931+
defaults: [
1932+
"libc_defaults",
1933+
"bug_24465209_workaround",
1934+
],
19201935
include_dirs: ["bionic/libstdc++/include"],
19211936
srcs: [
19221937
"bionic/__cxa_guard.cpp",
@@ -1941,12 +1956,8 @@ cc_library {
19411956
},
19421957
},
19431958

1944-
//TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
19451959
arch: {
19461960
arm: {
1947-
// TODO: This is to work around b/24465209. Remove after root cause is fixed.
1948-
pack_relocations: false,
1949-
ldflags: ["-Wl,--hash-style=both"],
19501961
version_script: ":libstdc++.arm.map",
19511962
},
19521963
arm64: {
@@ -1956,8 +1967,6 @@ cc_library {
19561967
version_script: ":libstdc++.riscv64.map",
19571968
},
19581969
x86: {
1959-
pack_relocations: false,
1960-
ldflags: ["-Wl,--hash-style=both"],
19611970
version_script: ":libstdc++.x86.map",
19621971
},
19631972
x86_64: {

libm/Android.bp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ license {
2121

2222
cc_library {
2323
name: "libm",
24-
defaults: ["linux_bionic_supported"],
24+
defaults: [
25+
"linux_bionic_supported",
26+
"bug_24465209_workaround",
27+
],
2528
ramdisk_available: true,
2629
vendor_ramdisk_available: true,
2730
recovery_available: true,
@@ -282,8 +285,6 @@ cc_library {
282285
"upstream-freebsd/lib/msun/src/s_ceilf.c",
283286
],
284287
instruction_set: "arm",
285-
pack_relocations: false,
286-
ldflags: ["-Wl,--hash-style=both"],
287288
version_script: ":libm.arm.map",
288289
no_libcrt: true,
289290
shared: {
@@ -368,11 +369,9 @@ cc_library {
368369
"upstream-freebsd/lib/msun/src/s_truncf.c",
369370
],
370371
local_include_dirs: ["i387"],
371-
pack_relocations: false,
372372
// The x86 ABI doesn't include this, which is needed for the
373373
// roundss/roundsd instructions that we've used since Android M.
374374
cflags: ["-msse4.1"],
375-
ldflags: ["-Wl,--hash-style=both"],
376375
version_script: ":libm.x86.map",
377376
},
378377

0 commit comments

Comments
 (0)