[Buildroot] [git commit] package/gcc: pass -Wno-error to debug builds
Yann E. MORIN
yann.morin.1998 at free.fr
Tue Apr 7 20:24:59 UTC 2020
commit: https://git.buildroot.net/buildroot/commit/?id=dcaf6e75acb4d21c2c31c70b054dac8d18710fcb
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
gcc fails to build in debug build with debug optimisations:
BR2_x86_corei7=y
BR2_ENABLE_DEBUG=y
BR2_DEBUG_3=y
BR2_OPTIMIZE_G=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
which fails with:
../../../../libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: âst.st_modeâ may be used uninitialized in this function [-Werror=maybe-uninitialized]
return S_ISLNK (st.st_mode);
^
Upstream has been unable to reproduce/fix properly, details:
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-03/threads.html#00827
Upstream recommends passing -Wno-error as a workaround, see:
https://gcc.gnu.org/pipermail/gcc-patches/2019-April/519867.html
Reviewed-by: Romain Naour <romain.naour at gmail.com>
Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>
[yann.morin.1998 at free.fr: add the reproducing defconfig]
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
---
package/gcc/gcc.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 524ca83db0..fe7167b2f3 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -100,6 +100,11 @@ HOST_GCC_COMMON_CONF_ENV = \
GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS)
GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
+# used to fix ../../../../libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: âst.st_modeâ may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ifeq ($(BR2_ENABLE_DEBUG),y)
+GCC_COMMON_TARGET_CFLAGS += -Wno-error
+endif
+
# Propagate options used for target software building to GCC target libs
HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CFLAGS)"
HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)"
More information about the buildroot
mailing list