[PATCH] build-many-glibcs.py: Add some s390x glibc variants.

Stefan Liebler stli@linux.ibm.com
Mon Aug 10 15:34:31 GMT 2020


On 8/6/20 10:34 AM, Florian Weimer wrote:
> * Stefan Liebler:
> 
>> On 8/5/20 5:39 PM, Florian Weimer wrote:
>>> * Stefan Liebler via Libc-alpha:
>>>
>>>> There is a s390x configure check which checks the architecture level set.
>>>>
>>>> This ALS influences e.g. which ifunc variants are needed or which one is
>>>> the default variant or if the symbol will be an ifunc-symbol at all.
>>>>
>>>> The ALS also enables to use the gcc builtins for e.g. the round function
>>>> in libm and others.
>>>>
>>>> Therefore this patch adds some glibc variants which are using different
>>>> architecture level sets for s390x.
>>>
>>> Do these additional build targets actually result in build breakage?
> 
>> I've run the script with those new extra-glibcs and all passed.
> 
> Sorry, this is not what I meant.  Let me rephrase.
> 
> There is some cost to adding more targets to build-many-glibcs.py.  I
> think we should focus on targets where we see breakage due to generic
> tree-wide changes.  This means coverage of all ABIs, and ABI variants
> which have different toolchain exposure (e.g., PIE, restricted machine
> code output with verification in binutils).
> 
> Or put different, if we don't see build breakage with -march=z10 like
> *ever*, then it does not make sense to build a variant for this.
> 
> Thanks,
> Florian
> 
Okay. Then I won't add the march extra-glibcs.

But I've just tried to add a "s390x -O3" extra-glibc as you've suggested
before:
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 325591b2c6..b0fb36ba15 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -365,7 +365,9 @@ class Context(object):
         self.add_config(arch='s390x',
                         os_name='linux-gnu',
                         glibcs=[{},
-                                {'arch': 's390', 'ccopts': '-m31'}])
+                                {'arch': 's390', 'ccopts': '-m31'}],
+                        extra_glibcs=[{'variant': 'O3',
+                                       'ccopts': '-O3'}])


But unfortunately, "make check" fails with:
FAIL: conform/XPG4/stdio.h/conform
FAIL: conform/XPG42/stdio.h/conform
...
PASSCOMBINED: Availability of variable optopt
PASSCOMBINED: Type of variable optopt
    Namespace violation: "getc_unlocked"
    Namespace violation: "getchar_unlocked"
    Namespace violation: "putc_unlocked"
    Namespace violation: "putchar_unlocked"
FAIL: Namespace of <stdio.h>
----------------------------------------------------------------------------
  Total number of tests   :  168
  Number of failed tests  :    1
  Number of xfailed tests :    0
  Number of skipped tests :    0

Here, conformtest.py is running something like this:
echo "#include <stdio.h>" > tst.c
s390x-glibc-linux-gnu-gcc -O3 -I../include ...  -I.. -fno-builtin -ansi
-D_XOPEN_SOURCE -D_ISOMAC -E tst.c -P -Wp,-dN
=> The output contains the __USE_EXTERN_INLINES from
<glibc>/libio/bits/stdio.h for getc_unlocked, getchar_unlocked,
putc_unlocked and putchar_unlocked.

<glibc>/conform/data/stdio.h-data contains:
#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined
XOPEN2K8 || defined POSIX2008
function int getc_unlocked (FILE*)
function int getchar_unlocked (void)
#endif
#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined
XOPEN2K8 || defined POSIX2008
function int putc_unlocked (int, FILE*)
function int putchar_unlocked (int)
#endif

FAIL: conform/POSIX2008/sys/stat.h/conform
...
PASSCOMBINED: Availability of function utimensat
PASSCOMBINED: Type of function utimensat
    Namespace violation: "mknodat"
FAIL: Namespace of <sys/stat.h>
----------------------------------------------------------------------------
  Total number of tests   :   97
  Number of failed tests  :    1
  Number of xfailed tests :    0
  Number of skipped tests :    0
=> Similar to above, the __USE_EXTERN_INLINES for mknodat is included.


Is there a reason, why ...
- scripts/build-many-glibcs.py configures glibc with
CC="<target-triple>-gcc <ccopts>" instead of CC="<target-triple>-gcc"
CFLAGS="<ccopts>" CXX/CXXFLAGS? If build-many-glibcs.py is configuring
the glibc with the FLAGS, the the "make check" for the O3 extra-glibc is
passing.

- conform/conformtest.py is called without the configured CFLAGS and
thus without optimization? I assume one reason is -Wall -Werror.

Bye
Stefan


More information about the Libc-alpha mailing list