aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar James Hilliard <james.hilliard1@gmail.com>2020-04-07 13:26:22 -0600
committerGravatar Peter Korsgaard <peter@korsgaard.com>2020-04-08 16:33:42 +0200
commit48f597a2b5186d12e9141d18d8ffbb0060621a13 (patch)
tree05a901f3754ec7651710dcebe2fa1b81a5c3e752
parentf29abed9f869e455d496168b4e5bb3d0a689da22 (diff)
downloadbuildroot-48f597a2b5186d12e9141d18d8ffbb0060621a13.tar.gz
buildroot-48f597a2b5186d12e9141d18d8ffbb0060621a13.tar.bz2
package/gcc: pass -Wno-error to debug builds
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@gmail.com> Signed-off-by: James Hilliard <james.hilliard1@gmail.com> [yann.morin.1998@free.fr: add the reproducing defconfig] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> (cherry picked from commit dcaf6e75acb4d21c2c31c70b054dac8d18710fcb) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/gcc/gcc.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 0cf31e41f5..b10d2a30e0 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -103,6 +103,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)"