Skip to contentSkip to conversation

glibc: bump to 2.26

PATCH Superseded Romain Naour 4 participants 28 messages Sep 23, 2017 – Oct 16, 2017

lore
Share & tools
lore
#0 lore raw

v3 cover glibc: bump to 2.26

This series bump glibc to the latest release and allow to remove all patches required for the previous version! But glibc come with some new issue that are hopefully already fixed in the 2.26.x stable branch.

While testing this new version, some build issues has been dicovered. Two gcc patch are needed to build a toolchain with older compiler (gcc 4.9 to 6.4), gcc 7.2 contain already the fix.

Backport a series related to bug 21930 and 22146. Without them the float128 support break the C++ build for some packages.

https://sourceware.org/bugzilla/show_bug.cgi?id=21930
https://sourceware.org/bugzilla/show_bug.cgi?id=22146

This third series is for testing and review. Let's hope that glibc 2.26.1 will be released soon :)

Best regards,
Romain

Romain Naour (7):
package/gcc: fix build issue with glibc 2.26 package/gcc: fix build issue with glibc 2.26 package/glibc: needs kernel headers >= 3.10 on powerpc64le package/gcc: enable float128 on powerpc64le with glibc >= 2.26
toolchains
package/diffutils: disable getopt_long replacement with glibc package/flex: disable reallocarray
package/glibc: bump to 2.26

 package/diffutils/diffutils.mk                     |   6 +
 package/flex/flex.mk                               |   3 +-
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 190 ++++++++++++
 package/gcc/4.9.4/944-sanitizer-linux.patch        |  88 ++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++
 package/gcc/5.4.0/944-sanitizer-linux.patch        |  91 ++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++
 package/gcc/6.4.0/943-sanitizer-linux.patch        |  91 ++++++
 package/gcc/Config.in.host                         |   4 +
 package/gcc/gcc.mk                                 |   8 +
 ...__builtin_types_compatible_p-in-C-mode-bu.patch |  50 ++++
 .../glibc/0001-sh-Fix-building-with-gcc5-6.patch   |  56 ----
 ...00366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch |  35 ---
 ...02-Do-not-use-generic-selection-in-C-mode.patch |  56 ++++
 ...-version-of-issignaling-that-does-not-use.patch | 225 +++++++++++++++
 ...ject-overly-long-LD_PRELOAD-path-elements.patch | 122 --------
 ...ersion-of-issignaling-when-__NO_LONG_DOUB.patch |  47 +++
 ...Reject-overly-long-LD_AUDIT-path-elements.patch | 204 -------------
 ...-version-of-iszero-that-does-not-use-__MA.patch | 210 ++++++++++++++
 package/glibc/0005-fix-binutils-2-29-build.patch   |  65 -----
 ...ify-use-the-builtin-when-optimizing-for-s.patch |  63 ++++
 ...g-IS_IN-libc-guards-to-vectorized-strcspn.patch |  47 ---
 package/glibc/0006-sh4-trap.patch                  | 318 ---------------------
 package/glibc/glibc.hash                           |   2 +-
 package/glibc/glibc.mk                             |   2 +-
 toolchain/toolchain-buildroot/Config.in            |   6 +
 26 files changed, 1523 insertions(+), 850 deletions(-)
 create mode 100644 package/gcc/4.9.4/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/4.9.4/944-sanitizer-linux.patch
 create mode 100644 package/gcc/5.4.0/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/5.4.0/944-sanitizer-linux.patch
 create mode 100644 package/gcc/6.4.0/942-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/6.4.0/943-sanitizer-linux.patch
 create mode 100644 package/glibc/0001-Do-not-use-__builtin_types_compatible_p-in-C-mode-bu.patch
 delete mode 100644 package/glibc/0001-sh-Fix-building-with-gcc5-6.patch
 delete mode 100644 package/glibc/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
 create mode 100644 package/glibc/0002-Do-not-use-generic-selection-in-C-mode.patch
 create mode 100644 package/glibc/0003-Provide-a-C-version-of-issignaling-that-does-not-use.patch
 delete mode 100644 package/glibc/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
 create mode 100644 package/glibc/0004-Fix-the-C-version-of-issignaling-when-__NO_LONG_DOUB.patch
 delete mode 100644 package/glibc/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch
 create mode 100644 package/glibc/0005-Provide-a-C-version-of-iszero-that-does-not-use-__MA.patch
 delete mode 100644 package/glibc/0005-fix-binutils-2-29-build.patch
 create mode 100644 package/glibc/0006-Let-fpclassify-use-the-builtin-when-optimizing-for-s.patch
 delete mode 100644 package/glibc/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch
 delete mode 100644 package/glibc/0006-sh4-trap.patch
Signature · 1 line
2.9.5
#1 lore raw

PATCH v3 1/7 package/gcc: fix build issue with glibc 2.26

In file included from ../../../libgcc/unwind-dw2.c:403:0:
./md-unwind-support.h: In function ??aarch64_fallback_frame_state??:
./md-unwind-support.h:58:21: error: field ??uc?? has incomplete type

     struct ucontext uc;
                     ^~

The fix is already included in gcc 7.2 release [1]. We have to backport it to all older gcc release since it's not included in any stable release yet.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=14c2f22a1877f6b60a2f7c2f83ffb032759456a6

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

---
v3: use upstream commit for gcc 5 and 6. (Yann)

---
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 190 ++++++++++++++++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++++++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++++++++++
 3 files changed, 574 insertions(+)
 create mode 100644 package/gcc/4.9.4/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/5.4.0/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/6.4.0/942-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
