aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2018-12-17 18:31:43 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2018-12-17 22:02:42 +0000
commita6ca3b51498ee5071c10d8a16c7a45c51b8bf9ae (patch)
tree6679dc31dea7ef8d089c71790e3e8fa014d0f0ed
parent2888d785d865dbbd994a54004046af87921c375a (diff)
downloadopenembedded-core-contrib-jansa/glibc-2.29.tar.gz
openembedded-core-contrib-jansa/glibc-2.29.tar.bz2
openembedded-core-contrib-jansa/glibc-2.29.zip
glibc: restore one prematurely removed patch and update anotherjansa/glibc-2.29
* 0032-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch was prematurely removed in 2.29 upgrade, I've pinged upstream about merging it: https://sourceware.org/ml/libc-alpha/2018-12/msg00571.html * 0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch is still needed I've sent v6 with upstream requested modifications to hopefully get it merged soon: https://sourceware.org/ml/libc-alpha/2018-12/msg00569.html Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch196
-rw-r--r--meta/recipes-core/glibc/glibc/0032-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch55
-rw-r--r--meta/recipes-core/glibc/glibc_2.29.bb1
3 files changed, 101 insertions, 151 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
index eea6cacb8b..2755abe54e 100644
--- 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
@@ -1,7 +1,7 @@
-From ee7b12fc2455d4aabe9b9ac88cedd079bbc2654e Mon Sep 17 00:00:00 2001
-From: Martin Jansa <martin dot jansa at gmail dot com>
-Date: Sun, 30 Sep 2018 22:15:09 +0000
-Subject: [PATCH 31/31] sysdeps/ieee754: prevent maybe-uninitialized errors
+From 60c55da6309998feb3834d8b6ca871a182f4b559 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 31/32] sysdeps/ieee754: prevent maybe-uninitialized errors
with -O [BZ #19444]
With -O included in CFLAGS it fails to build with:
@@ -35,209 +35,103 @@ For AARCH64 it needs one more fix in locale for -Os.
* sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Likewise.
-Upstream-Status: Submitted [https://www.sourceware.org/ml/libc-alpha/2018-09/msg00547.html]
+Upstream-Status: Submitted [https://www.sourceware.org/ml/libc-alpha/2018-12/msg00569.html https://patches-gcc.linaro.org/patch/13523/]
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
- 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 +++++++++++++++++++++
- 4 files changed, 84 insertions(+)
+ sysdeps/ieee754/dbl-64/e_jn.c | 2 ++
+ sysdeps/ieee754/ldbl-128/e_jnl.c | 4 ++++
+ sysdeps/ieee754/ldbl-128ibm/e_jnl.c | 4 ++++
+ sysdeps/ieee754/ldbl-96/e_jnl.c | 4 ++++
+ 4 files changed, 14 insertions(+)
diff --git a/sysdeps/ieee754/dbl-64/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c
-index aff06ead16..e5546ff303 100644
+index aff06ead16..90a7e77270 100644
--- a/sysdeps/ieee754/dbl-64/e_jn.c
+++ b/sysdeps/ieee754/dbl-64/e_jn.c
-@@ -43,6 +43,7 @@
- #include <math_private.h>
- #include <fenv_private.h>
- #include <math-underflow.h>
-+#include <libc-diag.h>
-
- static const double
- invsqrtpi = 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
-@@ -110,7 +111,17 @@ __ieee754_jn (int n, double x)
+@@ -109,6 +109,7 @@ __ieee754_jn (int n, double x)
+ case 1: temp = -c + s; break;
case 2: temp = -c - s; break;
case 3: temp = c - s; break;
++ default: __builtin_unreachable ();
}
-+ /* 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 positive with -O1. */
-+ DIAG_PUSH_NEEDS_COMMENT;
-+ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
b = invsqrtpi * temp / sqrt (x);
-+ DIAG_POP_NEEDS_COMMENT;
}
- else
- {
-@@ -317,7 +328,17 @@ __ieee754_yn (int n, double x)
+@@ -316,6 +317,7 @@ __ieee754_yn (int n, double x)
+ case 1: temp = -s - c; break;
case 2: temp = -s + c; break;
case 3: temp = s + c; break;
++ default: __builtin_unreachable ();
}
-+ /* 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 positive with -O1. */
-+ 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 7610d18c67..def41a8215 100644
+index 7610d18c67..3c90072a22 100644
--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
-@@ -62,6 +62,7 @@
- #include <math_private.h>
- #include <fenv_private.h>
- #include <math-underflow.h>
-+#include <libc-diag.h>
-
- static const _Float128
- invsqrtpi = L(5.6418958354775628694807945156077258584405E-1),
-@@ -151,7 +152,17 @@ __ieee754_jnl (int n, _Float128 x)
+@@ -150,6 +150,8 @@ __ieee754_jnl (int n, _Float128 x)
+ case 3:
temp = c - s;
break;
++ default:
++ __builtin_unreachable ();
}
-+ /* 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 positive with -O1. */
-+ DIAG_PUSH_NEEDS_COMMENT;
-+ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
b = invsqrtpi * temp / sqrtl (x);
-+ DIAG_POP_NEEDS_COMMENT;
}
- else
- {
-@@ -387,7 +398,17 @@ __ieee754_ynl (int n, _Float128 x)
+@@ -386,6 +388,8 @@ __ieee754_ynl (int n, _Float128 x)
+ case 3:
temp = s + c;
break;
++ default:
++ __builtin_unreachable ();
}
-+ /* 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 positive with -O1. */
-+ 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 50b4558e74..52a58dc6aa 100644
+index 50b4558e74..478824c8fa 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
-@@ -62,6 +62,7 @@
- #include <math_private.h>
- #include <fenv_private.h>
- #include <math-underflow.h>
-+#include <libc-diag.h>
-
- static const long double
- invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
-@@ -151,7 +152,17 @@ __ieee754_jnl (int n, long double x)
+@@ -150,6 +150,8 @@ __ieee754_jnl (int n, long double x)
+ case 3:
temp = c - s;
break;
++ default:
++ __builtin_unreachable ();
}
-+ /* 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 positive with -O1. */
-+ DIAG_PUSH_NEEDS_COMMENT;
-+ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
b = invsqrtpi * temp / sqrtl (x);
-+ DIAG_POP_NEEDS_COMMENT;
}
- else
- {
-@@ -387,7 +398,17 @@ __ieee754_ynl (int n, long double x)
+@@ -386,6 +388,8 @@ __ieee754_ynl (int n, long double x)
+ case 3:
temp = s + c;
break;
++ default:
++ __builtin_unreachable ();
}
-+ /* 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 positive with -O1. */
-+ 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 855190841b..2c13c8ec16 100644
+index 855190841b..6c1c4b4653 100644
--- a/sysdeps/ieee754/ldbl-96/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-96/e_jnl.c
-@@ -62,6 +62,7 @@
- #include <math_private.h>
- #include <fenv_private.h>
- #include <math-underflow.h>
-+#include <libc-diag.h>
-
- static const long double
- invsqrtpi = 5.64189583547756286948079e-1L, two = 2.0e0L, one = 1.0e0L;
-@@ -144,7 +145,17 @@ __ieee754_jnl (int n, long double x)
+@@ -143,6 +143,8 @@ __ieee754_jnl (int n, long double x)
+ case 3:
temp = c - s;
break;
++ default:
++ __builtin_unreachable ();
}
-+ /* 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 positive with -O1. */
-+ DIAG_PUSH_NEEDS_COMMENT;
-+ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
b = invsqrtpi * temp / sqrtl (x);
-+ DIAG_POP_NEEDS_COMMENT;
}
- else
- {
-@@ -373,7 +384,17 @@ __ieee754_ynl (int n, long double x)
+@@ -372,6 +374,8 @@ __ieee754_ynl (int n, long double x)
+ case 3:
temp = s + c;
break;
++ default:
++ __builtin_unreachable ();
}
-+ /* 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 positive with -O1. */
-+ DIAG_PUSH_NEEDS_COMMENT;
-+ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
b = invsqrtpi * temp / sqrtl (x);
-+ DIAG_POP_NEEDS_COMMENT;
}
- else
- {
--
-2.20.0
+2.17.1
diff --git a/meta/recipes-core/glibc/glibc/0032-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch b/meta/recipes-core/glibc/glibc/0032-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
new file mode 100644
index 0000000000..334865ead0
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0032-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
@@ -0,0 +1,55 @@
+From 0cad5b47191fa96d68d67321d873f0366fbfd713 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 30 Sep 2018 09:16:48 +0000
+Subject: [PATCH 32/32] locale: prevent maybe-uninitialized errors with -Os [BZ
+ #19444]
+
+Fixes following error when building for aarch64 with -Os:
+| In file included from strcoll_l.c:43:
+| strcoll_l.c: In function '__strcoll_l':
+| ../locale/weight.h:31:26: error: 'seq2.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+| int_fast32_t i = table[*(*cpp)++];
+| ^~~~~~~~~
+| strcoll_l.c:304:18: note: 'seq2.back_us' was declared here
+| coll_seq seq1, seq2;
+| ^~~~
+| In file included from strcoll_l.c:43:
+| ../locale/weight.h:31:26: error: 'seq1.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+| int_fast32_t i = table[*(*cpp)++];
+| ^~~~~~~~~
+| strcoll_l.c:304:12: note: 'seq1.back_us' was declared here
+| coll_seq seq1, seq2;
+| ^~~~
+
+ Partial fix for [BZ #23716]
+ * locale/weight.h: Fix build with -Os.
+
+Upstream-Status: Submitted [https://www.sourceware.org/ml/libc-alpha/2018-09/msg00539.html https://patches-gcc.linaro.org/patch/10448/]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ locale/weight.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/locale/weight.h b/locale/weight.h
+index 6028d3595e..10bcea25e5 100644
+--- a/locale/weight.h
++++ b/locale/weight.h
+@@ -28,7 +28,14 @@ findidx (const int32_t *table,
+ const unsigned char *extra,
+ const unsigned char **cpp, size_t len)
+ {
++ /* With GCC 8 when compiling with -Os the compiler warns that
++ seq1.back_us and seq2.back_us might be used uninitialized.
++ This uninitialized use is impossible for the same reason
++ as described in comments in locale/weightwc.h. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ int_fast32_t i = table[*(*cpp)++];
++ DIAG_POP_NEEDS_COMMENT;
+ const unsigned char *cp;
+ const unsigned char *usrc;
+
+--
+2.17.1
+
diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
index 347ad397b7..94ab1d7483 100644
--- a/meta/recipes-core/glibc/glibc_2.29.bb
+++ b/meta/recipes-core/glibc/glibc_2.29.bb
@@ -56,6 +56,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
file://0029-intl-Emit-no-lines-in-bison-generated-files.patch \
file://0030-inject-file-assembly-directives.patch \
file://0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch \
+ file://0032-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
"
S = "${WORKDIR}/git"