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 <[email protected]>
Signed-off-by: JP Simard <[email protected]>
  • Loading branch information
keith authored and jpsim committed Nov 29, 2022
1 parent 038a9bf commit 8ac19ca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mobile/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 8ac19ca

Please sign in to comment.