elfutils: fix build with GCC 11
authorAndre Heider <a.heider@gmail.com>
Tue, 7 Feb 2023 19:23:06 +0000 (20:23 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 18 Feb 2023 18:55:37 +0000 (19:55 +0100)
GCC 11 doesn't know about -Wno-error=use-after-free and aborts
compilation.

Fixes: 2748c45d "elfutils: Ignore wrong use-after-free error"
Signed-off-by: Andre Heider <a.heider@gmail.com>
package/libs/elfutils/Makefile

index 1e41e296b3a421e410e00498a547645a902f6ef8..717403c124739a88a4c8e2b2d9b2ba0c61ae61d2 100644 (file)
@@ -81,7 +81,15 @@ HOST_CONFIGURE_VARS += \
 CONFIGURE_VARS += \
        ac_cv_search__obstack_free=yes
 
-TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral -Wno-error=use-after-free
+TARGET_CFLAGS += \
+       -D_GNU_SOURCE \
+       -Wno-unused-result \
+       -Wno-format-nonliteral
+
+ifneq ($(CONFIG_GCC_USE_VERSION_11),y)
+TARGET_CFLAGS += \
+       -Wno-error=use-after-free
+endif
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include