We see
FAIL: 17_intro/headers/c++1998/all_attributes.cc (test for excess errors)
FAIL: 17_intro/headers/c++2011/all_attributes.cc (test for excess errors)
FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
FAIL: 17_intro/headers/c++2017/all_attributes.cc (test for excess errors)
FAIL: 17_intro/headers/c++2020/all_attributes.cc (test for excess errors)
FAIL: 17_intro/names.cc -std=gnu++17 (test for excess errors)
on s390x-linux.
The first 5 are due to kernel-headers not using uglified attribute names,
where <asm/types.h> contains
__attribute__((packed, aligned(4)))
I've filed a downstream bugreport for this in
https://bugzilla.redhat.com/show_bug.cgi?id=
2276084
(not really sure where to report kernel-headers issues upstream), while the
last one is due to <sys/ucontext.h> from glibc containing:
#ifdef __USE_MISC
# define __ctx(fld) fld
#else
# define __ctx(fld) __ ## fld
#endif
...
typedef union
{
double __ctx(d);
float __ctx(f);
} fpreg_t;
and g++ predefining -D_GNU_SOURCE which implies define __USE_MISC.
The following patch adds a workaround for this on the libstdc++ testsuite
side.
2024-04-22 Jakub Jelinek <jakub@redhat.com>
* testsuite/17_intro/names.cc (d, f): Undefine on s390*-linux*.
* testsuite/17_intro/headers/c++1998/all_attributes.cc (packed): Don't
define on s390.
* testsuite/17_intro/headers/c++2011/all_attributes.cc (packed):
Likewise.
* testsuite/17_intro/headers/c++2014/all_attributes.cc (packed):
Likewise.
* testsuite/17_intro/headers/c++2017/all_attributes.cc (packed):
Likewise.
* testsuite/17_intro/headers/c++2020/all_attributes.cc (packed):
Likewise.
(cherry picked from commit
cf5f7791056b3ed993bc8024be767a86157514a9)
# define noreturn 1
# define visibility 1
#endif
+#ifndef __s390__
+// kernel-headers <asm/types.h> uses __attribute__((packed,aligned(4))) on
+// S390.
#define packed 1
+#endif
#define pure 1
// glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM.
#ifndef __arm__
# define visibility 1
#endif
#define no_unique_address 1
+#ifndef __s390__
+// kernel-headers <asm/types.h> uses __attribute__((packed,aligned(4))) on
+// S390.
#define packed 1
+#endif
#define pure 1
// glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM.
#ifndef __arm__
# define visibility 1
#endif
#define no_unique_address 1
+#ifndef __s390__
+// kernel-headers <asm/types.h> uses __attribute__((packed,aligned(4))) on
+// S390.
#define packed 1
+#endif
#define pure 1
// glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM.
#ifndef __arm__
# define visibility 1
#endif
#define no_unique_address 1
+#ifndef __s390__
+// kernel-headers <asm/types.h> uses __attribute__((packed,aligned(4))) on
+// S390.
#define packed 1
+#endif
#define pure 1
// glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM.
#ifndef __arm__
# define cold 1
# define visibility 1
#endif
+#ifndef __s390__
+// kernel-headers <asm/types.h> uses __attribute__((packed,aligned(4))) on
+// S390.
#define packed 1
+#endif
#define pure 1
// glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM.
#ifndef __arm__
#undef u
#endif
+#if defined (__linux__) && defined (__s390__)
+// <sys/ucontext.h> defines fpreg_t::d and fpreg_t::f
+#undef d
+#undef f
+#endif
+
#if defined (__linux__) && defined (__sparc__)
#undef y
#endif