aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2018-09-30 16:27:37 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-01 13:07:45 +0100
commitf1f38df91975f9b53933c2d2fbdca291d1872d5f (patch)
treedfb02f03fc2d108879df1e70d37dff04cba6f743 /meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch
parent8dcd4e6e791c3a8b8bf5e69dca9bb9c887231d69 (diff)
downloadopenembedded-core-contrib-f1f38df91975f9b53933c2d2fbdca291d1872d5f.tar.gz
glibc: bump SRCREV to latest 2.28
* drop one patch already applied in upstream * this is still only partial fix for issues with -O0 and the bigger issue might be detected in runtime as described in: https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F https://sourceware.org/bugzilla/show_bug.cgi?id=19444 and tested in glibc build: https://sourceware.org/git/?p=glibc.git;a=blob;f=include/libc-symbols.h;h=8b9273c13a19f2658105c7997267d9086adae716;hb=HEAD#l74 * restore the anonymous python to trigger fatal error when -O0 is used (but don't restore the notes for -O, -O1, -Os * git log --oneline 3c03baca37fdcb52c3881e653ca392bba7a99c2b..044c96f0d5595aeb0bb4e79355081c5a7f4faca5 | tee 044c96f0d5 Fix misreported errno on preadv2/pwritev2 (BZ#23579) 3a67c72c15 Fix stack overflow in tst-setcontext9 (bug 23717) 2339d6a55e i386: Use ENTRY and END in start.S [BZ #23606] 0ef2f4400c Fix strstr bug with huge needles (bug 23637) a55e109709 Fix tst-setcontext9 for optimized small stacks. 307d04334d misc: New test misc/tst-gethostid e7d22db29c Linux gethostid: Check for NULL value from gethostbyname_r [BZ #23679] 1fe2b9ca8a Fix segfault in maybe_script_execute. 0b79004569 regex: Add test tst-regcomp-truncated [BZ #23578] 58559f1443 regex: fix uninitialized memory access aa8a3e4cde pthread_cond_broadcast: Fix waiters-after-spinning case [BZ #23538] c87b5bab24 Improve ChangeLog message. 66fdfd57fe Regen RISC-V rvd ULPs b0aa03dfff RISC-V: Fix rounding save/restore bug. 2f498f3d14 nss_files: Fix file stream leak in aliases lookup [BZ #23521] bfcfa22589 nscd: Deallocate existing user names in file parser d05b05d157 error, error_at_line: Add missing va_end calls 4b25485f03 Linux: Rewrite __old_getdents64 [BZ #23497] 726e1554ce hurd: Avoid PLTs for __pthread_get/setspecific 7f11842e74 hurd: Add missing symbols for proper libc_get/setspecific * update 0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch based on review comments in upstream and extend it to cover PPC based on: http://lists.openembedded.org/pipermail/openembedded-core/2018-September/156258.html * update 0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch based on review comments in upstream * add 0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch with a fix for aarch64 build with -Os * build tested with qemuarm, qemuarm64, qemux86, qemux86-64, qemuppc, qemumips, qemumips64 with -O, -O1, -Os. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch')
-rw-r--r--meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch258
1 files changed, 258 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch b/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch
new file mode 100644
index 0000000000..61f55d4f83
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch
@@ -0,0 +1,258 @@
+From 546b46c309a52ed74dc906114b1e984bb9703d74 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 14 Sep 2018 23:23:03 +0000
+Subject: [PATCH] sysdeps/ieee754: prevent maybe-uninitialized errors with -O
+ [BZ #19444]
+
+With -O included in CFLAGS it fails to build with:
+
+../sysdeps/ieee754/ldbl-96/e_jnl.c: In function '__ieee754_jnl':
+../sysdeps/ieee754/ldbl-96/e_jnl.c:146:20: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ b = invsqrtpi * temp / sqrtl (x);
+ ~~~~~~~~~~^~~~~~
+../sysdeps/ieee754/ldbl-96/e_jnl.c: In function '__ieee754_ynl':
+../sysdeps/ieee754/ldbl-96/e_jnl.c:375:16: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ b = invsqrtpi * temp / sqrtl (x);
+ ~~~~~~~~~~^~~~~~
+../sysdeps/ieee754/dbl-64/e_jn.c: In function '__ieee754_jn':
+../sysdeps/ieee754/dbl-64/e_jn.c:113:20: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ b = invsqrtpi * temp / sqrt (x);
+ ~~~~~~~~~~^~~~~~
+../sysdeps/ieee754/dbl-64/e_jn.c: In function '__ieee754_yn':
+../sysdeps/ieee754/dbl-64/e_jn.c:320:16: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ b = invsqrtpi * temp / sqrt (x);
+ ~~~~~~~~~~^~~~~~
+
+Build tested with Yocto for ARM, AARCH64, X86, X86_64, PPC, MIPS, MIPS64
+with -O, -O1, -Os.
+For soft-fp ARM it needs one more fix for -O1:
+https://sourceware.org/ml/libc-alpha/2018-09/msg00300.html
+For AARCH64 it needs one more fix in locale for -Os.
+
+ [BZ #23716]
+ * sysdeps/ieee754/dbl-96/e_jnl.c: Fix build with -O
+ * sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Likewise.
+
+Work around the issue instead of removing -O like we do with
+SELECTED_OPTIMIZATION
+
+Upstream-Status: Submitted [https://www.sourceware.org/ml/libc-alpha/2018-09/msg00299.html]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ ChangeLog | 7 +++++++
+ sysdeps/ieee754/dbl-64/e_jn.c | 21 +++++++++++++++++++++
+ sysdeps/ieee754/ldbl-128/e_jnl.c | 21 +++++++++++++++++++++
+ sysdeps/ieee754/ldbl-128ibm/e_jnl.c | 21 +++++++++++++++++++++
+ sysdeps/ieee754/ldbl-96/e_jnl.c | 21 +++++++++++++++++++++
+ 5 files changed, 91 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 11a9b8d98e..922e916f2c 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2018-09-29 Martin Jansa <Martin.Jansa@gmail.com>
++ Partial fix for [BZ #23716]
++ * sysdeps/ieee754/dbl-96/e_jnl.c: Fix build with -O
++ * sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise.
++ * sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
++ * sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Likewise.
++
+ 2018-09-28 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #23579]
+diff --git a/sysdeps/ieee754/dbl-64/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c
+index 9181b22bb8..9ff52c737f 100644
+--- a/sysdeps/ieee754/dbl-64/e_jn.c
++++ b/sysdeps/ieee754/dbl-64/e_jn.c
+@@ -42,6 +42,7 @@
+ #include <math-narrow-eval.h>
+ #include <math_private.h>
+ #include <math-underflow.h>
++#include <libc-diag.h>
+
+ static const double
+ invsqrtpi = 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
+@@ -109,7 +110,17 @@ __ieee754_jn (int n, double x)
+ case 2: temp = -c - s; break;
+ case 3: temp = c - s; break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrt (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+@@ -316,7 +327,17 @@ __ieee754_yn (int n, double x)
+ case 2: temp = -s + c; break;
+ case 3: temp = s + c; break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrt (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c
+index 7739eec291..8706a11575 100644
+--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
++++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
+@@ -61,6 +61,7 @@
+ #include <math.h>
+ #include <math_private.h>
+ #include <math-underflow.h>
++#include <libc-diag.h>
+
+ static const _Float128
+ invsqrtpi = L(5.6418958354775628694807945156077258584405E-1),
+@@ -150,7 +151,17 @@ __ieee754_jnl (int n, _Float128 x)
+ temp = c - s;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+@@ -386,7 +397,17 @@ __ieee754_ynl (int n, _Float128 x)
+ temp = s + c;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+diff --git a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+index 71b3addfba..3226d02309 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
++++ b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+@@ -61,6 +61,7 @@
+ #include <math.h>
+ #include <math_private.h>
+ #include <math-underflow.h>
++#include <libc-diag.h>
+
+ static const long double
+ invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
+@@ -150,7 +151,17 @@ __ieee754_jnl (int n, long double x)
+ temp = c - s;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+@@ -386,7 +397,17 @@ __ieee754_ynl (int n, long double x)
+ temp = s + c;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+diff --git a/sysdeps/ieee754/ldbl-96/e_jnl.c b/sysdeps/ieee754/ldbl-96/e_jnl.c
+index 394921f564..da5c2cc93e 100644
+--- a/sysdeps/ieee754/ldbl-96/e_jnl.c
++++ b/sysdeps/ieee754/ldbl-96/e_jnl.c
+@@ -61,6 +61,7 @@
+ #include <math.h>
+ #include <math_private.h>
+ #include <math-underflow.h>
++#include <libc-diag.h>
+
+ static const long double
+ invsqrtpi = 5.64189583547756286948079e-1L, two = 2.0e0L, one = 1.0e0L;
+@@ -143,7 +144,17 @@ __ieee754_jnl (int n, long double x)
+ temp = c - s;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+@@ -372,7 +383,17 @@ __ieee754_ynl (int n, long double x)
+ temp = s + c;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {