Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cargo-auditable/src/rustc_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,14 @@ fn rustc_command_with_audit_data(rustc_path: &OsStr) -> Option<Command> {
} else if is_wasm(&target_info) {
// We don't emit the symbol name in WASM, so nothing to do
} else {
// Unrecognized platform, assume it to be unix-like
#[allow(clippy::collapsible_else_if)]
// Unrecognized platform, assume it to be unix-like.
// Use POSIX `-u` instead of GNU `--undefined=` for broad compatibility
// (e.g. zig rejects the GNU form).
if args.bare_linker() {
command.arg("-Clink-arg=--undefined=AUDITABLE_VERSION_INFO");
command.arg("-Clink-arg=-u");
command.arg("-Clink-arg=AUDITABLE_VERSION_INFO");
} else {
command.arg("-Clink-arg=-Wl,--undefined=AUDITABLE_VERSION_INFO");
command.arg("-Clink-arg=-Wl,-u,AUDITABLE_VERSION_INFO");
}
}
Some(command)
Expand Down
Loading