Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb4dcd31 authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi
Browse files

floss: Link bluetooth-static as whole archive

When linking bluetooth-static, cxxbridge symbols are sometimes not
resolving even though they exist. Using the whole-archive option when
linking this library fixes this issue. For more info:

https://doc.rust-lang.org/rustc/command-line-arguments.html#option-l-link-lib

Bug: 235870415
Tag: #floss
Test: ./build.py with rustc 1.0.68, cxx 1.0.94
Change-Id: I382960c0c8bd4f92b521ab2c2c073bcac6bfb7be
parent 51179abb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ fn main() {
    // The main linking point with c++ code is the libbluetooth-static.a
    // These includes all the symbols built via C++ but doesn't include other
    // links (i.e. pkg-config)
    println!("cargo:rustc-link-lib=static=bluetooth-static");
    println!("cargo:rustc-link-lib=static:-bundle,+whole-archive=bluetooth-static");
    println!("cargo:rustc-link-search=native={}", target_dir.clone().into_string().unwrap());
    // Also re-run the build if anything in the C++ build changes
    println!("cargo:rerun-if-changed={}", cxx_outdir.into_string().unwrap());