package/gcc/4.9.4/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +190 -0
new file mode 100644
index 0000000..526346c
@@ -0,0 +1,190 @@
+From b7e85069238c40eae54d0ca03ab6d5470d1815f9 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 4 Jul 2017 10:25:10 +0000
+Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules.  This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead.  This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead.  As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Tested compilation together with current glibc with glibc's
+build-many-glibcs.py.
+
+	* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+	config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+	config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+	config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+	x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+	uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+	config/pa/linux-unwind.h (pa32_fallback_frame_state),
+	config/sh/linux-unwind.h (sh_fallback_frame_state),
+	config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+	config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+	ucontext_t instead of struct ucontext.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch at 249958 138bc75d-0d04-0410-961f-82ee72b054a4
+[Romain backport from gcc-5-branch]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libgcc/config/aarch64/linux-unwind.h | 2 +-
+ libgcc/config/alpha/linux-unwind.h   | 2 +-
+ libgcc/config/bfin/linux-unwind.h    | 2 +-
+ libgcc/config/i386/linux-unwind.h    | 4 ++--
+ libgcc/config/m68k/linux-unwind.h    | 2 +-
+ libgcc/config/nios2/linux-unwind.h   | 2 +-
+ libgcc/config/pa/linux-unwind.h      | 2 +-
+ libgcc/config/sh/linux-unwind.h      | 2 +-
+ libgcc/config/tilepro/linux-unwind.h | 2 +-
+ libgcc/config/xtensa/linux-unwind.h  | 2 +-
+ 10 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
+index 6b5b3cd..d13dc34 100644
+--- a/libgcc/config/aarch64/linux-unwind.h
++++ b/libgcc/config/aarch64/linux-unwind.h
+@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe
+   {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   };
+ 
+   struct rt_sigframe *rt_;
+diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
+index b5bfd1c..166d3d2 100644
+--- a/libgcc/config/alpha/linux-unwind.h
++++ b/libgcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
+index dc58f0a..8b94568 100644
+--- a/libgcc/config/bfin/linux-unwind.h
++++ b/libgcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
+index 7986928..a9d621c 100644
+--- a/libgcc/config/i386/linux-unwind.h
++++ b/libgcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
+index 1ba2a0c4..d67767e 100644
+--- a/libgcc/config/m68k/linux-unwind.h
++++ b/libgcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
+index ba4bd80..8978868 100644
+--- a/libgcc/config/nios2/linux-unwind.h
++++ b/libgcc/config/nios2/linux-unwind.h
+@@ -38,7 +38,7 @@ struct nios2_mcontext {
+ 
+ struct nios2_ucontext {
+   unsigned long uc_flags;
+-  struct ucontext *uc_link;
++  ucontext_t *uc_link;
+   stack_t uc_stack;
+   struct nios2_mcontext uc_mcontext;
+   sigset_t uc_sigmask;	/* mask last for extensibility */
+diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
+index 4a3cfff..d2ac437 100644
+--- a/libgcc/config/pa/linux-unwind.h
++++ b/libgcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
+index 4875706..671bde7 100644
+--- a/libgcc/config/sh/linux-unwind.h
++++ b/libgcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
+index 27481cf..c24d58c 100644
+--- a/libgcc/config/tilepro/linux-unwind.h
++++ b/libgcc/config/tilepro/linux-unwind.h
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe {
+     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* Return if this is not a signal handler.  */
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 6832d0b..cb15b4c 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -63,7 +63,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
+-- 
+2.9.5
+
package/gcc/5.4.0/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +192 -0

192 lines not on this page · raw message

package/gcc/6.4.0/942-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +192 -0

192 lines not on this page · raw message

Signature · 1 line
2.9.5
#2 lore raw

PATCH v3 1/7 package/gcc: fix build issue with glibc 2.26

Romain, All,

On 2017-09-23 23:24 +0200, Romain Naour spake thusly:

Quoted 6 lines

In file included from ../../../libgcc/unwind-dw2.c:403:0:
./md-unwind-support.h: In function ??aarch64_fallback_frame_state??:
./md-unwind-support.h:58:21: error: field ??uc?? has incomplete type

     struct ucontext uc;
                     ^~
Quoted 8 lines

The fix is already included in gcc 7.2 release [1]. We have to backport it to all older gcc release since it's not included in any stable release yet.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=14c2f22a1877f6b60a2f7c2f83ffb032759456a6

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

Regards,
Yann E. MORIN.

Quoted 606 lines

---
v3: use upstream commit for gcc 5 and 6. (Yann)

---
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 190 ++++++++++++++++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++++++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++++++++++
 3 files changed, 574 insertions(+)
 create mode 100644 package/gcc/4.9.4/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/5.4.0/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/6.4.0/942-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
package/gcc/4.9.4/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +190 -0
new file mode 100644
index 0000000..526346c
@@ -0,0 +1,190 @@
+From b7e85069238c40eae54d0ca03ab6d5470d1815f9 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 4 Jul 2017 10:25:10 +0000
+Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules.  This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead.  This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead.  As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Tested compilation together with current glibc with glibc's
+build-many-glibcs.py.
+
+	* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+	config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+	config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+	config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+	x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+	uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+	config/pa/linux-unwind.h (pa32_fallback_frame_state),
+	config/sh/linux-unwind.h (sh_fallback_frame_state),
+	config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+	config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+	ucontext_t instead of struct ucontext.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch at 249958 138bc75d-0d04-0410-961f-82ee72b054a4
+[Romain backport from gcc-5-branch]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libgcc/config/aarch64/linux-unwind.h | 2 +-
+ libgcc/config/alpha/linux-unwind.h   | 2 +-
+ libgcc/config/bfin/linux-unwind.h    | 2 +-
+ libgcc/config/i386/linux-unwind.h    | 4 ++--
+ libgcc/config/m68k/linux-unwind.h    | 2 +-
+ libgcc/config/nios2/linux-unwind.h   | 2 +-
+ libgcc/config/pa/linux-unwind.h      | 2 +-
+ libgcc/config/sh/linux-unwind.h      | 2 +-
+ libgcc/config/tilepro/linux-unwind.h | 2 +-
+ libgcc/config/xtensa/linux-unwind.h  | 2 +-
+ 10 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
+index 6b5b3cd..d13dc34 100644
+--- a/libgcc/config/aarch64/linux-unwind.h
++++ b/libgcc/config/aarch64/linux-unwind.h
+@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe
+   {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   };
+ 
+   struct rt_sigframe *rt_;
+diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
+index b5bfd1c..166d3d2 100644
+--- a/libgcc/config/alpha/linux-unwind.h
++++ b/libgcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
+index dc58f0a..8b94568 100644
+--- a/libgcc/config/bfin/linux-unwind.h
++++ b/libgcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
+index 7986928..a9d621c 100644
+--- a/libgcc/config/i386/linux-unwind.h
++++ b/libgcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
+index 1ba2a0c4..d67767e 100644
+--- a/libgcc/config/m68k/linux-unwind.h
++++ b/libgcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
+index ba4bd80..8978868 100644
+--- a/libgcc/config/nios2/linux-unwind.h
++++ b/libgcc/config/nios2/linux-unwind.h
+@@ -38,7 +38,7 @@ struct nios2_mcontext {
+ 
+ struct nios2_ucontext {
+   unsigned long uc_flags;
+-  struct ucontext *uc_link;
++  ucontext_t *uc_link;
+   stack_t uc_stack;
+   struct nios2_mcontext uc_mcontext;
+   sigset_t uc_sigmask;	/* mask last for extensibility */
+diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
+index 4a3cfff..d2ac437 100644
+--- a/libgcc/config/pa/linux-unwind.h
++++ b/libgcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
+index 4875706..671bde7 100644
+--- a/libgcc/config/sh/linux-unwind.h
++++ b/libgcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
+index 27481cf..c24d58c 100644
+--- a/libgcc/config/tilepro/linux-unwind.h
++++ b/libgcc/config/tilepro/linux-unwind.h
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe {
+     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* Return if this is not a signal handler.  */
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 6832d0b..cb15b4c 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -63,7 +63,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
+-- 
+2.9.5
+
package/gcc/5.4.0/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +192 -0
new file mode 100644
index 0000000..4c3385d
@@ -0,0 +1,192 @@
+From c287e88cc3743bfa7e5719bc4dee327aa3950051 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 4 Jul 2017 10:25:10 +0000
+Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules.  This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead.  This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead.  As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Tested compilation together with current glibc with glibc's
+build-many-glibcs.py.
+
+	* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+	config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+	config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+	config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+	x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+	uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+	config/pa/linux-unwind.h (pa32_fallback_frame_state),
+	config/sh/linux-unwind.h (sh_fallback_frame_state),
+	config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+	config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+	ucontext_t instead of struct ucontext.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch at 249958 138bc75d-0d04-0410-961f-82ee72b054a4
+
+(cherry picked from commit ecf0d1a107133c715763940c2b197aa814710e1b)
+[Romain rebase on 5.4]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libgcc/config/aarch64/linux-unwind.h | 2 +-
+ libgcc/config/alpha/linux-unwind.h   | 2 +-
+ libgcc/config/bfin/linux-unwind.h    | 2 +-
+ libgcc/config/i386/linux-unwind.h    | 4 ++--
+ libgcc/config/m68k/linux-unwind.h    | 2 +-
+ libgcc/config/nios2/linux-unwind.h   | 2 +-
+ libgcc/config/pa/linux-unwind.h      | 2 +-
+ libgcc/config/sh/linux-unwind.h      | 2 +-
+ libgcc/config/tilepro/linux-unwind.h | 2 +-
+ libgcc/config/xtensa/linux-unwind.h  | 2 +-
+ 10 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
+index 86d17b1..909f68f 100644
+--- a/libgcc/config/aarch64/linux-unwind.h
++++ b/libgcc/config/aarch64/linux-unwind.h
+@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe
+   {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   };
+ 
+   struct rt_sigframe *rt_;
+diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
+index d65474f..9a226b1 100644
+--- a/libgcc/config/alpha/linux-unwind.h
++++ b/libgcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
+index 0c270e4..7fa95d2 100644
+--- a/libgcc/config/bfin/linux-unwind.h
++++ b/libgcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
+index e54bf73..d35fc45 100644
+--- a/libgcc/config/i386/linux-unwind.h
++++ b/libgcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
+index fb79a4d..b2f5ea4 100644
+--- a/libgcc/config/m68k/linux-unwind.h
++++ b/libgcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
+index dff1c20..1d88afe 100644
+--- a/libgcc/config/nios2/linux-unwind.h
++++ b/libgcc/config/nios2/linux-unwind.h
+@@ -38,7 +38,7 @@ struct nios2_mcontext {
+ 
+ struct nios2_ucontext {
+   unsigned long uc_flags;
+-  struct ucontext *uc_link;
++  ucontext_t *uc_link;
+   stack_t uc_stack;
+   struct nios2_mcontext uc_mcontext;
+   sigset_t uc_sigmask;	/* mask last for extensibility */
+diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
+index 0149468..9157535 100644
+--- a/libgcc/config/pa/linux-unwind.h
++++ b/libgcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
+index e63091f..67033f0 100644
+--- a/libgcc/config/sh/linux-unwind.h
++++ b/libgcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
+index fd83ba7..e3c9ef0 100644
+--- a/libgcc/config/tilepro/linux-unwind.h
++++ b/libgcc/config/tilepro/linux-unwind.h
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe {
+     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* Return if this is not a signal handler.  */
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 9daf738..ff6b663 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -64,7 +64,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
+-- 
+2.9.5
+
package/gcc/6.4.0/942-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +192 -0
new file mode 100644
index 0000000..a2a2ea0
@@ -0,0 +1,192 @@
+From 35d8ca22047f101a700abb29cffbf03b81278a2b Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 4 Jul 2017 10:23:57 +0000
+Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules.  This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead.  This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead.  As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Tested compilation together with current glibc with glibc's
+build-many-glibcs.py.
+
+	* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+	config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+	config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+	config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+	x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+	uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+	config/pa/linux-unwind.h (pa32_fallback_frame_state),
+	config/sh/linux-unwind.h (sh_fallback_frame_state),
+	config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+	config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+	ucontext_t instead of struct ucontext.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch at 249957 138bc75d-0d04-0410-961f-82ee72b054a4
+
+(cherry picked from commit b685411208e0aaa79190d54faf945763514706b8)
+[Romain rebase on gcc 6.4]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libgcc/config/aarch64/linux-unwind.h | 2 +-
+ libgcc/config/alpha/linux-unwind.h   | 2 +-
+ libgcc/config/bfin/linux-unwind.h    | 2 +-
+ libgcc/config/i386/linux-unwind.h    | 4 ++--
+ libgcc/config/m68k/linux-unwind.h    | 2 +-
+ libgcc/config/nios2/linux-unwind.h   | 2 +-
+ libgcc/config/pa/linux-unwind.h      | 2 +-
+ libgcc/config/sh/linux-unwind.h      | 2 +-
+ libgcc/config/tilepro/linux-unwind.h | 2 +-
+ libgcc/config/xtensa/linux-unwind.h  | 2 +-
+ 10 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
+index 4512efb..06de45a 100644
+--- a/libgcc/config/aarch64/linux-unwind.h
++++ b/libgcc/config/aarch64/linux-unwind.h
+@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe
+   {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   };
+ 
+   struct rt_sigframe *rt_;
+diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
+index bdbba4a..e84812e 100644
+--- a/libgcc/config/alpha/linux-unwind.h
++++ b/libgcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
+index 77b7c23..8bf5e82 100644
+--- a/libgcc/config/bfin/linux-unwind.h
++++ b/libgcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
+index 540a0a2..29efbe3 100644
+--- a/libgcc/config/i386/linux-unwind.h
++++ b/libgcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
+index 75b7cf7..f964e24 100644
+--- a/libgcc/config/m68k/linux-unwind.h
++++ b/libgcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
+index 2304142..30f25ea 100644
+--- a/libgcc/config/nios2/linux-unwind.h
++++ b/libgcc/config/nios2/linux-unwind.h
+@@ -38,7 +38,7 @@ struct nios2_mcontext {
+ 
+ struct nios2_ucontext {
+   unsigned long uc_flags;
+-  struct ucontext *uc_link;
++  ucontext_t *uc_link;
+   stack_t uc_stack;
+   struct nios2_mcontext uc_mcontext;
+   sigset_t uc_sigmask;	/* mask last for extensibility */
+diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
+index 9a2657f..e47493d 100644
+--- a/libgcc/config/pa/linux-unwind.h
++++ b/libgcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
+index e389cac..0bf43ba 100644
+--- a/libgcc/config/sh/linux-unwind.h
++++ b/libgcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
+index 796e976..75f8890 100644
+--- a/libgcc/config/tilepro/linux-unwind.h
++++ b/libgcc/config/tilepro/linux-unwind.h
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe {
+     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* Return if this is not a signal handler.  */
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 9872492..586a9d4 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
+-- 
+2.9.5
+
Signature · 1 line
2.9.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v3 1/7 package/gcc: fix build issue with glibc 2.26

In reply to Romain Naour

In file included from ../../../libgcc/unwind-dw2.c:403:0:
./md-unwind-support.h: In function ??aarch64_fallback_frame_state??:
./md-unwind-support.h:58:21: error: field ??uc?? has incomplete type

     struct ucontext uc;
                     ^~

The fix is already included in gcc 7.2 release [1]. We have to backport it to all older gcc release since it's not included in any stable release yet.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=14c2f22a1877f6b60a2f7c2f83ffb032759456a6

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

---
v3: use upstream commit for gcc 5 and 6. (Yann)

---
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 190 ++++++++++++++++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++++++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++++++++++
 3 files changed, 574 insertions(+)
 create mode 100644 package/gcc/4.9.4/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/5.4.0/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/6.4.0/942-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
package/gcc/4.9.4/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +190 -0
new file mode 100644
index 0000000..526346c
@@ -0,0 +1,190 @@
+From b7e85069238c40eae54d0ca03ab6d5470d1815f9 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 4 Jul 2017 10:25:10 +0000
+Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules.  This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead.  This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead.  As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Tested compilation together with current glibc with glibc's
+build-many-glibcs.py.
+
+	* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+	config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+	config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+	config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+	x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+	uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+	config/pa/linux-unwind.h (pa32_fallback_frame_state),
+	config/sh/linux-unwind.h (sh_fallback_frame_state),
+	config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+	config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+	ucontext_t instead of struct ucontext.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch at 249958 138bc75d-0d04-0410-961f-82ee72b054a4
+[Romain backport from gcc-5-branch]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libgcc/config/aarch64/linux-unwind.h | 2 +-
+ libgcc/config/alpha/linux-unwind.h   | 2 +-
+ libgcc/config/bfin/linux-unwind.h    | 2 +-
+ libgcc/config/i386/linux-unwind.h    | 4 ++--
+ libgcc/config/m68k/linux-unwind.h    | 2 +-
+ libgcc/config/nios2/linux-unwind.h   | 2 +-
+ libgcc/config/pa/linux-unwind.h      | 2 +-
+ libgcc/config/sh/linux-unwind.h      | 2 +-
+ libgcc/config/tilepro/linux-unwind.h | 2 +-
+ libgcc/config/xtensa/linux-unwind.h  | 2 +-
+ 10 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
+index 6b5b3cd..d13dc34 100644
+--- a/libgcc/config/aarch64/linux-unwind.h
++++ b/libgcc/config/aarch64/linux-unwind.h
+@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe
+   {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   };
+ 
+   struct rt_sigframe *rt_;
+diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
+index b5bfd1c..166d3d2 100644
+--- a/libgcc/config/alpha/linux-unwind.h
++++ b/libgcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
+index dc58f0a..8b94568 100644
+--- a/libgcc/config/bfin/linux-unwind.h
++++ b/libgcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
+index 7986928..a9d621c 100644
+--- a/libgcc/config/i386/linux-unwind.h
++++ b/libgcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
+index 1ba2a0c4..d67767e 100644
+--- a/libgcc/config/m68k/linux-unwind.h
++++ b/libgcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
+index ba4bd80..8978868 100644
+--- a/libgcc/config/nios2/linux-unwind.h
++++ b/libgcc/config/nios2/linux-unwind.h
+@@ -38,7 +38,7 @@ struct nios2_mcontext {
+ 
+ struct nios2_ucontext {
+   unsigned long uc_flags;
+-  struct ucontext *uc_link;
++  ucontext_t *uc_link;
+   stack_t uc_stack;
+   struct nios2_mcontext uc_mcontext;
+   sigset_t uc_sigmask;	/* mask last for extensibility */
+diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
+index 4a3cfff..d2ac437 100644
+--- a/libgcc/config/pa/linux-unwind.h
++++ b/libgcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
+index 4875706..671bde7 100644
+--- a/libgcc/config/sh/linux-unwind.h
++++ b/libgcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
+index 27481cf..c24d58c 100644
+--- a/libgcc/config/tilepro/linux-unwind.h
++++ b/libgcc/config/tilepro/linux-unwind.h
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe {
+     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* Return if this is not a signal handler.  */
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 6832d0b..cb15b4c 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -63,7 +63,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
+-- 
+2.9.5
+
package/gcc/5.4.0/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +192 -0

192 lines not on this page · raw message

package/gcc/6.4.0/942-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch new file +192 -0

192 lines not on this page · raw message

Signature · 1 line
2.9.5
#4 lore raw

PATCH v3 2/7 package/gcc: fix build issue with glibc 2.26

In reply to Romain Naour

../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: In function ?int __sanitizer::TracerThread(void*)?:
../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:241:22: error: aggregate ?sigaltstack handler_stack? has incomplete type and cannot be defined
struct sigaltstack handler_stack;

../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: In function ?int __sanitizer::TracerThread(void*)?:
../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:276:22: error: aggregate ?sigaltstack handler_stack? has incomplete type and cannot be defined

   struct sigaltstack handler_stack;
                      ^~~~~~~~~~~~~

The fix is already included in gcc 7.2 release [1]. We have to backport it to all older gcc release since it's not included in any stable release yet.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=72edc2c02f8b4768ad660f46a1c7e2400c0a8e06

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

---
v3: use upstream commit for gcc 5 and 6. (Yann)

---
 package/gcc/4.9.4/944-sanitizer-linux.patch | 88 ++++++++++++++++++++++++++++
 package/gcc/5.4.0/944-sanitizer-linux.patch | 91 +++++++++++++++++++++++++++++
 package/gcc/6.4.0/943-sanitizer-linux.patch | 91 +++++++++++++++++++++++++++++
 3 files changed, 270 insertions(+)
 create mode 100644 package/gcc/4.9.4/944-sanitizer-linux.patch
 create mode 100644 package/gcc/5.4.0/944-sanitizer-linux.patch
 create mode 100644 package/gcc/6.4.0/943-sanitizer-linux.patch
package/gcc/4.9.4/944-sanitizer-linux.patch new file +88 -0
new file mode 100644
index 0000000..caadf2d
@@ -0,0 +1,88 @@
+From f9a35ba5c150da2e381c4cab01f8f12bcd6af5d2 Mon Sep 17 00:00:00 2001
+From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 17 Jul 2017 19:41:08 +0000
+Subject: [PATCH] 	Backported from mainline 	2017-07-14  Jakub
+ Jelinek  <[email protected]>
+
+	PR sanitizer/81066
+	* sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
+	* sanitizer_common/sanitizer_linux.cc: Likewise.
+	* sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
+	* tsan/tsan_platform_linux.cc: Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch at 250287 138bc75d-0d04-0410-961f-82ee72b054a4
+(cherry picked from commit 72edc2c02f8b4768ad660f46a1c7e2400c0a8e06)
+[Romain backport to 4.9.4]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libsanitizer/sanitizer_common/sanitizer_linux.cc                      | 3 +--
+ libsanitizer/sanitizer_common/sanitizer_linux.h                       | 4 +---
+ libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +-
+ libsanitizer/tsan/tsan_platform_linux.cc                              | 2 +-
+ 4 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+index 69c9c10..8e53673 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+@@ -599,8 +599,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+   return internal_syscall(__NR_prctl, option, arg2, arg3, arg4, arg5);
+ }
+ 
+-uptr internal_sigaltstack(const struct sigaltstack *ss,
+-                         struct sigaltstack *oss) {
++uptr internal_sigaltstack(const void *ss, void *oss) {
+   return internal_syscall(__NR_sigaltstack, (uptr)ss, (uptr)oss);
+ }
+ 
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
+index 6422df1..8e111d1 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
+@@ -18,7 +18,6 @@
+ #include "sanitizer_platform_limits_posix.h"
+ 
+ struct link_map;  // Opaque type returned by dlopen().
+-struct sigaltstack;
+ 
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
+@@ -28,8 +27,7 @@ struct linux_dirent;
+ // Syscall wrappers.
+ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
+ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
+-uptr internal_sigaltstack(const struct sigaltstack* ss,
+-                          struct sigaltstack* oss);
++uptr internal_sigaltstack(const void* ss, void* oss);
+ uptr internal_sigaction(int signum, const __sanitizer_kernel_sigaction_t *act,
+     __sanitizer_kernel_sigaction_t *oldact);
+ uptr internal_sigprocmask(int how, __sanitizer_kernel_sigset_t *set,
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+index 6ee63ec..50c21a3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -238,7 +238,7 @@ static int TracerThread(void* argument) {
+ 
+   // Alternate stack for signal handling.
+   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
+-  struct sigaltstack handler_stack;
++  stack_t handler_stack;
+   internal_memset(&handler_stack, 0, sizeof(handler_stack));
+   handler_stack.ss_sp = handler_stack_memory.data();
+   handler_stack.ss_size = kHandlerStackSize;
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index fe69430..49f5270 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -351,7 +351,7 @@ bool IsGlobalVar(uptr addr) {
+ // closes within glibc. The code is a pure hack.
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  struct __res_state *statp = (struct __res_state*)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];
+-- 
+2.9.5
+
package/gcc/5.4.0/944-sanitizer-linux.patch new file +91 -0

91 lines not on this page · raw message

package/gcc/6.4.0/943-sanitizer-linux.patch new file +91 -0

91 lines not on this page · raw message

Signature · 1 line
2.9.5
#5 lore raw

PATCH v3 2/7 package/gcc: fix build issue with glibc 2.26

Romain, All,

On 2017-09-23 23:24 +0200, Romain Naour spake thusly:

Quoted 9 lines

../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: In function ?int __sanitizer::TracerThread(void*)?:
../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:241:22: error: aggregate ?sigaltstack handler_stack? has incomplete type and cannot be defined
struct sigaltstack handler_stack;

../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: In function ?int __sanitizer::TracerThread(void*)?:
../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:276:22: error: aggregate ?sigaltstack handler_stack? has incomplete type and cannot be defined

   struct sigaltstack handler_stack;
                      ^~~~~~~~~~~~~
Quoted 8 lines

The fix is already included in gcc 7.2 release [1]. We have to backport it to all older gcc release since it's not included in any stable release yet.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=72edc2c02f8b4768ad660f46a1c7e2400c0a8e06

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

Regards,
Yann E. MORIN.

Quoted 302 lines

---
v3: use upstream commit for gcc 5 and 6. (Yann)

---
 package/gcc/4.9.4/944-sanitizer-linux.patch | 88 ++++++++++++++++++++++++++++
 package/gcc/5.4.0/944-sanitizer-linux.patch | 91 +++++++++++++++++++++++++++++
 package/gcc/6.4.0/943-sanitizer-linux.patch | 91 +++++++++++++++++++++++++++++
 3 files changed, 270 insertions(+)
 create mode 100644 package/gcc/4.9.4/944-sanitizer-linux.patch
 create mode 100644 package/gcc/5.4.0/944-sanitizer-linux.patch
 create mode 100644 package/gcc/6.4.0/943-sanitizer-linux.patch
package/gcc/4.9.4/944-sanitizer-linux.patch new file +88 -0
new file mode 100644
index 0000000..caadf2d
@@ -0,0 +1,88 @@
+From f9a35ba5c150da2e381c4cab01f8f12bcd6af5d2 Mon Sep 17 00:00:00 2001
+From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 17 Jul 2017 19:41:08 +0000
+Subject: [PATCH] 	Backported from mainline 	2017-07-14  Jakub
+ Jelinek  <[email protected]>
+
+	PR sanitizer/81066
+	* sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
+	* sanitizer_common/sanitizer_linux.cc: Likewise.
+	* sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
+	* tsan/tsan_platform_linux.cc: Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch at 250287 138bc75d-0d04-0410-961f-82ee72b054a4
+(cherry picked from commit 72edc2c02f8b4768ad660f46a1c7e2400c0a8e06)
+[Romain backport to 4.9.4]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libsanitizer/sanitizer_common/sanitizer_linux.cc                      | 3 +--
+ libsanitizer/sanitizer_common/sanitizer_linux.h                       | 4 +---
+ libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +-
+ libsanitizer/tsan/tsan_platform_linux.cc                              | 2 +-
+ 4 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+index 69c9c10..8e53673 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+@@ -599,8 +599,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+   return internal_syscall(__NR_prctl, option, arg2, arg3, arg4, arg5);
+ }
+ 
+-uptr internal_sigaltstack(const struct sigaltstack *ss,
+-                         struct sigaltstack *oss) {
++uptr internal_sigaltstack(const void *ss, void *oss) {
+   return internal_syscall(__NR_sigaltstack, (uptr)ss, (uptr)oss);
+ }
+ 
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
+index 6422df1..8e111d1 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
+@@ -18,7 +18,6 @@
+ #include "sanitizer_platform_limits_posix.h"
+ 
+ struct link_map;  // Opaque type returned by dlopen().
+-struct sigaltstack;
+ 
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
+@@ -28,8 +27,7 @@ struct linux_dirent;
+ // Syscall wrappers.
+ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
+ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
+-uptr internal_sigaltstack(const struct sigaltstack* ss,
+-                          struct sigaltstack* oss);
++uptr internal_sigaltstack(const void* ss, void* oss);
+ uptr internal_sigaction(int signum, const __sanitizer_kernel_sigaction_t *act,
+     __sanitizer_kernel_sigaction_t *oldact);
+ uptr internal_sigprocmask(int how, __sanitizer_kernel_sigset_t *set,
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+index 6ee63ec..50c21a3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -238,7 +238,7 @@ static int TracerThread(void* argument) {
+ 
+   // Alternate stack for signal handling.
+   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
+-  struct sigaltstack handler_stack;
++  stack_t handler_stack;
+   internal_memset(&handler_stack, 0, sizeof(handler_stack));
+   handler_stack.ss_sp = handler_stack_memory.data();
+   handler_stack.ss_size = kHandlerStackSize;
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index fe69430..49f5270 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -351,7 +351,7 @@ bool IsGlobalVar(uptr addr) {
+ // closes within glibc. The code is a pure hack.
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  struct __res_state *statp = (struct __res_state*)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];
+-- 
+2.9.5
+
package/gcc/5.4.0/944-sanitizer-linux.patch new file +91 -0
new file mode 100644
index 0000000..a2602b7
@@ -0,0 +1,91 @@
+From cf796eadff0f2ff0f6e4565373d54d10dff276e1 Mon Sep 17 00:00:00 2001
+From: doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 7 Sep 2017 07:17:17 +0000
+Subject: [PATCH] 2017-09-07  Matthias Klose  <[email protected]>
+
+        Backported from mainline
+        2017-07-14  Jakub Jelinek  <[email protected]>
+
+        PR sanitizer/81066
+        * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
+        * sanitizer_common/sanitizer_linux.cc: Likewise.
+        * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
+        * tsan/tsan_platform_linux.cc: Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch at 251829 138bc75d-0d04-0410-961f-82ee72b054a4
+
+(cherry picked from commit 833e00c01e96f61e24cd7ec97b93fad212dc914b)
+[Romain rebase on gcc 5.4]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libsanitizer/sanitizer_common/sanitizer_linux.cc                      | 3 +--
+ libsanitizer/sanitizer_common/sanitizer_linux.h                       | 4 +---
+ libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +-
+ libsanitizer/tsan/tsan_platform_linux.cc                              | 2 +-
+ 4 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+index 9feb307..821b26d 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+@@ -514,8 +514,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+ }
+ #endif
+ 
+-uptr internal_sigaltstack(const struct sigaltstack *ss,
+-                         struct sigaltstack *oss) {
++uptr internal_sigaltstack(const void *ss, void *oss) {
+   return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
+ }
+ 
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
+index 086834c..3a6f4cd 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
+@@ -18,7 +18,6 @@
+ #include "sanitizer_platform_limits_posix.h"
+ 
+ struct link_map;  // Opaque type returned by dlopen().
+-struct sigaltstack;
+ 
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
+@@ -27,8 +26,7 @@ struct linux_dirent;
+ 
+ // Syscall wrappers.
+ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
+-uptr internal_sigaltstack(const struct sigaltstack* ss,
+-                          struct sigaltstack* oss);
++uptr internal_sigaltstack(const void* ss, void* oss);
+ uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
+     __sanitizer_sigset_t *oldset);
+ void internal_sigfillset(__sanitizer_sigset_t *set);
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+index 5881202..c54894d 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -234,7 +234,7 @@ static int TracerThread(void* argument) {
+ 
+   // Alternate stack for signal handling.
+   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
+-  struct sigaltstack handler_stack;
++  stack_t handler_stack;
+   internal_memset(&handler_stack, 0, sizeof(handler_stack));
+   handler_stack.ss_sp = handler_stack_memory.data();
+   handler_stack.ss_size = kHandlerStackSize;
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index 3259131..b8e9078 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -377,7 +377,7 @@ bool IsGlobalVar(uptr addr) {
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+ #if SANITIZER_LINUX
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  struct __res_state *statp = (struct __res_state*)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];
+-- 
+2.9.5
+
package/gcc/6.4.0/943-sanitizer-linux.patch new file +91 -0
new file mode 100644
index 0000000..640d68c
@@ -0,0 +1,91 @@
+From a3e3d1b5f73380a99126c4937a95225ba3bd214b Mon Sep 17 00:00:00 2001
+From: doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 7 Sep 2017 07:15:24 +0000
+Subject: [PATCH] 2017-09-07  Matthias Klose  <[email protected]>
+
+        Backported from mainline
+        2017-07-14  Jakub Jelinek  <[email protected]>
+
+        PR sanitizer/81066
+        * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
+        * sanitizer_common/sanitizer_linux.cc: Likewise.
+        * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
+        * tsan/tsan_platform_linux.cc: Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch at 251828 138bc75d-0d04-0410-961f-82ee72b054a4
+
+(cherry picked from commit 8937b94d1a643fd9760714642296d034a45254a8)
+[Romain rebase on gcc 6.4]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libsanitizer/sanitizer_common/sanitizer_linux.cc                      | 3 +--
+ libsanitizer/sanitizer_common/sanitizer_linux.h                       | 4 +---
+ libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +-
+ libsanitizer/tsan/tsan_platform_linux.cc                              | 2 +-
+ 4 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+index 2cefa20..223d9c6 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+@@ -546,8 +546,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+ }
+ #endif
+ 
+-uptr internal_sigaltstack(const struct sigaltstack *ss,
+-                         struct sigaltstack *oss) {
++uptr internal_sigaltstack(const void *ss, void *oss) {
+   return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
+ }
+ 
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
+index 4497702..1594058 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
+@@ -19,7 +19,6 @@
+ #include "sanitizer_platform_limits_posix.h"
+ 
+ struct link_map;  // Opaque type returned by dlopen().
+-struct sigaltstack;
+ 
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
+@@ -28,8 +27,7 @@ struct linux_dirent;
+ 
+ // Syscall wrappers.
+ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
+-uptr internal_sigaltstack(const struct sigaltstack* ss,
+-                          struct sigaltstack* oss);
++uptr internal_sigaltstack(const void* ss, void* oss);
+ uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
+     __sanitizer_sigset_t *oldset);
+ void internal_sigfillset(__sanitizer_sigset_t *set);
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+index c919e4f..014162af 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -267,7 +267,7 @@ static int TracerThread(void* argument) {
+ 
+   // Alternate stack for signal handling.
+   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
+-  struct sigaltstack handler_stack;
++  stack_t handler_stack;
+   internal_memset(&handler_stack, 0, sizeof(handler_stack));
+   handler_stack.ss_sp = handler_stack_memory.data();
+   handler_stack.ss_size = kHandlerStackSize;
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index 09cec5f..908f4fe 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -291,7 +291,7 @@ bool IsGlobalVar(uptr addr) {
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+ #if SANITIZER_LINUX
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  struct __res_state *statp = (struct __res_state*)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];
+-- 
+2.9.5
+
Signature · 1 line
2.9.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH v3 2/7 package/gcc: fix build issue with glibc 2.26

In reply to Romain Naour

../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: In function ?int __sanitizer::TracerThread(void*)?:
../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:241:22: error: aggregate ?sigaltstack handler_stack? has incomplete type and cannot be defined
struct sigaltstack handler_stack;

../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: In function ?int __sanitizer::TracerThread(void*)?:
../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:276:22: error: aggregate ?sigaltstack handler_stack? has incomplete type and cannot be defined

   struct sigaltstack handler_stack;
                      ^~~~~~~~~~~~~

The fix is already included in gcc 7.2 release [1]. We have to backport it to all older gcc release since it's not included in any stable release yet.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=72edc2c02f8b4768ad660f46a1c7e2400c0a8e06

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

---
v3: use upstream commit for gcc 5 and 6. (Yann)

---
 package/gcc/4.9.4/944-sanitizer-linux.patch | 88 ++++++++++++++++++++++++++++
 package/gcc/5.4.0/944-sanitizer-linux.patch | 91 +++++++++++++++++++++++++++++
 package/gcc/6.4.0/943-sanitizer-linux.patch | 91 +++++++++++++++++++++++++++++
 3 files changed, 270 insertions(+)
 create mode 100644 package/gcc/4.9.4/944-sanitizer-linux.patch
 create mode 100644 package/gcc/5.4.0/944-sanitizer-linux.patch
 create mode 100644 package/gcc/6.4.0/943-sanitizer-linux.patch
package/gcc/4.9.4/944-sanitizer-linux.patch new file +88 -0
new file mode 100644
index 0000000..caadf2d
@@ -0,0 +1,88 @@
+From f9a35ba5c150da2e381c4cab01f8f12bcd6af5d2 Mon Sep 17 00:00:00 2001
+From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 17 Jul 2017 19:41:08 +0000
+Subject: [PATCH] 	Backported from mainline 	2017-07-14  Jakub
+ Jelinek  <[email protected]>
+
+	PR sanitizer/81066
+	* sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
+	* sanitizer_common/sanitizer_linux.cc: Likewise.
+	* sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
+	* tsan/tsan_platform_linux.cc: Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch at 250287 138bc75d-0d04-0410-961f-82ee72b054a4
+(cherry picked from commit 72edc2c02f8b4768ad660f46a1c7e2400c0a8e06)
+[Romain backport to 4.9.4]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ libsanitizer/sanitizer_common/sanitizer_linux.cc                      | 3 +--
+ libsanitizer/sanitizer_common/sanitizer_linux.h                       | 4 +---
+ libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +-
+ libsanitizer/tsan/tsan_platform_linux.cc                              | 2 +-
+ 4 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+index 69c9c10..8e53673 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+@@ -599,8 +599,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+   return internal_syscall(__NR_prctl, option, arg2, arg3, arg4, arg5);
+ }
+ 
+-uptr internal_sigaltstack(const struct sigaltstack *ss,
+-                         struct sigaltstack *oss) {
++uptr internal_sigaltstack(const void *ss, void *oss) {
+   return internal_syscall(__NR_sigaltstack, (uptr)ss, (uptr)oss);
+ }
+ 
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
+index 6422df1..8e111d1 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
+@@ -18,7 +18,6 @@
+ #include "sanitizer_platform_limits_posix.h"
+ 
+ struct link_map;  // Opaque type returned by dlopen().
+-struct sigaltstack;
+ 
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
+@@ -28,8 +27,7 @@ struct linux_dirent;
+ // Syscall wrappers.
+ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
+ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
+-uptr internal_sigaltstack(const struct sigaltstack* ss,
+-                          struct sigaltstack* oss);
++uptr internal_sigaltstack(const void* ss, void* oss);
+ uptr internal_sigaction(int signum, const __sanitizer_kernel_sigaction_t *act,
+     __sanitizer_kernel_sigaction_t *oldact);
+ uptr internal_sigprocmask(int how, __sanitizer_kernel_sigset_t *set,
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+index 6ee63ec..50c21a3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -238,7 +238,7 @@ static int TracerThread(void* argument) {
+ 
+   // Alternate stack for signal handling.
+   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
+-  struct sigaltstack handler_stack;
++  stack_t handler_stack;
+   internal_memset(&handler_stack, 0, sizeof(handler_stack));
+   handler_stack.ss_sp = handler_stack_memory.data();
+   handler_stack.ss_size = kHandlerStackSize;
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index fe69430..49f5270 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -351,7 +351,7 @@ bool IsGlobalVar(uptr addr) {
+ // closes within glibc. The code is a pure hack.
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  struct __res_state *statp = (struct __res_state*)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];
+-- 
+2.9.5
+
package/gcc/5.4.0/944-sanitizer-linux.patch new file +91 -0

91 lines not on this page · raw message

package/gcc/6.4.0/943-sanitizer-linux.patch new file +91 -0

91 lines not on this page · raw message

Signature · 1 line
2.9.5
#7 lore raw

PATCH v3 3/7 package/glibc: needs kernel headers >= 3.10 on powerpc64le

In reply to Romain Naour

Since glibc 2.26, kernel headers >= 3.10 are needed on powerpc64le [1]. In order to prepare the glibc bump to this version, we don't allow to build a Buildroot toolchain with kernel headers older than 3.10.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=c2ff5ec13fca1bdd1cd646a0260808386d7bd7ff

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

---
v3: move the dependency outside of architectures section. (Yann)

---
 toolchain/toolchain-buildroot/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)
toolchain/toolchain-buildroot/Config.in +6 -0
index f47001f..ac6017f 100644
@@ -51,6 +51,7 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || !BR2_powerpc64le
 	depends on !BR2_powerpc_SPE
 	select BR2_TOOLCHAIN_USES_GLIBC
 	# our glibc.mk enables RPC support
@@ -65,6 +66,11 @@ comment "glibc needs a toolchain w/ dynamic library, kernel headers >= 3.2"
 	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 
+# glibc >= 2.26 require kernel headers >= 3.10 on powerpc64le.
+comment "glibc on powerpc64le needs a toolchain w/ headers >= 3.10"
+	depends on BR2_powerpc64le
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+
 config BR2_TOOLCHAIN_BUILDROOT_MUSL
 	bool "musl"
 	depends on BR2_aarch64	  || BR2_arm     || BR2_armeb     || BR2_i386 || \
Signature · 1 line
2.9.5
#8 lore raw

PATCH v3 3/7 package/glibc: needs kernel headers >= 3.10 on powerpc64le

Romain, All,

On 2017-09-23 23:24 +0200, Romain Naour spake thusly:

Quoted 9 lines

Since glibc 2.26, kernel headers >= 3.10 are needed on powerpc64le [1]. In order to prepare the glibc bump to this version, we don't allow to build a Buildroot toolchain with kernel headers older than 3.10.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=c2ff5ec13fca1bdd1cd646a0260808386d7bd7ff

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

Ideally, this should have been part of the patch that does the bump to 2.26, but it is OK to have it just before to have smaller-to-review patches.

Regards,
Yann E. MORIN.

Quoted 33 lines

---
v3: move the dependency outside of architectures section. (Yann)

---
 toolchain/toolchain-buildroot/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)
toolchain/toolchain-buildroot/Config.in +6 -0
index f47001f..ac6017f 100644
@@ -51,6 +51,7 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || !BR2_powerpc64le
 	depends on !BR2_powerpc_SPE
 	select BR2_TOOLCHAIN_USES_GLIBC
 	# our glibc.mk enables RPC support
@@ -65,6 +66,11 @@ comment "glibc needs a toolchain w/ dynamic library, kernel headers >= 3.2"
 	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 
+# glibc >= 2.26 require kernel headers >= 3.10 on powerpc64le.
+comment "glibc on powerpc64le needs a toolchain w/ headers >= 3.10"
+	depends on BR2_powerpc64le
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+
 config BR2_TOOLCHAIN_BUILDROOT_MUSL
 	bool "musl"
 	depends on BR2_aarch64	  || BR2_arm     || BR2_armeb     || BR2_i386 || \
Signature · 1 line
2.9.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#9 lore raw

PATCH v3 3/7 package/glibc: needs kernel headers >= 3.10 on powerpc64le

In reply to Romain Naour

Since glibc 2.26, kernel headers >= 3.10 are needed on powerpc64le [1]. In order to prepare the glibc bump to this version, we don't allow to build a Buildroot toolchain with kernel headers older than 3.10.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=c2ff5ec13fca1bdd1cd646a0260808386d7bd7ff

Cc Thomas Petazzoni <[email protected]>
Cc "Yann E. MORIN" <[email protected]>

---
v3: move the dependency outside of architectures section. (Yann)

---
 toolchain/toolchain-buildroot/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)
toolchain/toolchain-buildroot/Config.in +6 -0
index f47001f..ac6017f 100644
@@ -51,6 +51,7 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || !BR2_powerpc64le
 	depends on !BR2_powerpc_SPE
 	select BR2_TOOLCHAIN_USES_GLIBC
 	# our glibc.mk enables RPC support
@@ -65,6 +66,11 @@ comment "glibc needs a toolchain w/ dynamic library, kernel headers >= 3.2"
 	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 
+# glibc >= 2.26 require kernel headers >= 3.10 on powerpc64le.
+comment "glibc on powerpc64le needs a toolchain w/ headers >= 3.10"
+	depends on BR2_powerpc64le
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+
 config BR2_TOOLCHAIN_BUILDROOT_MUSL
 	bool "musl"
 	depends on BR2_aarch64	  || BR2_arm     || BR2_armeb     || BR2_i386 || \
Signature · 1 line
2.9.5
#10 lore raw

PATCH v3 4/7 package/gcc: enable float128 on powerpc64le with glibc >= 2.26 toolchains

In reply to Romain Naour

float128 is now required on powerpc64le with glibc >= 2.26 toolchains.

Fixes:
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/powerpc/powerpc64le
checking if [...]powerpc64le-buildroot-linux-gnu-gcc supports binary128 floating point type... no checking if the target machine is at least POWER8... yes
configure: error: *** binary128 floating point type (GCC >= 6.2) is required on powerpc64le.

In order to prepare the glibc bump to this version, we enable binary128 floating point in gcc. This require at least gcc >= 6.2.

Disable gcc 4.x and 5.x for internal toolchain.

---
v2: Disable gcc 4.x and 5.x for internal toolchain.

---
 package/gcc/Config.in.host | 4 ++++
 package/gcc/gcc.mk         | 8 ++++++++
 2 files changed, 12 insertions(+)
package/gcc/Config.in.host +4 -0
index ec7b692..0926560 100644
@@ -39,6 +39,8 @@ config BR2_GCC_VERSION_4_9_X
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64le))
 	# musl mips64 unsupported
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el))
+	# glibc >= 2.26 needs gcc >= 6.2
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC && BR2_powerpc64le)
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
 
 config BR2_GCC_VERSION_5_X
@@ -53,6 +55,8 @@ config BR2_GCC_VERSION_5_X
 	depends on !BR2_mips_interaptiv && !BR2_mips_m5150 && !BR2_mips_i6400
 	# musl mips64 unsupported
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el))
+	# glibc >= 2.26 needs gcc >= 6.2
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC && BR2_powerpc64le)
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_5
 
 config BR2_GCC_VERSION_6_X
package/gcc/gcc.mk +8 -0
index 49ccccf..54ef70c 100644
@@ -254,6 +254,14 @@ HOST_GCC_COMMON_CONF_OPTS += \
 	--without-long-double-128
 endif
 
+# Since glibc >= 2.26, poerpc64le requires double/long double which
+# requires at least gcc 6.2.
+# See sysdeps/powerpc/powerpc64le/configure.ac
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC)$(BR2_TOOLCHAIN_GCC_AT_LEAST_6)$(BR2_powerpc64le),yyy)
+HOST_GCC_COMMON_CONF_OPTS += \
+	--with-long-double-128
+endif
+
 HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"'
 ifeq ($(BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS),)
 ifeq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),)
Signature · 1 line
2.9.5
#11 lore raw

PATCH v3 4/7 package/gcc: enable float128 on powerpc64le with glibc >= 2.26 toolchains

Romain, All,

On 2017-09-23 23:24 +0200, Romain Naour spake thusly:

Quoted 9 lines

float128 is now required on powerpc64le with glibc >= 2.26 toolchains.

Fixes:
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/powerpc/powerpc64le
checking if [...]powerpc64le-buildroot-linux-gnu-gcc supports binary128 floating point type... no checking if the target machine is at least POWER8... yes
configure: error: *** binary128 floating point type (GCC >= 6.2) is required on powerpc64le.

Quoted 6 lines

In order to prepare the glibc bump to this version, we enable binary128 floating point in gcc. This require at least gcc >= 6.2.

Disable gcc 4.x and 5.x for internal toolchain.

Small nit below...

Quoted 34 lines

---
v2: Disable gcc 4.x and 5.x for internal toolchain.

---
 package/gcc/Config.in.host | 4 ++++
 package/gcc/gcc.mk         | 8 ++++++++
 2 files changed, 12 insertions(+)
package/gcc/Config.in.host +4 -0
index ec7b692..0926560 100644
@@ -39,6 +39,8 @@ config BR2_GCC_VERSION_4_9_X
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64le))
 	# musl mips64 unsupported
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el))
+	# glibc >= 2.26 needs gcc >= 6.2
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC && BR2_powerpc64le)
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
 
 config BR2_GCC_VERSION_5_X
@@ -53,6 +55,8 @@ config BR2_GCC_VERSION_5_X
 	depends on !BR2_mips_interaptiv && !BR2_mips_m5150 && !BR2_mips_i6400
 	# musl mips64 unsupported
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el))
+	# glibc >= 2.26 needs gcc >= 6.2
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC && BR2_powerpc64le)
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_5
 
 config BR2_GCC_VERSION_6_X
