Hi all,
glibc in CentOS 7 aarch64 has a bug: see https://bugs.launchpad.net/linaro-aarch64/+bug/1169164. Including signal.h causes the following symbols to be defined (they are actually in ptrace.h but signal.h includes it):
#define PSR_MODE_EL0t 0x00000000 #define PSR_MODE_EL1t 0x00000004 #define PSR_MODE_EL1h 0x00000005 #define PSR_MODE_EL2t 0x00000008 #define PSR_MODE_EL2h 0x00000009 #define PSR_MODE_EL3t 0x0000000c #define PSR_MODE_EL3h 0x0000000d #define PSR_MODE_MASK 0x0000000f
The presence of these symbols causes build failures of some Xen userspace applications, because they clash with the same symbols there. signal.h is POSIX so is restricted in what namespace is permitted to claim.
Glibc has been fixed a while back: https://sourceware.org/ml/libc-alpha/2014-05/msg00327.html. The commit is the following:
commit 7d05a8168b45c0580e1f9a79c2dd26c8f0d31fca Author: Yvan Roux yvan.roux@linaro.org Date: Tue May 20 13:45:22 2014 +0100
AArch64: Remove asm/ptrace.h inclusion in sys/user.h and sys/procfs.h
It fixes the problem by removing the inclusion of ptrace.h from two other headers. The change allows Xen and any other applications which define PSR_MODE_ symbols to build appropriately. Nothing else should be affected.
Any chances we can have that patch in the CentOS 7 aarch64 glibc?
Thanks,
Stefano
On 10/13/2015 05:13 AM, Stefano Stabellini wrote:
Any chances we can have that patch in the CentOS 7 aarch64 glibc?
I'll take a look at including it, if you'd be willing to test it out before we consider pushing it as an update.
On Tue, 13 Oct 2015, Jim Perrin wrote:
On 10/13/2015 05:13 AM, Stefano Stabellini wrote:
Any chances we can have that patch in the CentOS 7 aarch64 glibc?
I'll take a look at including it, if you'd be willing to test it out before we consider pushing it as an update.
sure
On 10/13/2015 03:47 PM, Jim Perrin wrote:
On 10/13/2015 05:13 AM, Stefano Stabellini wrote:
Any chances we can have that patch in the CentOS 7 aarch64 glibc?
I'll take a look at including it, if you'd be willing to test it out before we consider pushing it as an update.
This patch does not apply to our existing glibc package as there is no sysdeps/unix/sysv/linux/aarch64/* to update. If you can come up with a patch that addresses the issue you're trying to fix, we can give it a shot.
On Wed, 14 Oct 2015, Jim Perrin wrote:
On 10/13/2015 03:47 PM, Jim Perrin wrote:
On 10/13/2015 05:13 AM, Stefano Stabellini wrote:
Any chances we can have that patch in the CentOS 7 aarch64 glibc?
I'll take a look at including it, if you'd be willing to test it out before we consider pushing it as an update.
This patch does not apply to our existing glibc package as there is no sysdeps/unix/sysv/linux/aarch64/* to update. If you can come up with a patch that addresses the issue you're trying to fix, we can give it a shot.
The same code leaves under ports/ in our glibc package. I have prepended ports/ in the patch filenames (see below) and it works fine.
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h index b02af8a..211227c 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h @@ -33,17 +33,6 @@ #include <sys/types.h> #include <sys/user.h>
-/* We need to see the definition of struct pt_regs but do not want the - linux PTRACE_* defines since they conflict with the generic eglibc - definitions in sys/ptrace.h Hence the undef's below. */ -#include <asm/ptrace.h> - -#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS - -#include <sys/user.h> - __BEGIN_DECLS
/* Type for a general-purpose register. */ @@ -53,11 +42,11 @@ typedef unsigned long elf_greg_t; pt_regs' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_pt_regs) / sizeof(elf_greg_t)) +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */ -typedef struct user_fpsimd_state elf_fpregset_t; +typedef struct user_fpsimd_struct elf_fpregset_t;
/* Signal info. */ struct elf_siginfo diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h index eceeb38..0ca2715 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h @@ -19,13 +19,19 @@ #ifndef _SYS_USER_H #define _SYS_USER_H 1
-/* We need to see the definition of struct pt_regs but do not want the - linux PTRACE_* defines since they conflict with the generic glibc - definitions in sys/ptrace.h Hence the undef's below. */ -#include <asm/ptrace.h> - -#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS +struct user_regs_struct +{ + unsigned long long regs[31]; + unsigned long long sp; + unsigned long long pc; + unsigned long long pstate; +}; + +struct user_fpsimd_struct +{ + __uint128_t vregs[32]; + unsigned int fpsr; + unsigned int fpcr; +};
#endif
Yup. this one works. I'll have a build for you to test early monday.
On 10/15/2015 12:15 PM, Stefano Stabellini wrote:
On Wed, 14 Oct 2015, Jim Perrin wrote:
On 10/13/2015 03:47 PM, Jim Perrin wrote:
On 10/13/2015 05:13 AM, Stefano Stabellini wrote:
Any chances we can have that patch in the CentOS 7 aarch64 glibc?
I'll take a look at including it, if you'd be willing to test it out before we consider pushing it as an update.
This patch does not apply to our existing glibc package as there is no sysdeps/unix/sysv/linux/aarch64/* to update. If you can come up with a patch that addresses the issue you're trying to fix, we can give it a shot.
The same code leaves under ports/ in our glibc package. I have prepended ports/ in the patch filenames (see below) and it works fine.
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h index b02af8a..211227c 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h @@ -33,17 +33,6 @@ #include <sys/types.h> #include <sys/user.h>
-/* We need to see the definition of struct pt_regs but do not want the
- linux PTRACE_* defines since they conflict with the generic eglibc
- definitions in sys/ptrace.h Hence the undef's below. */
-#include <asm/ptrace.h>
-#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS
-#include <sys/user.h>
__BEGIN_DECLS
/* Type for a general-purpose register. */ @@ -53,11 +42,11 @@ typedef unsigned long elf_greg_t; pt_regs' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_pt_regs) / sizeof(elf_greg_t)) +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */ -typedef struct user_fpsimd_state elf_fpregset_t; +typedef struct user_fpsimd_struct elf_fpregset_t;
/* Signal info. */ struct elf_siginfo diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h index eceeb38..0ca2715 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h @@ -19,13 +19,19 @@ #ifndef _SYS_USER_H #define _SYS_USER_H 1
-/* We need to see the definition of struct pt_regs but do not want the
- linux PTRACE_* defines since they conflict with the generic glibc
- definitions in sys/ptrace.h Hence the undef's below. */
-#include <asm/ptrace.h>
-#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS +struct user_regs_struct +{
- unsigned long long regs[31];
- unsigned long long sp;
- unsigned long long pc;
- unsigned long long pstate;
+};
+struct user_fpsimd_struct +{
- __uint128_t vregs[32];
- unsigned int fpsr;
- unsigned int fpcr;
+};
#endif
Fantastic, thank you!
On Fri, 16 Oct 2015, Jim Perrin wrote:
Yup. this one works. I'll have a build for you to test early monday.
On 10/15/2015 12:15 PM, Stefano Stabellini wrote:
On Wed, 14 Oct 2015, Jim Perrin wrote:
On 10/13/2015 03:47 PM, Jim Perrin wrote:
On 10/13/2015 05:13 AM, Stefano Stabellini wrote:
Any chances we can have that patch in the CentOS 7 aarch64 glibc?
I'll take a look at including it, if you'd be willing to test it out before we consider pushing it as an update.
This patch does not apply to our existing glibc package as there is no sysdeps/unix/sysv/linux/aarch64/* to update. If you can come up with a patch that addresses the issue you're trying to fix, we can give it a shot.
The same code leaves under ports/ in our glibc package. I have prepended ports/ in the patch filenames (see below) and it works fine.
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h index b02af8a..211227c 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h @@ -33,17 +33,6 @@ #include <sys/types.h> #include <sys/user.h>
-/* We need to see the definition of struct pt_regs but do not want the
- linux PTRACE_* defines since they conflict with the generic eglibc
- definitions in sys/ptrace.h Hence the undef's below. */
-#include <asm/ptrace.h>
-#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS
-#include <sys/user.h>
__BEGIN_DECLS
/* Type for a general-purpose register. */ @@ -53,11 +42,11 @@ typedef unsigned long elf_greg_t; pt_regs' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_pt_regs) / sizeof(elf_greg_t)) +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */ -typedef struct user_fpsimd_state elf_fpregset_t; +typedef struct user_fpsimd_struct elf_fpregset_t;
/* Signal info. */ struct elf_siginfo diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h index eceeb38..0ca2715 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h @@ -19,13 +19,19 @@ #ifndef _SYS_USER_H #define _SYS_USER_H 1
-/* We need to see the definition of struct pt_regs but do not want the
- linux PTRACE_* defines since they conflict with the generic glibc
- definitions in sys/ptrace.h Hence the undef's below. */
-#include <asm/ptrace.h>
-#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS +struct user_regs_struct +{
- unsigned long long regs[31];
- unsigned long long sp;
- unsigned long long pc;
- unsigned long long pstate;
+};
+struct user_fpsimd_struct +{
- __uint128_t vregs[32];
- unsigned int fpsr;
- unsigned int fpcr;
+};
#endif
-- Jim Perrin The CentOS Project | http://www.centos.org twitter: @BitIntegrity | GPG Key: FA09AD77
Give this a shot -> http://people.centos.org/jperrin/glibc/2.17-79.el7/
On 10/16/2015 11:19 AM, Stefano Stabellini wrote:
Fantastic, thank you!
On Fri, 16 Oct 2015, Jim Perrin wrote:
Yup. this one works. I'll have a build for you to test early monday.
On 10/15/2015 12:15 PM, Stefano Stabellini wrote:
On Wed, 14 Oct 2015, Jim Perrin wrote:
On 10/13/2015 03:47 PM, Jim Perrin wrote:
On 10/13/2015 05:13 AM, Stefano Stabellini wrote:
Any chances we can have that patch in the CentOS 7 aarch64 glibc?
I'll take a look at including it, if you'd be willing to test it out before we consider pushing it as an update.
This patch does not apply to our existing glibc package as there is no sysdeps/unix/sysv/linux/aarch64/* to update. If you can come up with a patch that addresses the issue you're trying to fix, we can give it a shot.
The same code leaves under ports/ in our glibc package. I have prepended ports/ in the patch filenames (see below) and it works fine.
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h index b02af8a..211227c 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h @@ -33,17 +33,6 @@ #include <sys/types.h> #include <sys/user.h>
-/* We need to see the definition of struct pt_regs but do not want the
- linux PTRACE_* defines since they conflict with the generic eglibc
- definitions in sys/ptrace.h Hence the undef's below. */
-#include <asm/ptrace.h>
-#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS
-#include <sys/user.h>
__BEGIN_DECLS
/* Type for a general-purpose register. */ @@ -53,11 +42,11 @@ typedef unsigned long elf_greg_t; pt_regs' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_pt_regs) / sizeof(elf_greg_t)) +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */ -typedef struct user_fpsimd_state elf_fpregset_t; +typedef struct user_fpsimd_struct elf_fpregset_t;
/* Signal info. */ struct elf_siginfo diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h index eceeb38..0ca2715 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h @@ -19,13 +19,19 @@ #ifndef _SYS_USER_H #define _SYS_USER_H 1
-/* We need to see the definition of struct pt_regs but do not want the
- linux PTRACE_* defines since they conflict with the generic glibc
- definitions in sys/ptrace.h Hence the undef's below. */
-#include <asm/ptrace.h>
-#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS +struct user_regs_struct +{
- unsigned long long regs[31];
- unsigned long long sp;
- unsigned long long pc;
- unsigned long long pstate;
+};
+struct user_fpsimd_struct +{
- __uint128_t vregs[32];
- unsigned int fpsr;
- unsigned int fpcr;
+};
#endif
-- Jim Perrin The CentOS Project | http://www.centos.org twitter: @BitIntegrity | GPG Key: FA09AD77
Works fine, thanks!
On Mon, 19 Oct 2015, Jim Perrin wrote:
Give this a shot -> http://people.centos.org/jperrin/glibc/2.17-79.el7/
On 10/16/2015 11:19 AM, Stefano Stabellini wrote:
Fantastic, thank you!
On Fri, 16 Oct 2015, Jim Perrin wrote:
Yup. this one works. I'll have a build for you to test early monday.
On 10/15/2015 12:15 PM, Stefano Stabellini wrote:
On Wed, 14 Oct 2015, Jim Perrin wrote:
On 10/13/2015 03:47 PM, Jim Perrin wrote:
On 10/13/2015 05:13 AM, Stefano Stabellini wrote:
> Any chances we can have that patch in the CentOS 7 aarch64 glibc?
I'll take a look at including it, if you'd be willing to test it out before we consider pushing it as an update.
This patch does not apply to our existing glibc package as there is no sysdeps/unix/sysv/linux/aarch64/* to update. If you can come up with a patch that addresses the issue you're trying to fix, we can give it a shot.
The same code leaves under ports/ in our glibc package. I have prepended ports/ in the patch filenames (see below) and it works fine.
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h index b02af8a..211227c 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h @@ -33,17 +33,6 @@ #include <sys/types.h> #include <sys/user.h>
-/* We need to see the definition of struct pt_regs but do not want the
- linux PTRACE_* defines since they conflict with the generic eglibc
- definitions in sys/ptrace.h Hence the undef's below. */
-#include <asm/ptrace.h>
-#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS
-#include <sys/user.h>
__BEGIN_DECLS
/* Type for a general-purpose register. */ @@ -53,11 +42,11 @@ typedef unsigned long elf_greg_t; pt_regs' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_pt_regs) / sizeof(elf_greg_t)) +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Register set for the floating-point registers. */ -typedef struct user_fpsimd_state elf_fpregset_t; +typedef struct user_fpsimd_struct elf_fpregset_t;
/* Signal info. */ struct elf_siginfo diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h index eceeb38..0ca2715 100644 --- a/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h +++ b/ports/sysdeps/unix/sysv/linux/aarch64/sys/user.h @@ -19,13 +19,19 @@ #ifndef _SYS_USER_H #define _SYS_USER_H 1
-/* We need to see the definition of struct pt_regs but do not want the
- linux PTRACE_* defines since they conflict with the generic glibc
- definitions in sys/ptrace.h Hence the undef's below. */
-#include <asm/ptrace.h>
-#undef PTRACE_GET_THREAD_AREA -#undef PTRACE_GETHBPREGS -#undef PTRACE_SETHBPREGS +struct user_regs_struct +{
- unsigned long long regs[31];
- unsigned long long sp;
- unsigned long long pc;
- unsigned long long pstate;
+};
+struct user_fpsimd_struct +{
- __uint128_t vregs[32];
- unsigned int fpsr;
- unsigned int fpcr;
+};
#endif
-- Jim Perrin The CentOS Project | http://www.centos.org twitter: @BitIntegrity | GPG Key: FA09AD77
-- Jim Perrin The CentOS Project | http://www.centos.org twitter: @BitIntegrity | GPG Key: FA09AD77