Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: force-link libdl #274

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions rust/bridge/jni/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// Copyright 2021 Signal Messenger, LLC.
// SPDX-License-Identifier: AGPL-3.0-only
//

use std::env;

fn main() {
if env::var("CARGO_CFG_TARGET_ARCH").expect("set by Cargo") == "aarch64"
&& env::var("CARGO_CFG_TARGET_OS").expect("set by Cargo") == "android"
{
// HACK: Force libdl to be linked.
// Something about the Docker-based build results in it getting skipped;
// if we figure out what, we can remove this.
println!("cargo:rustc-cdylib-link-arg=-Wl,--no-as-needed,-ldl,--as-needed");
}
}