package/gcc/gcc.mk +0 -0
index 49ccccf..54ef70c 100644

package/gcc/gcc.mk HOST_GCC_COMMON_CONF_OPTS += \ · line 262

Quoted 9 lines
package/gcc/gcc.mk +6 -0
@@ -254,6 +254,14 @@ HOST_GCC_COMMON_CONF_OPTS += \
 	--without-long-double-128
 endif
 
+# Since glibc >= 2.26, poerpc64le requires double/long double which
+# requires at least gcc 6.2.
+# See sysdeps/powerpc/powerpc64le/configure.ac
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC)$(BR2_TOOLCHAIN_GCC_AT_LEAST_6)$(BR2_powerpc64le),yyy)
+HOST_GCC_COMMON_CONF_OPTS += \
+	--with-long-double-128

Could very well have been on a single line.

Otherwise:

Regards,
Yann E. MORIN.

Quoted 12 lines
package/gcc/gcc.mk +2 -0
+endif
+
 HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"'
 ifeq ($(BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS),)
 ifeq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),)
Signature · 6 lines
2.9.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#12 lore raw

PATCH v3 4/7 package/gcc: enable float128 on powerpc64le with glibc >= 2.26 toolchains

Quoted 3 lines · Yann E. MORIN

Romain, All,

On 2017-09-23 23:24 +0200, Romain Naour spake thusly:

