* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
@ 2020-10-23 18:14 ` gustavowalbon at gmail dot com
2020-10-23 18:36 ` bergner at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: gustavowalbon at gmail dot com @ 2020-10-23 18:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
Gustavo Walbon <gustavowalbon at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gustavowalbon at gmail dot com
--- Comment #1 from Gustavo Walbon <gustavowalbon at gmail dot com> ---
I have seeing a bunch of packages failing because this warning of linker when I
build several packages on Alpine for PowerPc.
I have a alpine container running on a PowerPC 8, and I rebuilt the all gcc
packages with the flags --with-long-double-64 and --without-long-double-128 to
avoid this error, but that still happens
I used the same code as Tulio to reproduce that warning.
~ $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc64le-alpine-linux-musl/10.2.0/lto-wrapper
Target: powerpc64le-alpine-linux-musl
Configured with: /home/devel/aports/main/gcc/src/gcc-10.2.0/configure
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--build=powerpc64le-alpine-linux-musl --host=powerpc64le-alpine-linux-musl
--target=powerpc64le-alpine-linux-musl --with-pkgversion='Alpine 10.2.0'
--enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
--disable-multilib --disable-nls --disable-werror --disable-symvers
--enable-__cxa_atexit --enable-default-pie --enable-default-ssp
--enable-cloog-backend --enable-languages=c,c++,objc,go,fortran,ada
--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no
--enable-targets=powerpcle-linux --with-long-double-64
--without-long-double-128 --disable-libquadmath --disable-libssp
--disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared
--enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (Alpine 10.2.0)
~ $ gcc -O0 -mlong-double-64 test-ldouble64.c && ./a.out
/usr/lib/gcc/powerpc64le-alpine-linux-musl/10.2.0/../../../../powerpc64le-alpine-linux-musl/bin/ld:
/tmp/ccHidlkA.o uses 64-bit long double,
/usr/lib/gcc/powerpc64le-alpine-linux-musl/10.2.0/../../../../lib/libgcc_s.so.1
uses 128-bit long double
/usr/lib/gcc/powerpc64le-alpine-linux-musl/10.2.0/../../../../powerpc64le-alpine-linux-musl/bin/ld:
/tmp/ccHidlkA.o uses 64-bit long double,
/usr/lib/gcc/powerpc64le-alpine-linux-musl/10.2.0/../../../../lib/libgcc_s.so.1
uses 128-bit long double
sizeof(long double) = 8
a * b = 16.000000
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
2020-10-23 18:14 ` [Bug libgcc/97543] " gustavowalbon at gmail dot com
@ 2020-10-23 18:36 ` bergner at gcc dot gnu.org
2020-10-23 19:14 ` segher at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-10-23 18:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
Peter Bergner <bergner at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amodra at gcc dot gnu.org,
| |bergner at gcc dot gnu.org,
| |meissner at gcc dot gnu.org,
| |segher at gcc dot gnu.org,
| |seurer at gcc dot gnu.org
--- Comment #2 from Peter Bergner <bergner at gcc dot gnu.org> ---
There is no --with-long-double-64 configure option (for power). The configure
script will just silently ignore it. That said, you mentioned you used
--without-long-double-128 which is the correct way to get a 64-bit long double,
so there does seem to be a problem here.
I'm adding Alan and Mike to the CC list here for their input on how this is all
supposed to work. Given you disabled multilib and forced 64-bit long double, I
don't know why libgcc has any 128-bit long double usage.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
2020-10-23 18:14 ` [Bug libgcc/97543] " gustavowalbon at gmail dot com
2020-10-23 18:36 ` bergner at gcc dot gnu.org
@ 2020-10-23 19:14 ` segher at gcc dot gnu.org
2020-10-23 23:28 ` bergner at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: segher at gcc dot gnu.org @ 2020-10-23 19:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
--- Comment #3 from Segher Boessenkool <segher at gcc dot gnu.org> ---
This part of the attribute (all but the low 2 bits) is not documented
in the as manual, btw.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (2 preceding siblings ...)
2020-10-23 19:14 ` segher at gcc dot gnu.org
@ 2020-10-23 23:28 ` bergner at gcc dot gnu.org
2020-10-24 2:48 ` meissner at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-10-23 23:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
--- Comment #4 from Peter Bergner <bergner at gcc dot gnu.org> ---
Created attachment 49436
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49436&action=edit
patch file
So libgcc compiles are explicitly using -mlong-double-128, which doesn't seem
right when GCC is configured with --disable-multilib --without-long-double-128,
which seems to come from:
libgcc/config/rs6000/t-linux:HOST_LIBGCC2_CFLAGS += -mlong-double-128
Shouldn't we just use the compiler default for long double (ie, don't use that
option at all)?
Something like the attached patch?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (3 preceding siblings ...)
2020-10-23 23:28 ` bergner at gcc dot gnu.org
@ 2020-10-24 2:48 ` meissner at gcc dot gnu.org
2020-10-24 3:33 ` amodra at gmail dot com
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: meissner at gcc dot gnu.org @ 2020-10-24 2:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
--- Comment #5 from Michael Meissner <meissner at gcc dot gnu.org> ---
One of my patches for adding IEEE 128-bit long double may help with this
situation. The ibm-ldouble.c module was not being compiled with
-mno-gnu-attributes would affect things if a different long double type was
used:
https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556863.html
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (4 preceding siblings ...)
2020-10-24 2:48 ` meissner at gcc dot gnu.org
@ 2020-10-24 3:33 ` amodra at gmail dot com
2020-10-24 7:06 ` meissner at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: amodra at gmail dot com @ 2020-10-24 3:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
Alan Modra <amodra at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amodra at gmail dot com
--- Comment #6 from Alan Modra <amodra at gmail dot com> ---
(In reply to Peter Bergner from comment #4)
> Something like the attached patch?
No. -mlong-double-128 overrides the configured --without-long-double-128.
--without-long-double-128 doesn't *disable* 128-bit long doubles, it just sets
the default to 64-bit long double.
(In reply to Michael Meissner from comment #5)
Yes, -mno-gnu-attribute makes sense, however it should only apply to files
linked into the shared libgcc, not IMO to files in libgcc.a.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (5 preceding siblings ...)
2020-10-24 3:33 ` amodra at gmail dot com
@ 2020-10-24 7:06 ` meissner at gcc dot gnu.org
2020-10-24 7:32 ` meissner at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: meissner at gcc dot gnu.org @ 2020-10-24 7:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
--- Comment #7 from Michael Meissner <meissner at gcc dot gnu.org> ---
Just to be clear, my patch only turns on -mno-gnu-attributes on compiling
ibm-ldouble.c. That is the module that has the extended IBM 128-bit support in
it.
However, I believe if any module in libgcc_s.so has the IBM extended long
double attributes set, it essentially taints the entire shared library.
At least on 64-bit little endian Linux, it does not use long double at all. It
uses __ibm128 explicitly.
However, t-linux and t-ibm-ldouble both explicitly set -mlong-double-128.
Since long double is explicitly set to 128-bit, it sets the gnu attributes for
__ibm128 (since internally __ibm128 is mapped to long double in this case).
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (6 preceding siblings ...)
2020-10-24 7:06 ` meissner at gcc dot gnu.org
@ 2020-10-24 7:32 ` meissner at gcc dot gnu.org
2020-10-26 19:21 ` segher at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: meissner at gcc dot gnu.org @ 2020-10-24 7:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
--- Comment #8 from Michael Meissner <meissner at gcc dot gnu.org> ---
In addition to ibm-ldouble.c, the following functions set the gnu attribute #4
to 5 (i.e. pass/use IBM extended double as long double):
_divtc3
_fixtfdi
_fixunstfdi
_floatditf
_floatunditf
_multc3
_powitf2
ppc64-fp
This means we have to change the definition of TFmode and TCtype from:
typedef float TFtype __attribute__ ((mode (TF)));
typedef _Complex float TCtype __attribute__ ((mode (TC)));
to:
typedef float TFtype __attribute__ ((mode (IF)));
typedef _Complex float TCtype __attribute__ ((mode (IC)));
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (7 preceding siblings ...)
2020-10-24 7:32 ` meissner at gcc dot gnu.org
@ 2020-10-26 19:21 ` segher at gcc dot gnu.org
2020-12-03 19:52 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: segher at gcc dot gnu.org @ 2020-10-26 19:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
--- Comment #9 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Yes, that looks correct.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (8 preceding siblings ...)
2020-10-26 19:21 ` segher at gcc dot gnu.org
@ 2020-12-03 19:52 ` cvs-commit at gcc dot gnu.org
2020-12-29 13:39 ` gustavowalbon at gmail dot com
2021-01-21 1:41 ` meissner at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-03 19:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Michael Meissner <meissner@gcc.gnu.org>:
https://gcc.gnu.org/g:9f1a6501994a2d18ec4fe2a6664637f48021b210
commit r11-5728-g9f1a6501994a2d18ec4fe2a6664637f48021b210
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Thu Dec 3 14:50:26 2020 -0500
PowerPC: PR libgcc/97543 and libgcc/97643, fix long double issues
If you use a compiler with long double defaulting to 64-bit instead of
128-bit
with IBM extended double, you get linker warnings about mis-matches in the
gnu
attributes for long double (PR libgcc/97543). Even if the compiler is
configured to have long double be 64 bit as the default with the
configuration
option '--without-long-double-128' you get the warnings.
You also get the same issues if you use a compiler with long double
defaulting
to IEEE 128-bit instead of IBM extended double (PR libgcc/97643).
The issue is the way libgcc.a/libgcc.so is built. Right now when building
libgcc under Linux, the long double size is set to 128-bits when building
libgcc. However, the gnu attributes are set, leading to the warnings.
One feature of the current GNU attribute implementation is if you have a
shared
library (such as libgcc_s.so), the GNU attributes for the shared library is
an
inclusive OR of all of the objects within the library. This means if any
object file that uses the -mlong-double-128 option and uses long double,
the GNU
attributes for the library will indicate that it uses 128-bit IBM long
doubles. If you have a static library, you will get the warning only if
you
actually reference an object file with the attribute set.
This patch does two things:
1) All of the object files that support IBM 128-bit long doubles
explicitly set the ABI to IBM extended double.
2) I turned off GNU attributes for building the shared library or for
building the IBM 128-bit long double support.
libgcc/
2020-12-03 Michael Meissner <meissner@linux.ibm.com>
PR libgcc/97543
PR libgcc/97643
* config/rs6000/t-linux (IBM128_STATIC_OBJS): New make variable.
(IBM128_SHARED_OBJS): New make variable.
(IBM128_OBJS): New make variable. Set all objects to use the
explicit IBM format, and disable gnu attributes.
(IBM128_CFLAGS): New make variable.
(gcc_s_compile): Add -mno-gnu-attribute to all shared library
modules.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (9 preceding siblings ...)
2020-12-03 19:52 ` cvs-commit at gcc dot gnu.org
@ 2020-12-29 13:39 ` gustavowalbon at gmail dot com
2021-01-21 1:41 ` meissner at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: gustavowalbon at gmail dot com @ 2020-12-29 13:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
--- Comment #11 from Gustavo Walbon <gustavowalbon at gmail dot com> ---
Michael,
Works with GCC v10.
I backported this patch for the Alpine[1] gcc v10 and then I used the libgcc
package to test. I have used the binutils v2.35.1 with the warning of the GNU
Attribute and the patch doesn't show the warning.
1 -
https://github.com/walbon/aports/commit/f188c0b799df8550c595d6a94ffc6dab0254d11a
Thanks Michael
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcc/97543] powerpc64le: libgcc has unexpected long double in .gnu_attribute
2020-10-23 13:32 [Bug libgcc/97543] New: powerpc64le: libgcc has unexpected long double in .gnu_attribute tuliom at ascii dot art.br
` (10 preceding siblings ...)
2020-12-29 13:39 ` gustavowalbon at gmail dot com
@ 2021-01-21 1:41 ` meissner at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: meissner at gcc dot gnu.org @ 2021-01-21 1:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97543
Michael Meissner <meissner at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Michael Meissner <meissner at gcc dot gnu.org> ---
Back port to GCC 10 done on January 20th, 2021. Bug closed.
^ permalink raw reply [flat|nested] 13+ messages in thread