@@ -266,6 +266,10 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
266266 "leoncasa" => Some ( LLVMFeature :: new ( "hasleoncasa" ) ) ,
267267 s => Some ( LLVMFeature :: new ( s) ) ,
268268 } ,
269+ Arch :: Wasm32 | Arch :: Wasm64 => match s {
270+ "gc" if major < 22 => None ,
271+ s => Some ( LLVMFeature :: new ( s) ) ,
272+ } ,
269273 Arch :: X86 | Arch :: X86_64 => {
270274 match s {
271275 "sse4.2" => Some ( LLVMFeature :: with_dependencies (
@@ -360,25 +364,25 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
360364 let target_abi = & sess. target . options . abi ;
361365 let target_pointer_width = sess. target . pointer_width ;
362366 let version = get_version ( ) ;
363- let lt_20_1_1 = version < ( 20 , 1 , 1 ) ;
364- let lt_21_0_0 = version < ( 21 , 0 , 0 ) ;
367+ let ( major, _, _) = version;
365368
366369 cfg. has_reliable_f16 = match ( target_arch, target_os) {
367- // LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (fixed in llvm20 )
370+ // LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (fixed in LLVM 20.1.1 )
368371 ( Arch :: AArch64 , _)
369- if !cfg. target_features . iter ( ) . any ( |f| f. as_str ( ) == "neon" ) && lt_20_1_1 =>
372+ if !cfg. target_features . iter ( ) . any ( |f| f. as_str ( ) == "neon" )
373+ && version < ( 20 , 1 , 1 ) =>
370374 {
371375 false
372376 }
373377 // Unsupported <https://github.com/llvm/llvm-project/issues/94434>
374378 ( Arch :: Arm64EC , _) => false ,
375379 // Selection failure <https://github.com/llvm/llvm-project/issues/50374> (fixed in llvm21)
376- ( Arch :: S390x , _) if lt_21_0_0 => false ,
380+ ( Arch :: S390x , _) if major < 21 => false ,
377381 // MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
378382 ( Arch :: X86_64 , Os :: Windows ) if * target_env == Env :: Gnu && * target_abi != Abi :: Llvm => false ,
379383 // Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
380384 ( Arch :: CSky , _) => false ,
381- ( Arch :: Hexagon , _) if lt_21_0_0 => false , // (fixed in llvm21)
385+ ( Arch :: Hexagon , _) if major < 21 => false , // (fixed in llvm21)
382386 ( Arch :: PowerPC | Arch :: PowerPC64 , _) => false ,
383387 ( Arch :: Sparc | Arch :: Sparc64 , _) => false ,
384388 ( Arch :: Wasm32 | Arch :: Wasm64 , _) => false ,
@@ -389,23 +393,23 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
389393 } ;
390394
391395 cfg. has_reliable_f128 = match ( target_arch, target_os) {
396+ // Unsupported https://github.com/llvm/llvm-project/issues/121122
397+ ( Arch :: AmdGpu , _) => false ,
392398 // Unsupported <https://github.com/llvm/llvm-project/issues/94434>
393399 ( Arch :: Arm64EC , _) => false ,
394- // Selection bug <https://github.com/llvm/llvm-project/issues/96432> (fixed in llvm20 )
395- ( Arch :: Mips64 | Arch :: Mips64r6 , _) if lt_20_1_1 => false ,
400+ // Selection bug <https://github.com/llvm/llvm-project/issues/96432> (fixed in LLVM 20.1.0 )
401+ ( Arch :: Mips64 | Arch :: Mips64r6 , _) if version < ( 20 , 1 , 0 ) => false ,
396402 // Selection bug <https://github.com/llvm/llvm-project/issues/95471>. This issue is closed
397403 // but basic math still does not work.
398404 ( Arch :: Nvptx64 , _) => false ,
399- // Unsupported https://github.com/llvm/llvm-project/issues/121122
400- ( Arch :: AmdGpu , _) => false ,
401405 // ABI bugs <https://github.com/rust-lang/rust/issues/125109> et al. (full
402406 // list at <https://github.com/rust-lang/rust/issues/116909>)
403407 ( Arch :: PowerPC | Arch :: PowerPC64 , _) => false ,
404408 // ABI unsupported <https://github.com/llvm/llvm-project/issues/41838>
405409 ( Arch :: Sparc , _) => false ,
406410 // Stack alignment bug <https://github.com/llvm/llvm-project/issues/77401>. NB: tests may
407411 // not fail if our compiler-builtins is linked. (fixed in llvm21)
408- ( Arch :: X86 , _) if lt_21_0_0 => false ,
412+ ( Arch :: X86 , _) if major < 21 => false ,
409413 // MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
410414 ( Arch :: X86_64 , Os :: Windows ) if * target_env == Env :: Gnu && * target_abi != Abi :: Llvm => false ,
411415 // There are no known problems on other platforms, so the only requirement is that symbols
0 commit comments