[snip]

Quoted 4 lines
Quoted 4 lines
package/gcc/gcc.mk +0 -0
@@ -254,6 +254,14 @@ HOST_GCC_COMMON_CONF_OPTS += \
 	--without-long-double-128
 endif
 
Quoted 8 lines

package/gcc/gcc.mk HOST_GCC_COMMON_CONF_OPTS += \ · line 262

Quoted 6 lines
package/gcc/gcc.mk +6 -0
+# Since glibc >= 2.26, poerpc64le requires double/long double which
+# requires at least gcc 6.2.
+# See sysdeps/powerpc/powerpc64le/configure.ac
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC)$(BR2_TOOLCHAIN_GCC_AT_LEAST_6)$(BR2_powerpc64le),yyy)
+HOST_GCC_COMMON_CONF_OPTS += \
+	--with-long-double-128

Could very well have been on a single line.

I didn't change this, because the way it is now it's similar to the other 3
instances of --with-long-double-128 which makes it easier to spot the repetition.

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#13 lore raw

v3 cover glibc: bump to 2.26

In reply to Romain Naour

This series bump glibc to the latest release and allow to remove all patches required for the previous version! But glibc come with some new issue that are hopefully already fixed in the 2.26.x stable branch.

While testing this new version, some build issues has been dicovered. Two gcc patch are needed to build a toolchain with older compiler (gcc 4.9 to 6.4), gcc 7.2 contain already the fix.

