Skip to content

Fix clang20+ compilation#593

Open
KaperD wants to merge 1 commit intoARM-software:mainfrom
KaperD:fix-new-clang-compilation-error
Open

Fix clang20+ compilation#593
KaperD wants to merge 1 commit intoARM-software:mainfrom
KaperD:fix-new-clang-compilation-error

Conversation

@KaperD
Copy link
Copy Markdown

@KaperD KaperD commented Mar 31, 2026

Since clang 20 there is overriding-option check, which fails if both -ffp-model=precise and -ffp-contract=off are set (they are for AppleClang e.g.). Example https://godbolt.org/z/eWMn4c7z9

From clang docs: precise Disables optimizations that are not value-safe on floating-point data, although FP contraction (FMA) is enabled (-ffp-contract=on). This is the default behavior. This value resets -fmath-errno to its target-dependent default.

So, -ffp-model=precise = -fno-unsafe-math-optimizations -ffp-contract=on + reset -fmath-errno. But you don't use errno, that is why we can change -ffp-model=precise to -fno-unsafe-math-optimizations`

@ARM-software ARM-software deleted a comment from Dreamer1 Mar 31, 2026
@solidpixel
Copy link
Copy Markdown
Contributor

Thanks for the heads up and the PR - will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants