llvm-project
7748bf56 - [libc] Skip targets with unavailable __ONLY flags (#196637)

Commit
6 days ago
[libc] Skip targets with unavailable __ONLY flags (#196637) When SKIP_FLAG_EXPANSION strips a flag that has the __ONLY modifier, remove_duplicated_flags drops the flag from the list. This leaves expand_flags_for_target with an empty flag list, causing it to create a plain (non-flag) target. The __ONLY semantics, "only build this target with the flag active", are silently violated. On x86-64 CI runners without FMA, this results in cosf_float_test and sinf_float_test being built and linked without FMA. The sincosf algorithm was tuned assuming fused multiply-add precision, so the unfused x*y+z fallback exceeds the 3.5 ULP tolerance (57 ULP for cosf, 12 ULP for sinf). Added an early return in add_target_with_flags: if any flag with the __ONLY modifier would be skipped, the target is not generated. Assisted-by: Automated tooling, human reviewed.
Author
Parents
Loading