File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,13 @@ fn configure_f16_f128(target: &Target) {
283
283
"powerpc64" if & target. os == "aix" => ( true , false ) ,
284
284
// `f128` crashes <https://github.com/llvm/llvm-project/issues/41838>
285
285
"sparc" | "sparcv9" => ( true , false ) ,
286
+ // `f16` requires half-precision feature, `f128` is unsupported
287
+ "wasm32" | "wasm64" => (
288
+ // TODO: This requires updating `WASM_ALLOWED_FEATURES`:
289
+ // https://github.com/rust-lang/rust/blob/1.80.0/compiler/rustc_target/src/target_features.rs#L310
290
+ target. features . contains ( & "half-precision" . to_owned ( ) ) ,
291
+ false ,
292
+ ) ,
286
293
// Most everything else works as of LLVM 19
287
294
_ => ( true , true ) ,
288
295
} ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ fn main() {
18
18
if target. starts_with ( "arm-" )
19
19
|| target. contains ( "apple-darwin" )
20
20
|| target. contains ( "windows-msvc" )
21
+ || target. starts_with ( "wasm" )
21
22
// GCC and LLVM disagree on the ABI of `f16` and `f128` with MinGW. See
22
23
// <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>.
23
24
|| target. contains ( "windows-gnu" )
@@ -55,7 +56,7 @@ fn main() {
55
56
|| target. contains ( "windows-" )
56
57
// Linking says "error: function signature mismatch: __extendhfsf2" and seems to
57
58
// think the signature is either `(i32) -> f32` or `(f32) -> f32`
58
- || target. starts_with ( "wasm32- " )
59
+ || target. starts_with ( "wasm " )
59
60
{
60
61
features. insert ( Feature :: NoSysF16 ) ;
61
62
features. insert ( Feature :: NoSysF16F128Convert ) ;
You can’t perform that action at this time.
0 commit comments