Skip to content

Commit

Permalink
Use libc from C SDK for each device
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Feb 6, 2025
1 parent 1b289c6 commit 5db6239
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions ledger_secure_sdk_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,20 @@ impl SDKBuilder {
command.compile("ledger-secure-sdk");

/* Link with libc for unresolved symbols */
let gcc_tc = self.gcc_toolchain.display().to_string();
let mut path = self.bolos_sdk.display().to_string();
match self.device {
Device::NanoS => {
path = self.gcc_toolchain.display().to_string().push_str("/lib");
}
Device::NanoX => {
path.push_str("/arch/st33/lib");
}
Device::NanoSPlus | Device::Flex | Device::Stax => {
path.push_str("/arch/st33k1/lib");
}
};
println!("cargo:rustc-link-lib=c");
println!("cargo:rustc-link-search={gcc_tc}/lib");
println!("cargo:rustc-link-search={path}");
}

fn generate_bindings(&self) {
Expand Down

0 comments on commit 5db6239

Please sign in to comment.