ppc64le: gcc 12 vs -mabi=ibmlongdouble

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Jan 24 17:37:15 GMT 2022



On 24/01/2022 12:38, Florian Weimer via Libc-alpha wrote:
> * DJ Delorie via Libc-alpha:
> 
>> I've been working on updating glibc for Fedora Rawhide, and have
>> stumbled upon this issue (after working around the -Wuse-after-free
>> issues with a cflags hack)...  A few of the math tests explicitly add
>> -mlong-double-64 but configure adds -mabi=ibmlongdouble
>>
>> I would guess that we need a "CFLAGS -= -mabi=ibmlongdouble" in all
>> the places we add -mlong-double-64 but I don't see an easy way of
>> doing that, nor am I sure that's a valid solution.  Alternately, gcc
>> could be changed to accept the conflicting flags in a meaningful way,
>> if there is one.  Is there an -mabi= that undoes the
>> -mabi=ibmlongdouble that we can just add to the -mlong-double-64 flag
>> lines?
> 
>> cc1: error: '-mabi=ibmlongdouble' requires '-mlong-double-128'
> 
> I was able to reproduce with a GCC 12 build configured using
> --with-long-double-format=ieee.
> 
> I tried the attached patch to remove the unwanted -mabi=ibmlongdouble,
> but it does not work: it removes CFLAGS-*.c processing as a side effect.
> 
> Any suggestions how we can fix this properly?

I think we will need add a concept of CFLAGS to build glibc itself and CFLAGS 
to build tests regarding ABI.  The '-mabi=ibmlongdouble' will
be added only libraries.

On sysdeps/powerpc/powerpc64/le/Makefile, add type-ldouble-CFLAGS but filtering
out $(tests), $(tests-internal), $(xtests), $(test-srcs), $(tests-time64),
and  $(xtests-time64) (maybe add a new rule to add all tests) and then 
add the required on each tests (we might know the default from configure,
but I think it would be simple to always add the long double abi flags).


More information about the Libc-alpha mailing list