Is there a standard way to check if a Rust binary crate (including its dependencies) calls any foreign functions (like extern functions in C)? In other words, is there a way to make sure a Rust program is purely written in Rust?
Asked
Active
Viewed 50 times
0
-
Pretty sure even the standard library relies on `libc` (on linux), so you're going to have to be a bit more specific. You can compare `ldd` output between a "hello world" program and another to see if there's any additional dynamic libraries that are depended on. – kmdreko Jan 26 '23 at 21:12
-
And even then, that's not the whole picture because you could statically link a library compiled from C into your binary. – kmdreko Jan 26 '23 at 21:14
-
Or use `cargo geiger` to locate unsafe code, then look at said unsafe code to see if it contains an FFI call. – Jmb Jan 27 '23 at 08:26