-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
gcc: if isPower64, add --with-long-double-64 --without-long-double-128 #170857
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c527af1
stdenv: force gmp to rebuild in stage4 of the bootstrap
cad68ef
stdenv: cause makeStaticLibraries usage to agree with usage spec
9dd7908
stdenv: label the ephemeral coreutils-stage4 package
502d902
Update pkgs/stdenv/linux/default.nix
5d2aa78
stdenv: add -stageX markers to gmp, mpfr, libmpc, and isl
fde903a
gcc: backport cda41ce0 from gcc 11.1.0 if isPower64 && isMusl
14af95e
gcc: if isPower64, add --with-long-double-64 --without-long-double-128
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
75 changes: 75 additions & 0 deletions
75
pkgs/development/compilers/gcc/10/backport-libgcc-fix-PR97653.patch
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
This patch is included upstream in gcc 11.1.0 and later: | ||
|
||
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=cda41ce0e8414aec59e6b9fbe645d96e6e8193e2 | ||
|
||
From cda41ce0e8414aec59e6b9fbe645d96e6e8193e2 Mon Sep 17 00:00:00 2001 | ||
From: Jakub Jelinek <jakub@redhat.com> | ||
Date: Sat, 3 Apr 2021 10:05:32 +0200 | ||
Subject: [PATCH] rs6000: Fix up libgcc ABI when built with | ||
--with-long-double-format=ieee [PR97653] | ||
|
||
__floatunditf and __fixtfdi and a couple of other libgcc{.a,_s.so} | ||
entrypoints for backwards compatibility should mean IBM double double | ||
handling (i.e. IFmode), gcc emits such calls for that format and | ||
form IEEE long double emits *kf* instead. | ||
When gcc is configured without --with-long-double-format=ieee , | ||
everything is fine, but when it is not, we need to compile those | ||
libgcc sources with -mno-gnu-attribute -mabi=ibmlongdouble. | ||
The following snippet in libgcc/config/rs6000/t-linux was attempting | ||
to ensure that, and for some routines it works fine (e.g. for _powitf2). | ||
But, due to 4 different types of bugs it doesn't work for most of those | ||
functions, which means that in --with-long-double-format=ieee | ||
configured gcc those *tf* entrypoints instead handle the long double | ||
arguments as if they were KFmode. | ||
|
||
The bugs are: | ||
1) the first few objs properly use $(objext) as suffix, but | ||
several other contain a typo and use $(object) instead, | ||
which is a variable that isn't set to anything, so we don't | ||
add .o etc. extensions | ||
2) while unsigned fix are properly called _fixuns*, unsigned float | ||
are called _floatun* (without s), but the var was using there | ||
the extra s and so didn't match | ||
3) the variable didn't cover any of the TF <-> TI conversions, | ||
only TF <-> DI conversions | ||
4) nothing in libgcc_s.so was handled, as those object files are | ||
called *_s.o rather than *.o and IBM128_SHARED_OBJS used wrong | ||
syntax of the GNU make substitution reference, which should be | ||
$(var:a=b) standing for $(patsubst a,b,$(var)) but it used | ||
$(var:a:b) instead | ||
|
||
2021-04-03 Jakub Jelinek <jakub@redhat.com> | ||
|
||
PR target/97653 | ||
* config/rs6000/t-linux (IBM128_STATIC_OBJS): Fix spelling, use | ||
$(objext) instead of $(object). Use _floatunditf instead of | ||
_floatunsditf. Add tf <-> ti conversion objects. | ||
(IBM128_SHARED_OBJS): Use proper substitution reference syntax. | ||
--- | ||
libgcc/config/rs6000/t-linux | 10 ++++++---- | ||
1 file changed, 6 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux | ||
index 72e9c2770a6..500210ddaf2 100644 | ||
--- a/libgcc/config/rs6000/t-linux | ||
+++ b/libgcc/config/rs6000/t-linux | ||
@@ -11,10 +11,12 @@ HOST_LIBGCC2_CFLAGS += -mno-minimal-toc | ||
# the IBM extended double format. Also turn off gnu attributes on the static | ||
# modules. | ||
IBM128_STATIC_OBJS = ibm-ldouble$(objext) _powitf2$(objext) \ | ||
- ppc64-fp$(objext) _divtc3$(object) _multc3$(object) \ | ||
- _fixtfdi$(object) _fixunstfdi$(object) \ | ||
- _floatditf$(objext) _floatunsditf$(objext) | ||
-IBM128_SHARED_OBJS = $(IBM128_STATIC_OBJS:$(objext):_s$(objext)) | ||
+ ppc64-fp$(objext) _divtc3$(objext) _multc3$(objext) \ | ||
+ _fixtfdi$(objext) _fixunstfdi$(objext) \ | ||
+ _floatditf$(objext) _floatunditf$(objext) \ | ||
+ _fixtfti$(objext) _fixunstfti$(objext) \ | ||
+ _floattitf$(objext) _floatuntitf$(objext) | ||
+IBM128_SHARED_OBJS = $(IBM128_STATIC_OBJS:$(objext)=_s$(objext)) | ||
IBM128_OBJS = $(IBM128_STATIC_OBJS) $(IBM128_SHARED_OBJS) | ||
|
||
IBM128_CFLAGS = -Wno-psabi -mabi=ibmlongdouble -mno-gnu-attribute | ||
-- | ||
2.27.0 | ||
|
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
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
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
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
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.
Perhaps it would help to instead default the platform to gcc11? (like x86_64-linux and some others)
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.
I'll try that as soon as my current rebuild-the-world finishes.
However even in that case could we still keep the line above? At least that way if somebody needs gcc10 for some reason it will work.
PS, that line is actually from #170400, which this PR builds on top of. That PR is ready for review and possible merge; this one is still WIP but getting very close.