Skip to content

Commit 67b1ffe

Browse files
authored
Merge pull request #240 from LedgerHQ/y333/link_with_proper_libc
Use libc from C SDK for each device
2 parents 1b289c6 + 3cb435d commit 67b1ffe

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
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_device_sdk/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ledger_device_sdk"
3-
version = "1.20.2"
3+
version = "1.20.3"
44
authors = ["yhql", "yogh333", "agrojean-ledger", "kingofpayne"]
55
edition = "2021"
66
license.workspace = true
@@ -21,7 +21,7 @@ rand_core = { version = "0.6.3", default-features = false }
2121
zeroize = { version = "1.6.0", default-features = false }
2222
numtoa = "0.2.4"
2323
const-zero = "0.1.1"
24-
ledger_secure_sdk_sys = { path = "../ledger_secure_sdk_sys", version = "1.6.5" }
24+
ledger_secure_sdk_sys = { path = "../ledger_secure_sdk_sys", version = "1.6.6" }
2525

2626
[features]
2727
debug = []

ledger_secure_sdk_sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ledger_secure_sdk_sys"
3-
version = "1.6.5"
3+
version = "1.6.6"
44
authors = ["yhql", "agrojean-ledger", "yogh333"]
55
edition = "2021"
66
license.workspace = true

ledger_secure_sdk_sys/build.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,21 @@ 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();
525+
path.push_str("/lib");
526+
}
527+
Device::NanoX => {
528+
path.push_str("/arch/st33/lib");
529+
}
530+
Device::NanoSPlus | Device::Flex | Device::Stax => {
531+
path.push_str("/arch/st33k1/lib");
532+
}
533+
};
522534
println!("cargo:rustc-link-lib=c");
523-
println!("cargo:rustc-link-search={gcc_tc}/lib");
535+
println!("cargo:rustc-link-search={path}");
524536
}
525537

526538
fn generate_bindings(&self) {

0 commit comments

Comments
 (0)