From 50cc48b18066a3dc02d199fdd0ed8930419b13d6 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Sun, 30 Sep 2018 16:27:37 +0000 Subject: 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. (From OE-Core rev: f1f38df91975f9b53933c2d2fbdca291d1872d5f) Signed-off-by: Martin Jansa Signed-off-by: Richard Purdie --- ...e754-soft-fp-ignore-maybe-uninitialized-w.patch | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch (limited to 'meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch') diff --git a/meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch b/meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch new file mode 100644 index 0000000000..99cd2509ec --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch @@ -0,0 +1,100 @@ +From 618668540e263c09b0eb28131dde7b4500158fd4 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Sun, 16 Sep 2018 12:39:22 +0000 +Subject: [PATCH] sysdeps/ieee754/soft-fp: ignore maybe-uninitialized with -O + [BZ #19444] + +* with -O, -O1, -Os it fails with: + +In file included from ../soft-fp/soft-fp.h:318, + from ../sysdeps/ieee754/soft-fp/s_fdiv.c:28: +../sysdeps/ieee754/soft-fp/s_fdiv.c: In function '__fdiv': +../soft-fp/op-2.h:98:25: error: 'R_f1' may be used uninitialized in this function [-Werror=maybe-uninitialized] + X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) \ + ^~ +../sysdeps/ieee754/soft-fp/s_fdiv.c:38:14: note: 'R_f1' was declared here + FP_DECL_D (R); + ^ +../soft-fp/op-2.h:37:36: note: in definition of macro '_FP_FRAC_DECL_2' + _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT + ^ +../soft-fp/double.h:95:24: note: in expansion of macro '_FP_DECL' + # define FP_DECL_D(X) _FP_DECL (2, X) + ^~~~~~~~ +../sysdeps/ieee754/soft-fp/s_fdiv.c:38:3: note: in expansion of macro 'FP_DECL_D' + FP_DECL_D (R); + ^~~~~~~~~ +../soft-fp/op-2.h:101:17: error: 'R_f0' may be used uninitialized in this function [-Werror=maybe-uninitialized] + : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \ + ^~ +../sysdeps/ieee754/soft-fp/s_fdiv.c:38:14: note: 'R_f0' was declared here + FP_DECL_D (R); + ^ +../soft-fp/op-2.h:37:14: note: in definition of macro '_FP_FRAC_DECL_2' + _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT + ^ +../soft-fp/double.h:95:24: note: in expansion of macro '_FP_DECL' + # define FP_DECL_D(X) _FP_DECL (2, X) + ^~~~~~~~ +../sysdeps/ieee754/soft-fp/s_fdiv.c:38:3: note: in expansion of macro 'FP_DECL_D' + FP_DECL_D (R); + ^~~~~~~~~ + +Build tested with Yocto for ARM, AARCH64, X86, X86_64, PPC, MIPS, MIPS64 +with -O, -O1, -Os. +For AARCH64 it needs one more fix in locale for -Os. + + Partial fix for [BZ #23716] + * sysdeps/ieee754/soft-fp/s_fdiv.c: Fix build with -O + +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/msg00300.html] + +Signed-off-by: Martin Jansa +--- + ChangeLog | 4 ++++ + sysdeps/ieee754/soft-fp/s_fdiv.c | 12 ++++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index 922e916f2c..216336edc9 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2018-09-30 Martin Jansa ++ Partial fix for [BZ #23716] ++ * sysdeps/ieee754/soft-fp/s_fdiv.c: Fix build with -O. ++ + 2018-09-29 Martin Jansa + Partial fix for [BZ #23716] + * sysdeps/ieee754/dbl-96/e_jnl.c: Fix build with -O +diff --git a/sysdeps/ieee754/soft-fp/s_fdiv.c b/sysdeps/ieee754/soft-fp/s_fdiv.c +index 341339f5ed..14655b77da 100644 +--- a/sysdeps/ieee754/soft-fp/s_fdiv.c ++++ b/sysdeps/ieee754/soft-fp/s_fdiv.c +@@ -25,6 +25,16 @@ + #undef fdivl + + #include ++ ++#include ++/* R_f[01] are not set in cases where it is not used in packing, but the ++ compiler does not see that it is set in all cases where it is ++ used, resulting in warnings that it may be used uninitialized. ++ The location of the warning differs in different versions of GCC, ++ it may be where R is defined using a macro or it may be where the ++ macro is defined. */ ++DIAG_PUSH_NEEDS_COMMENT; ++DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); + #include + #include + #include +@@ -53,4 +63,6 @@ __fdiv (double x, double y) + CHECK_NARROW_DIV (ret, x, y); + return ret; + } ++DIAG_POP_NEEDS_COMMENT; ++ + libm_alias_float_double (div) -- cgit v1.2.3-54-g00ecf