Skip to content

Commit 8928b75

Browse files
Using libc only, uing picolibc
1 parent 8f52cdb commit 8928b75

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

ledger_secure_sdk_sys/build.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl SDKBuilder<'_> {
169169

170170
let gcc_toolchain = if sysroot.is_empty() {
171171
// path for Debian-based systems
172-
String::from("/usr/lib/arm-none-eabi")
172+
String::from("/usr/lib/picolibc/arm-none-eabi")
173173
} else {
174174
format!("{sysroot}")
175175
};
@@ -302,13 +302,13 @@ impl SDKBuilder<'_> {
302302
// Set ARM pre-compiled libraries path
303303
self.device.arm_libs = match self.device.name {
304304
DeviceName::NanoX => {
305-
let mut path = self.device.c_sdk.display().to_string();
306-
path.push_str("/arch/st33/lib");
305+
let mut path = self.gcc_toolchain.display().to_string();
306+
path.push_str("/lib/thumb/v7-m/nofp");
307307
path
308308
}
309309
DeviceName::NanoSPlus | DeviceName::Flex | DeviceName::Stax => {
310-
let mut path = self.device.c_sdk.display().to_string();
311-
path.push_str("/arch/st33k1/lib");
310+
let mut path = self.gcc_toolchain.display().to_string();
311+
path.push_str("/lib/thumb/v8-m.main/nofp");
312312
path
313313
}
314314
};
@@ -434,11 +434,9 @@ impl SDKBuilder<'_> {
434434

435435
command.compile("ledger-secure-sdk");
436436

437-
/* Link with libc, libm and clang compiler-rt builtins */
437+
/* Link with libc */
438438
let path = self.device.arm_libs.clone();
439439
println!("cargo:rustc-link-lib=c");
440-
println!("cargo:rustc-link-lib=m");
441-
println!("cargo:rustc-link-lib=clang_rt.builtins");
442440

443441
println!("cargo:rustc-link-search={path}");
444442
Ok(())

ledger_secure_sdk_sys/link.ld

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ SECTIONS
124124
/DISCARD/ :
125125
{
126126
libc.a ( * )
127-
libm.a ( * )
128-
libclang_rt.builtins.a ( * )
129127
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
130128
*(.debug_info)
131129
}

0 commit comments

Comments
 (0)