File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -137,12 +137,14 @@ fn rustc_command_with_audit_data(rustc_path: &OsStr) -> Option<Command> {
137137 } else if is_wasm ( & target_info) {
138138 // We don't emit the symbol name in WASM, so nothing to do
139139 } else {
140- // Unrecognized platform, assume it to be unix-like
141- #[ allow( clippy:: collapsible_else_if) ]
140+ // Unrecognized platform, assume it to be unix-like.
141+ // Use POSIX `-u` instead of GNU `--undefined=` for broad compatibility
142+ // (e.g. zig rejects the GNU form).
142143 if args. bare_linker ( ) {
143- command. arg ( "-Clink-arg=--undefined=AUDITABLE_VERSION_INFO" ) ;
144+ command. arg ( "-Clink-arg=-u" ) ;
145+ command. arg ( "-Clink-arg=AUDITABLE_VERSION_INFO" ) ;
144146 } else {
145- command. arg ( "-Clink-arg=-Wl,--undefined= AUDITABLE_VERSION_INFO" ) ;
147+ command. arg ( "-Clink-arg=-Wl,-u, AUDITABLE_VERSION_INFO" ) ;
146148 }
147149 }
148150 Some ( command)
You can’t perform that action at this time.
0 commit comments