-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Found one more delta to unbreak build for z/os #82789
Open
perry-ca
wants to merge
7
commits into
llvm:main
Choose a base branch
from
perry-ca:perry/quad-non-tf-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
66989a1
fix build for z/os
perry-ca 1996816
Merge branch 'llvm:main' into perry/quad-non-tf-mode
perry-ca 6c45d60
Fix files so div & mult are included for z/OS and excluded for 32-bit…
perry-ca eb3bd1b
Merge branch 'llvm:main' into perry/quad-non-tf-mode
perry-ca b151da0
reorg some more so sparc doesn't get error when CRT_HAS_TF_MODE isn't…
perry-ca e4192b2
Merge branch 'main' into perry/quad-non-tf-mode
perry-ca 6c8c0ab
Merge branch 'llvm:main' into perry/quad-non-tf-mode
perry-ca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions below work without int128, so this makes sense to me, but it would be good to check that this doesn't break 32-bit sparc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rorth can you confirm this works with 32-bit sparc (replacing your change in #101662 with this one). Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this does work with
gcc-14
, it breaks when usingclang-20
instead: 26builtins
files fail with the likes oflong double
on SPARC is a royal mess, unfortunately: while the SPARC psABI (both 32 and 64-bit) requireslong double
to be 128 bit (although no current hardware does support that) and Solaris follows the spec, Linux/sparc64 chose to ignore that, keepinglong double
as 64 bit. Whilegcc
gets this right,clang
never did.The following shows the values of the relevant macros:
Due to all this, dealing with
long double
on SPARC is fragile as hell...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given what you have said, I would suggest the real fix for SPARC is to change the list of source files for SPARC so you exclude all of the source files related to QUAD_PRECISSION. This looks like you just need to skip adding
GENERIC_TF_SOURCES
to the list of source files for SPARC.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So Clang and GCC disagree on the Linux ABI here? It sounds like clang should be following GCC and using 128-bit long double since that will be used for all existing Linux code?
If there is not 128-bit floating point type on sparc (at least with clang), the it sounds to me like it should not be building the tf files at all?
It looks like GCC uses IEEE 128-bit long double, so maybe we can just hoist the ifdefs above the
fp_lib.h
include?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rorth Ping. Have you looked at this? I would like to get the z/os builds working again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No: Solaris/sparc follows the ELF SPARC psABI which dictates that
long double
be 128-bit. While Linux/sparc, generally following the psABI, it chose to ignore that particular part of the spec and went for 64-bitlong double
instead.clang
should indeed match the psABI/GCC/Solarislibc
, but fixing this is way beyond my abilities, and LLVM SPARC maintenance these days is limited.There is on Solaris, but it's soft-float only.
I've meanwhile found that the
builtins
situation is even messier than I thought: until LLVM 17,libclang_rt.builtins-sparc.a
did contain__divtc3
and__multc3
. Sometime before LLVM 18, those definitions got lost (and apparently there are no checks that thebuiltins
interface remains stable). So instead of cementing that regression, the definitions should be restored, not removed for good. I've started looking into when the removal happened, but unfortunately so many intermediate revisions don't even build that this is very hard to do ;-(What I believe should happen first is identify the revision that caused this breakage, than look into fixing that to continue working on SPARC together with whatever it was meant to achieve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
Also look at the compiler side. Can the compiler generate calls to
__divtc3
and__multc3
or any of the TF functions? If the compiler can't generate a call to these TF functions then it is ok to remove them from the archive even though LLVM 17 had them in it. I'd also look at what code would be in the__divtc3
in LLVM 17 if you can't provide that logfb function. How did that file compile in the first place?When making your patch can you start with this change so we are building on top of the same code. And when you are ready ping me and I will try your change on z/OS.