Skip to content

Commit 5db6239

Browse files
committed
Use libc from C SDK for each device
1 parent 1b289c6 commit 5db6239

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ledger_secure_sdk_sys/build.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,20 @@ impl SDKBuilder {
518518
command.compile("ledger-secure-sdk");
519519

520520
/* Link with libc for unresolved symbols */
521-
let gcc_tc = self.gcc_toolchain.display().to_string();
521+
let mut path = self.bolos_sdk.display().to_string();
522+
match self.device {
523+
Device::NanoS => {
524+
path = self.gcc_toolchain.display().to_string().push_str("/lib");
525+
}
526+
Device::NanoX => {
527+
path.push_str("/arch/st33/lib");
528+
}
529+
Device::NanoSPlus | Device::Flex | Device::Stax => {
530+
path.push_str("/arch/st33k1/lib");
531+
}
532+
};
522533
println!("cargo:rustc-link-lib=c");
523-
println!("cargo:rustc-link-search={gcc_tc}/lib");
534+
println!("cargo:rustc-link-search={path}");
524535
}
525536

526537
fn generate_bindings(&self) {

0 commit comments

Comments
 (0)