Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[builtins] Fix floattitf.c etc. compilation on Solaris/SPARC #70058

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

rorth
Copy link
Collaborator

@rorth rorth commented Oct 24, 2023

69660cc broke the Solaris/sparcv9 buildbot: compiler-rt/lib/builtins/int_to_fp.h unconditionally uses *int128_t which don't exist on 32-bit SPARC.

As suggested in #67540, this patch fixes this by moving the CRT_HAS_TF_MODE guard up which does the necessary checks.

Tested on sparcv9-sun-solaris2.11.

69660cc broke the Solaris/sparcv9 buildbot
https://lab.llvm.org/staging/#/builders/12/builds/264:
`compiler-rt/lib/builtins/int_to_fp.h` unconditionally uses `*int128_t`
which don't exist on 32-bit SPARC.

As suggested in llvm#67540, this patch
fixes this by moving the `CRT_HAS_TF_MODE` guard up which does the
necessary checks.

Tested on `sparcv9-sun-solaris2.11`.
Copy link
Member

@arichardson arichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, alternatively could also add an explicit check for INT128 availability to this #if rather than relying on CRT_HAS_TF_MODE only being defined when int128 also exists.

Copy link
Contributor

@asb asb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, thanks for fixing this and apologies my patch caused a regression for your target. Failing to guard int128_t was indeed an oversight.

Looking at the history for the linked builder, it seems pretty reliable other than this patch of course breaking it. Have you looked into moving it to the production buildmaster? That way, I would have had an email soon after landing the patch and could have reverted then fixed.

@rorth rorth merged commit ad7611d into llvm:main Oct 24, 2023
6 checks passed
@rorth
Copy link
Collaborator Author

rorth commented Oct 24, 2023

LGTM, alternatively could also add an explicit check for INT128 availability to this #if rather than relying on CRT_HAS_TF_MODE only being defined when int128 also exists.

I've committed the patch as is to quickly unbreak the buildbot. If we want to add more checks to make headers self-contained, I guess it's better to do this consistently rather than just in a single place.

@rorth
Copy link
Collaborator Author

rorth commented Oct 24, 2023

Looking at the history for the linked builder, it seems pretty reliable other than this patch of course breaking it. Have you looked into moving it to the production buildmaster? That way, I would have had an email soon after landing the patch and could have reverted then fixed.

I have indeed, given that there seem to be no spurious failures on the Solaris/sparcv9 buildbot lately. I'd like to also move the corresponding Solaris/amd64 bot, but that one has one type of failure in compiler-rt once in a while which I couldn't reproduce outside of the bot yet, so I guess I'll be moving them separately.

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

Successfully merging this pull request may close these issues.

4 participants