Allow user-provided llvm_args to override target spec arguments#156554
Allow user-provided llvm_args to override target spec arguments#156554guybedford wants to merge 1 commit into
llvm_args to override target spec arguments#156554Conversation
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Oh dear, sorry for the breakage! I mistakenly assumed everything would support the modern instructions, and then I additionally mistakenly assumed that passing Some thoughts on this for me:
Personally I feel like leaning toward the last of these options, swapping the order to allow users to pass |
This ensures that user arguments can override target arguments without being silently ignored.
a07f363 to
45adab8
Compare
llvm_args to override target spec arguments
|
Was really glad to see the modern exception handling land actually - if the ordering is not a concern that is definitely much simpler. I've gone ahead and pushed that change instead without the extra |
|
I've posted on Zulip at #t-compiler > Order of `-Cllvm-arg` and target spec's `llvm_args` and if there's no concerns I'll approve this in a day or so |
|
r? alexcrichton |
This switches the order in which
-Cllvm-argsis applied between target-spec arguments and user-provided LLVM arguments.This came up in #156061, where the target passing
-Cllvm-args=-wasm-use-legacy-eh=falsemeans that a user passing-Cllvm-args=-wasm-use-legacy-eh=truecannot override this value since the LLVM arguments support the last argument overriding the previous, and user arguments were chained first.With this change, it is possible for Wasm targets to opt into legacy EH for compatibility with runtimes that don't yet implement the modern exnref/try_table instructions, such as Node.js 20 on V8 11.3 and older browsers. While Node.js 20 is formally EOL, many libraries will still need to support this version for a few months yet, so this would ease the transition path to modern exception handling having an opt-out.
Originally this PR added support for a dedicated
-Zflag for switching to legacy exception handling, but fine-grained control over the arguments would be a preferable solution provided it does not conflict with other behaviours.//cc @alexcrichton