Backport a series related to bug 21930 and 22146. Without them the float128 support break the C++ build for some packages.

https://sourceware.org/bugzilla/show_bug.cgi?id=21930
https://sourceware.org/bugzilla/show_bug.cgi?id=22146

This third series is for testing and review. Let's hope that glibc 2.26.1 will be released soon :)

Best regards,
Romain

Romain Naour (7):
package/gcc: fix build issue with glibc 2.26 package/gcc: fix build issue with glibc 2.26 package/glibc: needs kernel headers >= 3.10 on powerpc64le package/gcc: enable float128 on powerpc64le with glibc >= 2.26
toolchains
package/diffutils: disable getopt_long replacement with glibc package/flex: disable reallocarray
package/glibc: bump to 2.26

 package/diffutils/diffutils.mk                     |   6 +
 package/flex/flex.mk                               |   3 +-
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 190 ++++++++++++
 package/gcc/4.9.4/944-sanitizer-linux.patch        |  88 ++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++
 package/gcc/5.4.0/944-sanitizer-linux.patch        |  91 ++++++
 ...t_t-not-struct-ucontext-in-linux-unwind.h.patch | 192 +++++++++++++
 package/gcc/6.4.0/943-sanitizer-linux.patch        |  91 ++++++
 package/gcc/Config.in.host                         |   4 +
 package/gcc/gcc.mk                                 |   8 +
 ...__builtin_types_compatible_p-in-C-mode-bu.patch |  50 ++++
 .../glibc/0001-sh-Fix-building-with-gcc5-6.patch   |  56 ----
 ...00366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch |  35 ---
 ...02-Do-not-use-generic-selection-in-C-mode.patch |  56 ++++
 ...-version-of-issignaling-that-does-not-use.patch | 225 +++++++++++++++
 ...ject-overly-long-LD_PRELOAD-path-elements.patch | 122 --------
 ...ersion-of-issignaling-when-__NO_LONG_DOUB.patch |  47 +++
 ...Reject-overly-long-LD_AUDIT-path-elements.patch | 204 -------------
 ...-version-of-iszero-that-does-not-use-__MA.patch | 210 ++++++++++++++
 package/glibc/0005-fix-binutils-2-29-build.patch   |  65 -----
 ...ify-use-the-builtin-when-optimizing-for-s.patch |  63 ++++
 ...g-IS_IN-libc-guards-to-vectorized-strcspn.patch |  47 ---
 package/glibc/0006-sh4-trap.patch                  | 318 ---------------------
 package/glibc/glibc.hash                           |   2 +-
 package/glibc/glibc.mk                             |   2 +-
 toolchain/toolchain-buildroot/Config.in            |   6 +
 26 files changed, 1523 insertions(+), 850 deletions(-)
 create mode 100644 package/gcc/4.9.4/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/4.9.4/944-sanitizer-linux.patch
 create mode 100644 package/gcc/5.4.0/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/5.4.0/944-sanitizer-linux.patch
 create mode 100644 package/gcc/6.4.0/942-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
 create mode 100644 package/gcc/6.4.0/943-sanitizer-linux.patch
 create mode 100644 package/glibc/0001-Do-not-use-__builtin_types_compatible_p-in-C-mode-bu.patch
 delete mode 100644 package/glibc/0001-sh-Fix-building-with-gcc5-6.patch
 delete mode 100644 package/glibc/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
 create mode 100644 package/glibc/0002-Do-not-use-generic-selection-in-C-mode.patch
 create mode 100644 package/glibc/0003-Provide-a-C-version-of-issignaling-that-does-not-use.patch
 delete mode 100644 package/glibc/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
 create mode 100644 package/glibc/0004-Fix-the-C-version-of-issignaling-when-__NO_LONG_DOUB.patch
 delete mode 100644 package/glibc/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch
 create mode 100644 package/glibc/0005-Provide-a-C-version-of-iszero-that-does-not-use-__MA.patch
 delete mode 100644 package/glibc/0005-fix-binutils-2-29-build.patch
 create mode 100644 package/glibc/0006-Let-fpclassify-use-the-builtin-when-optimizing-for-s.patch
 delete mode 100644 package/glibc/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch
 delete mode 100644 package/glibc/0006-sh4-trap.patch
Signature · 1 line
2.9.5
#14 lore raw

v3 cover glibc: bump to 2.26

This series was send twice... sorry for the noise.

Romain

#15 lore raw

PATCH v3 4/7 package/gcc: enable float128 on powerpc64le with glibc >= 2.26 toolchains

In reply to Romain Naour

float128 is now required on powerpc64le with glibc >= 2.26 toolchains.

Fixes:
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/powerpc/powerpc64le
checking if [...]powerpc64le-buildroot-linux-gnu-gcc supports binary128 floating point type... no checking if the target machine is at least POWER8... yes
configure: error: *** binary128 floating point type (GCC >= 6.2) is required on powerpc64le.

In order to prepare the glibc bump to this version, we enable binary128 floating point in gcc. This require at least gcc >= 6.2.

Disable gcc 4.x and 5.x for internal toolchain.

---
v2: Disable gcc 4.x and 5.x for internal toolchain.

---
 package/gcc/Config.in.host | 4 ++++
 package/gcc/gcc.mk         | 8 ++++++++
 2 files changed, 12 insertions(+)
package/gcc/Config.in.host +4 -0
index ec7b692..0926560 100644
@@ -39,6 +39,8 @@ config BR2_GCC_VERSION_4_9_X
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64le))
 	# musl mips64 unsupported
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el))
+	# glibc >= 2.26 needs gcc >= 6.2
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC && BR2_powerpc64le)
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
 
 config BR2_GCC_VERSION_5_X
@@ -53,6 +55,8 @@ config BR2_GCC_VERSION_5_X
 	depends on !BR2_mips_interaptiv && !BR2_mips_m5150 && !BR2_mips_i6400
 	# musl mips64 unsupported
 	depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el))
+	# glibc >= 2.26 needs gcc >= 6.2
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC && BR2_powerpc64le)
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_5
 
 config BR2_GCC_VERSION_6_X
package/gcc/gcc.mk +8 -0
index 49ccccf..54ef70c 100644
@@ -254,6 +254,14 @@ HOST_GCC_COMMON_CONF_OPTS += \
 	--without-long-double-128
 endif
 
+# Since glibc >= 2.26, poerpc64le requires double/long double which
+# requires at least gcc 6.2.
+# See sysdeps/powerpc/powerpc64le/configure.ac
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC)$(BR2_TOOLCHAIN_GCC_AT_LEAST_6)$(BR2_powerpc64le),yyy)
+HOST_GCC_COMMON_CONF_OPTS += \
+	--with-long-double-128
+endif
+
 HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"'
 ifeq ($(BR2_GCC_ARCH_HAS_CONFIGURABLE_DEFAULTS),)
 ifeq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),)
Signature · 1 line
2.9.5
#16 lore raw

PATCH v3 5/7 package/diffutils: disable getopt_long replacement with glibc

In reply to Romain Naour

Since glibc >= 2.26, don't try to use getopt_long replacement bundled with diffutils. It will conflict with the one from glibc.
The getopt copy bundled in glibc has been updated with the one from gnulib.

After a lot of warnings...
Fixes:
xstrtol-error.c: In function 'xstrtol_error':
xstrtol-error.c:84:26: error: invalid use of undefined type 'struct rpl_option'

     option = long_options[opt_idx].name;
                          ^

xstrtol-error.c:84:26: error: dereferencing pointer to incomplete type 'const struct rpl_option'

[...]

xstrtol-error.c:92:1: error: conflicting types for 'xstrtol_fatal'
xstrtol_fatal (enum strtol_error err,
^~~~~~~~~~~~~
In file included from xstrtol-error.c:20:0:
xstrtol.h:69:16: note: previous declaration of 'xstrtol_fatal' was here
_Noreturn void xstrtol_fatal (enum strtol_error,

                ^~~~~~~~~~~~~
---
 package/diffutils/diffutils.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/diffutils/diffutils.mk +6 -0
index 6e5b9b6..79785d6 100644
@@ -11,6 +11,12 @@ DIFFUTILS_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
 DIFFUTILS_LICENSE = GPL-3.0+
 DIFFUTILS_LICENSE_FILES = COPYING
 
+# Since glibc >= 2.26, don't try to use getopt_long replacement bundled
+# with diffutils. It will conflict with the one from glibc.
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
+DIFFUTILS_CONF_ENV += gl_cv_func_getopt_gnu=yes
+endif
+
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 DIFFUTILS_DEPENDENCIES += busybox
 endif
Signature · 1 line
2.9.5
#17 lore raw

PATCH v3 5/7 package/diffutils: disable getopt_long replacement with glibc

Romain, All,

On 2017-09-23 23:24 +0200, Romain Naour spake thusly:

Quoted 3 lines

Since glibc >= 2.26, don't try to use getopt_long replacement bundled with diffutils. It will conflict with the one from glibc.
The getopt copy bundled in glibc has been updated with the one from gnulib.

Yeah, because gnulib was such a bright idea... ;-)

Quoted 16 lines

After a lot of warnings...
Fixes:
xstrtol-error.c: In function 'xstrtol_error':
xstrtol-error.c:84:26: error: invalid use of undefined type 'struct rpl_option'

     option = long_options[opt_idx].name;
                          ^

xstrtol-error.c:84:26: error: dereferencing pointer to incomplete type 'const struct rpl_option'

[...]

xstrtol-error.c:92:1: error: conflicting types for 'xstrtol_fatal'
xstrtol_fatal (enum strtol_error err,
^~~~~~~~~~~~~
In file included from xstrtol-error.c:20:0:
xstrtol.h:69:16: note: previous declaration of 'xstrtol_fatal' was here
_Noreturn void xstrtol_fatal (enum strtol_error,

Quoted 3 lines
                ^~~~~~~~~~~~~

Regards,
Yann E. MORIN.

Quoted 28 lines
---
 package/diffutils/diffutils.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/diffutils/diffutils.mk +6 -0
index 6e5b9b6..79785d6 100644
@@ -11,6 +11,12 @@ DIFFUTILS_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
 DIFFUTILS_LICENSE = GPL-3.0+
 DIFFUTILS_LICENSE_FILES = COPYING
 
+# Since glibc >= 2.26, don't try to use getopt_long replacement bundled
+# with diffutils. It will conflict with the one from glibc.
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
+DIFFUTILS_CONF_ENV += gl_cv_func_getopt_gnu=yes
+endif
+
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 DIFFUTILS_DEPENDENCIES += busybox
 endif
Signature · 6 lines
2.9.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#18 lore raw

PATCH v3 5/7 package/diffutils: disable getopt_long replacement with glibc

In reply to Romain Naour

Since glibc >= 2.26, don't try to use getopt_long replacement bundled with diffutils. It will conflict with the one from glibc.
The getopt copy bundled in glibc has been updated with the one from gnulib.

After a lot of warnings...
Fixes:
xstrtol-error.c: In function 'xstrtol_error':
xstrtol-error.c:84:26: error: invalid use of undefined type 'struct rpl_option'

     option = long_options[opt_idx].name;
                          ^

xstrtol-error.c:84:26: error: dereferencing pointer to incomplete type 'const struct rpl_option'

[...]

xstrtol-error.c:92:1: error: conflicting types for 'xstrtol_fatal'
xstrtol_fatal (enum strtol_error err,
^~~~~~~~~~~~~
In file included from xstrtol-error.c:20:0:
xstrtol.h:69:16: note: previous declaration of 'xstrtol_fatal' was here
_Noreturn void xstrtol_fatal (enum strtol_error,

                ^~~~~~~~~~~~~
---
 package/diffutils/diffutils.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/diffutils/diffutils.mk +6 -0
index 6e5b9b6..79785d6 100644
@@ -11,6 +11,12 @@ DIFFUTILS_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
 DIFFUTILS_LICENSE = GPL-3.0+
 DIFFUTILS_LICENSE_FILES = COPYING
 
+# Since glibc >= 2.26, don't try to use getopt_long replacement bundled
+# with diffutils. It will conflict with the one from glibc.
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
+DIFFUTILS_CONF_ENV += gl_cv_func_getopt_gnu=yes
+endif
+
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 DIFFUTILS_DEPENDENCIES += busybox
 endif
Signature · 1 line
2.9.5
#19 lore raw

PATCH v3 6/7 package/flex: disable reallocarray

In reply to Romain Naour

This doesn't compile with glibc 2.26 where reallocarray() as been introduced.

It's a nasty issue, when reallocarray() is available for the target, flex will build a small tool called stage1flex for the host (using _FOR_BUILD) but with the config.h generated for the target.

When the host doesn't have a glibc >= 2.26, reallocarray() is never defined while building stage1flex:

misc.c:147:8: warning : implicit declaration of function ? reallocarray ? [-Wimplicit-function-declaration]

  mem = reallocarray(NULL, (size_t) size, element_size);
        ^~~~~~~~~~~~
misc.c:147:6: warning : assignment makes pointer from integer without a cast
[-Wint-conversion]
  mem = reallocarray(NULL, (size_t) size, element_size);
      ^

Disable reallocarray for now, reallocarray() support may be enabled in a followup patch.

Fixes:
stage1flex-misc.o: In function `allocate_array':
misc.c:(.text+0x38f): undefined reference to reallocarray' stage1flex-misc.o: In function reallocate_array':
misc.c:(.text+0xc8a): undefined reference to `reallocarray'
collect2: error: ld returned 1 exit status

---
 package/flex/flex.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/flex/flex.mk +2 -1
index b782699..0196624 100644
@@ -10,7 +10,8 @@ FLEX_INSTALL_STAGING = YES
 FLEX_LICENSE = FLEX
 FLEX_LICENSE_FILES = COPYING
 FLEX_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-m4
-FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
+FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4 \
+	ac_cv_func_reallocarray=no
 HOST_FLEX_DEPENDENCIES = host-m4
 
 define FLEX_DISABLE_PROGRAM
Signature · 1 line
2.9.5
#20 lore raw

PATCH v3 6/7 package/flex: disable reallocarray

Romain, All,

On 2017-09-23 23:24 +0200, Romain Naour spake thusly:

Quoted 18 lines

This doesn't compile with glibc 2.26 where reallocarray() as been introduced.

It's a nasty issue, when reallocarray() is available for the target, flex will build a small tool called stage1flex for the host (using _FOR_BUILD) but with the config.h generated for the target.

When the host doesn't have a glibc >= 2.26, reallocarray() is never defined while building stage1flex:

misc.c:147:8: warning : implicit declaration of function ? reallocarray ? [-Wimplicit-function-declaration]

  mem = reallocarray(NULL, (size_t) size, element_size);
        ^~~~~~~~~~~~
misc.c:147:6: warning : assignment makes pointer from integer without a cast
[-Wint-conversion]
  mem = reallocarray(NULL, (size_t) size, element_size);
      ^
Quoted 2 lines

Disable reallocarray for now, reallocarray() support may be enabled in a followup patch.

What about https://patchwork.ozlabs.org/patch/813474/ which just backports a fix from upstream (or I'm mislead)?

Regards,
Yann E. MORIN.

Quoted 33 lines

Fixes:
stage1flex-misc.o: In function `allocate_array':
misc.c:(.text+0x38f): undefined reference to reallocarray' stage1flex-misc.o: In function reallocate_array':
misc.c:(.text+0xc8a): undefined reference to `reallocarray'
collect2: error: ld returned 1 exit status

---
 package/flex/flex.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/flex/flex.mk +2 -1
index b782699..0196624 100644
@@ -10,7 +10,8 @@ FLEX_INSTALL_STAGING = YES
 FLEX_LICENSE = FLEX
 FLEX_LICENSE_FILES = COPYING
 FLEX_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-m4
-FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
+FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4 \
+	ac_cv_func_reallocarray=no
 HOST_FLEX_DEPENDENCIES = host-m4
 
 define FLEX_DISABLE_PROGRAM
Signature · 6 lines
2.9.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#21 lore raw

PATCH v3 6/7 package/flex: disable reallocarray

Le 27/09/2017 ? 23:05, Yann E. MORIN a ?crit?:

Quoted 21 lines

Romain, All,

On 2017-09-23 23:24 +0200, Romain Naour spake thusly:

Quoted 18 lines

This doesn't compile with glibc 2.26 where reallocarray() as been introduced.

It's a nasty issue, when reallocarray() is available for the target, flex will build a small tool called stage1flex for the host (using _FOR_BUILD) but with the config.h generated for the target.

When the host doesn't have a glibc >= 2.26, reallocarray() is never defined while building stage1flex:

misc.c:147:8: warning : implicit declaration of function ? reallocarray ? [-Wimplicit-function-declaration]

  mem = reallocarray(NULL, (size_t) size, element_size);
        ^~~~~~~~~~~~
misc.c:147:6: warning : assignment makes pointer from integer without a cast
[-Wint-conversion]
  mem = reallocarray(NULL, (size_t) size, element_size);
      ^
Quoted 5 lines
Quoted 2 lines

Disable reallocarray for now, reallocarray() support may be enabled in a followup patch.

What about https://patchwork.ozlabs.org/patch/813474/ which just backports a fix from upstream (or I'm mislead)?

No, this patch is fixing host-flex (segfault). not flex (link issue).

I haven't had the time to investigate further but stage1flex seems using the config result for the target while building a host tool. So the reallocarray() code is used on a host machine where it is not in the host glibc.

Best regards,
Romain

Quoted 38 lines

Regards,
Yann E. MORIN.

Quoted 33 lines

Fixes:
stage1flex-misc.o: In function `allocate_array':
misc.c:(.text+0x38f): undefined reference to reallocarray' stage1flex-misc.o: In function reallocate_array':
misc.c:(.text+0xc8a): undefined reference to `reallocarray'
collect2: error: ld returned 1 exit status

---
 package/flex/flex.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/flex/flex.mk +2 -1
index b782699..0196624 100644
@@ -10,7 +10,8 @@ FLEX_INSTALL_STAGING = YES
 FLEX_LICENSE = FLEX
 FLEX_LICENSE_FILES = COPYING
 FLEX_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-m4
-FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
+FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4 \
+	ac_cv_func_reallocarray=no
 HOST_FLEX_DEPENDENCIES = host-m4
 
 define FLEX_DISABLE_PROGRAM
Signature · 6 lines
2.9.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
#22 lore raw

PATCH v3 6/7 package/flex: disable reallocarray

In reply to Romain Naour

This doesn't compile with glibc 2.26 where reallocarray() as been introduced.

It's a nasty issue, when reallocarray() is available for the target, flex will build a small tool called stage1flex for the host (using _FOR_BUILD) but with the config.h generated for the target.

When the host doesn't have a glibc >= 2.26, reallocarray() is never defined while building stage1flex:

misc.c:147:8: warning : implicit declaration of function ? reallocarray ? [-Wimplicit-function-declaration]

  mem = reallocarray(NULL, (size_t) size, element_size);
        ^~~~~~~~~~~~
misc.c:147:6: warning : assignment makes pointer from integer without a cast
[-Wint-conversion]
  mem = reallocarray(NULL, (size_t) size, element_size);
      ^

Disable reallocarray for now, reallocarray() support may be enabled in a followup patch.

Fixes:
stage1flex-misc.o: In function `allocate_array':
misc.c:(.text+0x38f): undefined reference to reallocarray' stage1flex-misc.o: In function reallocate_array':
misc.c:(.text+0xc8a): undefined reference to `reallocarray'
collect2: error: ld returned 1 exit status

---
 package/flex/flex.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/flex/flex.mk +2 -1
index b782699..0196624 100644
@@ -10,7 +10,8 @@ FLEX_INSTALL_STAGING = YES
 FLEX_LICENSE = FLEX
 FLEX_LICENSE_FILES = COPYING
 FLEX_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-m4
-FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
+FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4 \
+	ac_cv_func_reallocarray=no
 HOST_FLEX_DEPENDENCIES = host-m4
 
 define FLEX_DISABLE_PROGRAM
Signature · 1 line
2.9.5
#23 lore raw

PATCH v3 7/7 package/glibc: bump to 2.26

In reply to Romain Naour

Drop upstream patch:

0001-sh-Fix-building-with-gcc5-6.patch
https://sourceware.org/git/?p=glibc.git;a=commit;h=d40dbe722f004f999b589de776f7e57e564dda01

0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
https://sourceware.org/git/?p=glibc.git;a=commit;h=f6110a8fee2ca36f8e2d2abecf3cba9fa7b8ea7d

0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
https://sourceware.org/git/?p=glibc.git;a=commit;h=6d0ba622891bed9d8394eef1935add53003b12e8

0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch

https://sourceware.org/git/?p=glibc.git;a=commit;h=81b82fb966ffbd94353f793ad17116c6088dedd9

0005-fix-binutils-2-29-build.patch
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=388b4f1a02f3a801965028bbfcd48d905638b797

0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=69052a3a95da37169a08f9e59b2cc1808312753c

0006-sh4-trap.patch
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=db3d848e154b00071f4a5e729d5884efad410109

But 2.26 version introduced quite a few regressions on x86, x86_64 and powerpc64le when float128 support was added. All these issues are now fixed in the glibc 2.26 stable branch.

Backport patches from glibc 2.26 stable branch related to bug 21930. Take all patches listed in this bug report in order to have all fix for this issue [1] [2].

Fixes gnuradio build:
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp: In function ?std::size_t boost::hash_detail::float_hash_value(T)?:
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: expected primary-expression before ?float?

             switch (fpclassify(v))
                     ^
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: expected primary-expression before ?long?
             switch (fpclassify(v))
                     ^
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: found ?:? in nested-name-specifier, expected ?::?
             switch (fpclassify(v))
                     ^
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: ?_Float128? is not a class or namespace
             switch (fpclassify(v))
                     ^

[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: ?_Generic? was not declared in this scope

             switch (fpclassify(v))
                     ^

Also backport fix for glibc bug 22146.
Without this patch some C++ applications (jsoncpp, mesa3d and kodi) fail to build due to an issue while building the toolchain.

A test in the libstdc++ configure script fail when -Os and float128 are used.

See the bug report for details [3].

[1] https://sourceware.org/ml/libc-alpha/2017-08/msg00586.html
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=21930
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=22146

Cc Thomas Petazzoni <[email protected]>
---
 ...__builtin_types_compatible_p-in-C-mode-bu.patch |  50 ++++
 .../glibc/0001-sh-Fix-building-with-gcc5-6.patch   |  56 ----
 ...00366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch |  35 ---
 ...02-Do-not-use-generic-selection-in-C-mode.patch |  56 ++++
 ...-version-of-issignaling-that-does-not-use.patch | 225 +++++++++++++++
 ...ject-overly-long-LD_PRELOAD-path-elements.patch | 122 --------
 ...ersion-of-issignaling-when-__NO_LONG_DOUB.patch |  47 +++
 ...Reject-overly-long-LD_AUDIT-path-elements.patch | 204 -------------
 ...-version-of-iszero-that-does-not-use-__MA.patch | 210 ++++++++++++++
 package/glibc/0005-fix-binutils-2-29-build.patch   |  65 -----
 ...ify-use-the-builtin-when-optimizing-for-s.patch |  63 ++++
 ...g-IS_IN-libc-guards-to-vectorized-strcspn.patch |  47 ---
 package/glibc/0006-sh4-trap.patch                  | 318 ---------------------
 package/glibc/glibc.hash                           |   2 +-
 package/glibc/glibc.mk                             |   2 +-
 15 files changed, 653 insertions(+), 849 deletions(-)
 create mode 100644 package/glibc/0001-Do-not-use-__builtin_types_compatible_p-in-C-mode-bu.patch
 delete mode 100644 package/glibc/0001-sh-Fix-building-with-gcc5-6.patch
 delete mode 100644 package/glibc/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
 create mode 100644 package/glibc/0002-Do-not-use-generic-selection-in-C-mode.patch
 create mode 100644 package/glibc/0003-Provide-a-C-version-of-issignaling-that-does-not-use.patch
 delete mode 100644 package/glibc/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
 create mode 100644 package/glibc/0004-Fix-the-C-version-of-issignaling-when-__NO_LONG_DOUB.patch
 delete mode 100644 package/glibc/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch
 create mode 100644 package/glibc/0005-Provide-a-C-version-of-iszero-that-does-not-use-__MA.patch
 delete mode 100644 package/glibc/0005-fix-binutils-2-29-build.patch
 create mode 100644 package/glibc/0006-Let-fpclassify-use-the-builtin-when-optimizing-for-s.patch
 delete mode 100644 package/glibc/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch
 delete mode 100644 package/glibc/0006-sh4-trap.patch
package/glibc/0001-Do-not-use-__builtin_types_compatible_p-in-C-mode-bu.patch new file +50 -0
new file mode 100644
index 0000000..27a785e
@@ -0,0 +1,50 @@
+From f7439f9b1089e17b6721f28e228682831a2f0135 Mon Sep 17 00:00:00 2001
+From: "Gabriel F. T. Gomes" <[email protected]>
+Date: Mon, 21 Aug 2017 14:23:27 +0200
+Subject: [PATCH] Do not use __builtin_types_compatible_p in C++ mode (bug
+ 21930)
+
+The logic to define isinf for float128 depends on the availability of
+__builtin_types_compatible_p, which is only available in C mode,
+however, the conditionals do not check for C or C++ mode.  This lead to
+an error in libstdc++ configure, as reported by bug 21930.
+
+This patch adds a conditional for C mode in the definition of isinf for
+float128.  No definition is provided in C++ mode, since libstdc++
+headers undefine isinf.
+
+Tested for powerpc64le (glibc test suite and libstdc++-v3 configure).
+
+	[BZ #21930]
+	* math/math.h (isinf): Check if in C or C++ mode before using
+	__builtin_types_compatible_p, since this is a C mode feature.
+
+(cherry picked from commit 47a67213a9f51c5f8816d240500b10db605d8b77)
+[Romain rebase on glibc 2.26]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ math/math.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/math/math.h b/math/math.h
+index e217080..dea8dbe 100644
+--- a/math/math.h
++++ b/math/math.h
+@@ -442,8 +442,12 @@ enum
+ 
+ /* Return nonzero value if X is positive or negative infinity.  */
+ # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
+-     && !defined __SUPPORT_SNAN__
+-   /* __builtin_isinf_sign is broken for float128 only before GCC 7.0.  */
++     && !defined __SUPPORT_SNAN__ && !defined __cplusplus
++   /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
++      use the helper function, __isinff128, with older compilers.  This is
++      only provided for C mode, because in C++ mode, GCC has no support
++      for __builtin_types_compatible_p (and when in C++ mode, this macro is
++      not used anyway, because libstdc++ headers undefine it).  */
+ #  define isinf(x) \
+     (__builtin_types_compatible_p (__typeof (x), _Float128) \
+      ? __isinff128 (x) : __builtin_isinf_sign (x))
+-- 
+2.9.5
+
package/glibc/0001-sh-Fix-building-with-gcc5-6.patch deleted +0 -56

56 lines not on this page · raw message

package/glibc/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch deleted +0 -35
deleted file mode 100644
index d701294..0000000
@@ -1,35 +0,0 @@
-From f6110a8fee2ca36f8e2d2abecf3cba9fa7b8ea7d Mon Sep 17 00:00:00 2001
-From: Florian Weimer <[email protected]>
-Date: Mon, 19 Jun 2017 17:09:55 +0200
-Subject: [PATCH] CVE-2017-1000366: Ignore LD_LIBRARY_PATH for AT_SECURE=1
- programs [BZ #21624]
-
-LD_LIBRARY_PATH can only be used to reorder system search paths, which
-is not useful functionality.
-
-This makes an exploitable unbounded alloca in _dl_init_paths unreachable
-for AT_SECURE=1 programs.
-
-[Peter: Drop ChangeLog modification]
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- elf/rtld.c | 3 ++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/elf/rtld.c b/elf/rtld.c
-index 2446a87680..2269dbec81 100644
---- a/elf/rtld.c
-+++ b/elf/rtld.c
-@@ -2422,7 +2422,8 @@ process_envvars (enum mode *modep)
- 
- 	case 12:
- 	  /* The library search path.  */
--	  if (memcmp (envline, "LIBRARY_PATH", 12) == 0)
-+	  if (!__libc_enable_secure
-+	      && memcmp (envline, "LIBRARY_PATH", 12) == 0)
- 	    {
- 	      library_path = &envline[13];
- 	      break;
--- 
-2.11.0
-
package/glibc/0002-Do-not-use-generic-selection-in-C-mode.patch new file +56 -0

56 lines not on this page · raw message

package/glibc/0003-Provide-a-C-version-of-issignaling-that-does-not-use.patch new file +225 -0

225 lines not on this page · raw message

package/glibc/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch deleted +0 -122

122 lines not on this page · raw message

package/glibc/0004-Fix-the-C-version-of-issignaling-when-__NO_LONG_DOUB.patch new file +47 -0

47 lines not on this page · raw message

package/glibc/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch deleted +0 -204

204 lines not on this page · raw message

package/glibc/0005-Provide-a-C-version-of-iszero-that-does-not-use-__MA.patch new file +210 -0

210 lines not on this page · raw message

package/glibc/0005-fix-binutils-2-29-build.patch deleted +0 -65

65 lines not on this page · raw message

package/glibc/0006-Let-fpclassify-use-the-builtin-when-optimizing-for-s.patch new file +63 -0

63 lines not on this page · raw message

package/glibc/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch deleted +0 -47

47 lines not on this page · raw message

package/glibc/0006-sh4-trap.patch deleted +0 -318

318 lines not on this page · raw message

package/glibc/glibc.hash +1 -1
index daaf014..afae10f 100644
@@ -1,2 +1,2 @@
 # Locally calculated after checking pgp signature (glibc)
-sha256	067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0	glibc-2.25.tar.xz
+sha256	e54e0a934cd2bc94429be79da5e9385898d2306b9eaf3c92d5a77af96190f6bd	glibc-2.26.tar.xz
package/glibc/glibc.mk +1 -1
index c9a6579..f5d0282 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-GLIBC_VERSION = 2.25
+GLIBC_VERSION = 2.26
 GLIBC_SITE = $(BR2_GNU_MIRROR)/libc
 GLIBC_SOURCE = glibc-$(GLIBC_VERSION).tar.xz
 GLIBC_SRC_SUBDIR = .
Signature · 1 line
2.9.5
#24 lore raw

PATCH v3 7/7 package/glibc: bump to 2.26

Am Sat, 23 Sep 2017 23:24:06 +0200 schrieb Romain Naour:

package/glibc/glibc.mk line 7

Quoted 2 lines
package/glibc/glibc.mk +1 -1
-GLIBC_VERSION = 2.25
+GLIBC_VERSION = 2.26

Hi,

Build-tested using these defconfigs:

BR2_x86_64=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_KODI=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_I965=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_PY_ONLY=y

BR2_powerpc64le=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_KODI=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_PY_ONLY=y

#25 lore raw

PATCH v3 7/7 package/glibc: bump to 2.26

In reply to Romain Naour

Drop upstream patch:

0001-sh-Fix-building-with-gcc5-6.patch
https://sourceware.org/git/?p=glibc.git;a=commit;h=d40dbe722f004f999b589de776f7e57e564dda01

0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
https://sourceware.org/git/?p=glibc.git;a=commit;h=f6110a8fee2ca36f8e2d2abecf3cba9fa7b8ea7d

0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
https://sourceware.org/git/?p=glibc.git;a=commit;h=6d0ba622891bed9d8394eef1935add53003b12e8

0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch

https://sourceware.org/git/?p=glibc.git;a=commit;h=81b82fb966ffbd94353f793ad17116c6088dedd9

0005-fix-binutils-2-29-build.patch
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=388b4f1a02f3a801965028bbfcd48d905638b797

0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=69052a3a95da37169a08f9e59b2cc1808312753c

0006-sh4-trap.patch
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=db3d848e154b00071f4a5e729d5884efad410109

But 2.26 version introduced quite a few regressions on x86, x86_64 and powerpc64le when float128 support was added. All these issues are now fixed in the glibc 2.26 stable branch.

Backport patches from glibc 2.26 stable branch related to bug 21930. Take all patches listed in this bug report in order to have all fix for this issue [1] [2].

Fixes gnuradio build:
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp: In function ?std::size_t boost::hash_detail::float_hash_value(T)?:
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: expected primary-expression before ?float?

             switch (fpclassify(v))
                     ^
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: expected primary-expression before ?long?
             switch (fpclassify(v))
                     ^
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: found ?:? in nested-name-specifier, expected ?::?
             switch (fpclassify(v))
                     ^
[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: ?_Float128? is not a class or namespace
             switch (fpclassify(v))
                     ^

[...]/sysroot/usr/include/boost/functional/hash/detail/hash_float.hpp:210:21: error: ?_Generic? was not declared in this scope

             switch (fpclassify(v))
                     ^

Also backport fix for glibc bug 22146.
Without this patch some C++ applications (jsoncpp, mesa3d and kodi) fail to build due to an issue while building the toolchain.

A test in the libstdc++ configure script fail when -Os and float128 are used.

See the bug report for details [3].

[1] https://sourceware.org/ml/libc-alpha/2017-08/msg00586.html
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=21930
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=22146

Cc Thomas Petazzoni <[email protected]>
---
 ...__builtin_types_compatible_p-in-C-mode-bu.patch |  50 ++++
 .../glibc/0001-sh-Fix-building-with-gcc5-6.patch   |  56 ----
 ...00366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch |  35 ---
 ...02-Do-not-use-generic-selection-in-C-mode.patch |  56 ++++
 ...-version-of-issignaling-that-does-not-use.patch | 225 +++++++++++++++
 ...ject-overly-long-LD_PRELOAD-path-elements.patch | 122 --------
 ...ersion-of-issignaling-when-__NO_LONG_DOUB.patch |  47 +++
 ...Reject-overly-long-LD_AUDIT-path-elements.patch | 204 -------------
 ...-version-of-iszero-that-does-not-use-__MA.patch | 210 ++++++++++++++
 package/glibc/0005-fix-binutils-2-29-build.patch   |  65 -----
 ...ify-use-the-builtin-when-optimizing-for-s.patch |  63 ++++
 ...g-IS_IN-libc-guards-to-vectorized-strcspn.patch |  47 ---
 package/glibc/0006-sh4-trap.patch                  | 318 ---------------------
 package/glibc/glibc.hash                           |   2 +-
 package/glibc/glibc.mk                             |   2 +-
 15 files changed, 653 insertions(+), 849 deletions(-)
 create mode 100644 package/glibc/0001-Do-not-use-__builtin_types_compatible_p-in-C-mode-bu.patch
 delete mode 100644 package/glibc/0001-sh-Fix-building-with-gcc5-6.patch
 delete mode 100644 package/glibc/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch
 create mode 100644 package/glibc/0002-Do-not-use-generic-selection-in-C-mode.patch
 create mode 100644 package/glibc/0003-Provide-a-C-version-of-issignaling-that-does-not-use.patch
 delete mode 100644 package/glibc/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch
 create mode 100644 package/glibc/0004-Fix-the-C-version-of-issignaling-when-__NO_LONG_DOUB.patch
 delete mode 100644 package/glibc/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch
 create mode 100644 package/glibc/0005-Provide-a-C-version-of-iszero-that-does-not-use-__MA.patch
 delete mode 100644 package/glibc/0005-fix-binutils-2-29-build.patch
 create mode 100644 package/glibc/0006-Let-fpclassify-use-the-builtin-when-optimizing-for-s.patch
 delete mode 100644 package/glibc/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch
 delete mode 100644 package/glibc/0006-sh4-trap.patch
package/glibc/0001-Do-not-use-__builtin_types_compatible_p-in-C-mode-bu.patch new file +50 -0
new file mode 100644
index 0000000..27a785e
@@ -0,0 +1,50 @@
+From f7439f9b1089e17b6721f28e228682831a2f0135 Mon Sep 17 00:00:00 2001
+From: "Gabriel F. T. Gomes" <[email protected]>
+Date: Mon, 21 Aug 2017 14:23:27 +0200
+Subject: [PATCH] Do not use __builtin_types_compatible_p in C++ mode (bug
+ 21930)
+
+The logic to define isinf for float128 depends on the availability of
+__builtin_types_compatible_p, which is only available in C mode,
+however, the conditionals do not check for C or C++ mode.  This lead to
+an error in libstdc++ configure, as reported by bug 21930.
+
+This patch adds a conditional for C mode in the definition of isinf for
+float128.  No definition is provided in C++ mode, since libstdc++
+headers undefine isinf.
+
+Tested for powerpc64le (glibc test suite and libstdc++-v3 configure).
+
+	[BZ #21930]
+	* math/math.h (isinf): Check if in C or C++ mode before using
+	__builtin_types_compatible_p, since this is a C mode feature.
+
+(cherry picked from commit 47a67213a9f51c5f8816d240500b10db605d8b77)
+[Romain rebase on glibc 2.26]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ math/math.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/math/math.h b/math/math.h
+index e217080..dea8dbe 100644
+--- a/math/math.h
++++ b/math/math.h
+@@ -442,8 +442,12 @@ enum
+ 
+ /* Return nonzero value if X is positive or negative infinity.  */
+ # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
+-     && !defined __SUPPORT_SNAN__
+-   /* __builtin_isinf_sign is broken for float128 only before GCC 7.0.  */
++     && !defined __SUPPORT_SNAN__ && !defined __cplusplus
++   /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
++      use the helper function, __isinff128, with older compilers.  This is
++      only provided for C mode, because in C++ mode, GCC has no support
++      for __builtin_types_compatible_p (and when in C++ mode, this macro is
++      not used anyway, because libstdc++ headers undefine it).  */
+ #  define isinf(x) \
+     (__builtin_types_compatible_p (__typeof (x), _Float128) \
+      ? __isinff128 (x) : __builtin_isinf_sign (x))
+-- 
+2.9.5
+
package/glibc/0001-sh-Fix-building-with-gcc5-6.patch deleted +0 -56

56 lines not on this page · raw message

package/glibc/0002-CVE-2017-1000366-Ignore-LD_LIBRARY_PATH-for-AT_SECUR.patch deleted +0 -35
deleted file mode 100644
index d701294..0000000
@@ -1,35 +0,0 @@
-From f6110a8fee2ca36f8e2d2abecf3cba9fa7b8ea7d Mon Sep 17 00:00:00 2001
-From: Florian Weimer <[email protected]>
-Date: Mon, 19 Jun 2017 17:09:55 +0200
-Subject: [PATCH] CVE-2017-1000366: Ignore LD_LIBRARY_PATH for AT_SECURE=1
- programs [BZ #21624]
-
-LD_LIBRARY_PATH can only be used to reorder system search paths, which
-is not useful functionality.
-
-This makes an exploitable unbounded alloca in _dl_init_paths unreachable
-for AT_SECURE=1 programs.
-
-[Peter: Drop ChangeLog modification]
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- elf/rtld.c | 3 ++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/elf/rtld.c b/elf/rtld.c
-index 2446a87680..2269dbec81 100644
---- a/elf/rtld.c
-+++ b/elf/rtld.c
-@@ -2422,7 +2422,8 @@ process_envvars (enum mode *modep)
- 
- 	case 12:
- 	  /* The library search path.  */
--	  if (memcmp (envline, "LIBRARY_PATH", 12) == 0)
-+	  if (!__libc_enable_secure
-+	      && memcmp (envline, "LIBRARY_PATH", 12) == 0)
- 	    {
- 	      library_path = &envline[13];
- 	      break;
--- 
-2.11.0
-
package/glibc/0002-Do-not-use-generic-selection-in-C-mode.patch new file +56 -0

56 lines not on this page · raw message

package/glibc/0003-Provide-a-C-version-of-issignaling-that-does-not-use.patch new file +225 -0

225 lines not on this page · raw message

package/glibc/0003-ld.so-Reject-overly-long-LD_PRELOAD-path-elements.patch deleted +0 -122

122 lines not on this page · raw message

package/glibc/0004-Fix-the-C-version-of-issignaling-when-__NO_LONG_DOUB.patch new file +47 -0

47 lines not on this page · raw message

package/glibc/0004-ld.so-Reject-overly-long-LD_AUDIT-path-elements.patch deleted +0 -204

204 lines not on this page · raw message

package/glibc/0005-Provide-a-C-version-of-iszero-that-does-not-use-__MA.patch new file +210 -0

210 lines not on this page · raw message

package/glibc/0005-fix-binutils-2-29-build.patch deleted +0 -65

65 lines not on this page · raw message

package/glibc/0006-Let-fpclassify-use-the-builtin-when-optimizing-for-s.patch new file +63 -0

63 lines not on this page · raw message

package/glibc/0006-i686-Add-missing-IS_IN-libc-guards-to-vectorized-strcspn.patch deleted +0 -47

47 lines not on this page · raw message

package/glibc/0006-sh4-trap.patch deleted +0 -318

318 lines not on this page · raw message

package/glibc/glibc.hash +1 -1
index daaf014..afae10f 100644
@@ -1,2 +1,2 @@
 # Locally calculated after checking pgp signature (glibc)
-sha256	067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0	glibc-2.25.tar.xz
+sha256	e54e0a934cd2bc94429be79da5e9385898d2306b9eaf3c92d5a77af96190f6bd	glibc-2.26.tar.xz
package/glibc/glibc.mk +1 -1
index c9a6579..f5d0282 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-GLIBC_VERSION = 2.25
+GLIBC_VERSION = 2.26
 GLIBC_SITE = $(BR2_GNU_MIRROR)/libc
 GLIBC_SOURCE = glibc-$(GLIBC_VERSION).tar.xz
 GLIBC_SRC_SUBDIR = .
Signature · 1 line
2.9.5
#26 lore raw

v3 cover glibc: bump to 2.26

In reply to Romain Naour
Quoted 3 lines · Romain Naour

This series bump glibc to the latest release and allow to remove all patches required for the previous version! But glibc come with some new issue that are hopefully already fixed in the 2.26.x stable branch.

Applied the series to master, thanks.

Quoted 8 lines

While testing this new version, some build issues has been dicovered. Two gcc patch are needed to build a toolchain with older compiler (gcc 4.9 to 6.4), gcc 7.2 contain already the fix.

Backport a series related to bug 21930 and 22146. Without them the float128 support break the C++ build for some packages.

Quoted 5 lines

https://sourceware.org/bugzilla/show_bug.cgi?id=21930
https://sourceware.org/bugzilla/show_bug.cgi?id=22146

This third series is for testing and review. Let's hope that glibc 2.26.1 will be released soon :)

As discussed on IRC:

Apparently there won't be a glibc 2.26.1. It's up to distros to pick a git
commit to release. So we have the choice to either keep a lot of patches in Buildroot, or use a git download instead of a tarball. The latter has the disadvantage of having a silly version "number" (the sha1), and that git downloads are generally much slower.

For now, we have those 6 patches in Buildroot. This may change in the future.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#27 lore raw

v3 cover glibc: bump to 2.26

Arnout, All,

On 2017-09-27 23:12 +0200, Arnout Vandecappelle spake thusly:

Quoted 7 lines · Romain Naour
Quoted 1 line

Let's hope that glibc 2.26.1 will be released soon :)

As discussed on IRC:

Apparently there won't be a glibc 2.26.1. It's up to distros to pick a git
commit to release.

Yep, this is just silly... :-(

Quoted 4 lines

So we have the choice to either keep a lot of patches in Buildroot, or use a git download instead of a tarball. The latter has the disadvantage of having a silly version "number" (the sha1), and that git downloads are generally much slower.

If we want a slightly less-silly-looking version, we could use something like:

    glibc-2.26-43-gfdf58eb

whichh means the sha1 'fdf58eb' that is '43' commits after the 'glibc-2.26' tag. But we have to be careful about shortening the sha1, to avoid collisions. I would say that we stay with the full sha1.

It is pretty easy to generate such a version string:

    git describe --match 'glibc-*' --abbrev=12 origin/release/2.26/master
Quoted 1 line

For now, we have those 6 patches in Buildroot. This may change in the future.

I would say that we should switch to using the 2.26/master branch from upstream, because we don;t have the bandwidth to assess whether we need/want to backport individual patches.

If upstream commits on the maintenance branch, it means that it is a fix. And we want fixes, whatever they fix: functionality or security.

So I'd say we should switch to git. The repo is even accessible through https (although it is not documented): https://sourceware.org/git/glibc.git

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'