[PATCH] s390x: Require GCC 7.1 or later to build glibc.

Stefan Liebler stli@linux.ibm.com
Fri Dec 18 09:08:39 GMT 2020


On 12/17/20 6:35 PM, Adhemerval Zanella wrote:
> On 15/12/2020 11:18, Stefan Liebler via Libc-alpha wrote:
>> GCC 6.5 fails to correctly build ldconfig with recent ld.so.cache
>> commits, e.g.:
>> 785969a047ad2f23f758901c6816422573544453
>> elf: Implement a string table for ldconfig, with tail merging
>>
>> If glibc is build with gcc 6.5.0:
>> __builtin_add_overflow is used in
>> <glibc>/elf/stringtable.c:stringtable_finalize()
>> which leads to ldconfig failing with "String table is too large".
>> This is also recognizable in following tests:
>> FAIL: elf/tst-glibc-hwcaps-cache
>> FAIL: elf/tst-glibc-hwcaps-prepend-cache
>> FAIL: elf/tst-ldconfig-X
>> FAIL: elf/tst-ldconfig-bad-aux-cache
>> FAIL: elf/tst-ldconfig-ld_so_conf-update
>> FAIL: elf/tst-stringtable
>>
>> See gcc "Bug 98269 - gcc 6.5.0 __builtin_add_overflow() with small
>> uint32_t values incorrectly detects overflow"
>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269)
> 
> I don't have a strong preference, but one option would be to add a
> workaround on include/intprops.h and use INT_ADD_OVERFLOW instead
> (it should use __builtins where appropriated). 
As __builtin_add_overflow is also used at other places, I would prefer
to exclude gcc 6.5.0.

A side information:
Currently <glibc>/configure.ac is requiring gcc 6.2 and there are others
archs which already require more recent gcc version.

> 
> In any case, it would be good to alert gnulib developers about this
> potential issue.
I've sent an email to bug-gnulib@gnu.org:
https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00152.html

> 
> From the bug report, it seems that only s390 is affected, right?
> 
As far as I know, yes. I've asked Florian, but he has not recognized
such an error on other archs. Andreas has mentioned two gcc commits:

"The failure disappears with:"
gcc commit "S/390: Add support for z13 instructions lochi and locghi."
https://gcc.gnu.org/git/?p=gcc.git&a=commit;h=bf7499197fbb065123257c374064f6bb715c951b
"But that one only hides the problem."

"Reverting the patch and continue bisecting. The failure finally
disappears with:"
gcc commit "re PR rtl-optimization/78559 (wrong code due to tree
if-conversion?)"
https://gcc.gnu.org/git/?p=gcc.git&a=commit;h=3f54004b095d1cd513e63753ee0f8f9f13698347

Thanks,
Stefan


More information about the Libc-alpha mailing list