Skip to content

Commit

Permalink
bazel: Allow multiple definitions for armeabi android links
Browse files Browse the repository at this point in the history
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 <keithbsmiley@gmail.com>
  • Loading branch information
keith committed Apr 13, 2022
1 parent 9c90ac0 commit a50291a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/common/jni/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ cc_library(
alwayslink = True,
)

config_setting(
name = "android_armeabi",
constraint_values = [
"@platforms//cpu:arm",
"@platforms//os:android",
],
)

# Main dynamic library for the Envoy Mobile aar
cc_binary(
name = "libenvoy_jni.so",
Expand All @@ -61,6 +69,10 @@ cc_binary(
] + select({
"@envoy//bazel:dbg_build": ["-Wl,--build-id=sha1"],
"//conditions:default": [],
}) + select({
# TODO(keith): https://github.com/rust-lang/compiler-builtins/issues/353
":android_armeabi": ["-Wl,--allow-multiple-definition"],
"//conditions:default": [],
}),
linkshared = True,
deps = [
Expand Down

0 comments on commit a50291a

Please sign in to comment.