Skip to content

Commit a50291a

Browse files
committed
bazel: Allow multiple definitions for armeabi android links
When working on rust support we hit this issue rust-lang/compiler-builtins#353 which seems to still be persistent even in the case you have the nightly version mentioned there. I haven't been able to reproduce the issue in a separate project, but the core seems to be that both libgcc and rust's compiler builtins module vendor some float math symbols and both are included. This change is as scoped as possible so that no real issues could sneak in with this disabled, which should mostly be covered by only passing this for the single arch. Signed-off-by: Keith Smiley <[email protected]>
1 parent 9c90ac0 commit a50291a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

library/common/jni/BUILD

+12
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ cc_library(
5151
alwayslink = True,
5252
)
5353

54+
config_setting(
55+
name = "android_armeabi",
56+
constraint_values = [
57+
"@platforms//cpu:arm",
58+
"@platforms//os:android",
59+
],
60+
)
61+
5462
# Main dynamic library for the Envoy Mobile aar
5563
cc_binary(
5664
name = "libenvoy_jni.so",
@@ -61,6 +69,10 @@ cc_binary(
6169
] + select({
6270
"@envoy//bazel:dbg_build": ["-Wl,--build-id=sha1"],
6371
"//conditions:default": [],
72+
}) + select({
73+
# TODO(keith): https://github.com/rust-lang/compiler-builtins/issues/353
74+
":android_armeabi": ["-Wl,--allow-multiple-definition"],
75+
"//conditions:default": [],
6476
}),
6577
linkshared = True,
6678
deps = [

0 commit comments

Comments
 (0)