Skip to content

Commit

Permalink
Use the correct link.exe flag for preserving the specified symbol eve…
Browse files Browse the repository at this point in the history
…n if it is unused
  • Loading branch information
Shnatsel committed Apr 28, 2024
1 parent 4d92c13 commit 11a38fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cargo-auditable/src/rustc_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pub fn main(rustc_path: &OsStr) {
// Prevent the symbol from being removed as unused by the linker
if target_triple.contains("-apple-") {
command.arg("-Clink-arg=-Wl,-u,_AUDITABLE_VERSION_INFO");
} else if target_triple.ends_with("-msvc") {
command.arg("-Clink-arg=/INCLUDE:AUDITABLE_VERSION_INFO");
} else {
command.arg("-Clink-arg=-Wl,--undefined=AUDITABLE_VERSION_INFO");
}
Expand Down

0 comments on commit 11a38fb

Please sign in to comment.