diff --git a/package/asterisk/asterisk.mk b/package/asterisk/asterisk.mk index f6a4f8f787..67b6da56db 100644 --- a/package/asterisk/asterisk.mk +++ b/package/asterisk/asterisk.mk @@ -283,6 +283,14 @@ endif # Remove default -O3 optimization flag ASTERISK_MAKE_OPTS += OPTIMIZE="" +ASTERISK_CFLAGS = $(TARGET_CFLAGS) + +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y) +ASTERISK_CFLAGS += -O0 +endif + +ASTERISK_CONF_OPTS += CFLAGS="$(ASTERISK_CFLAGS)" + # We want to install sample configuration files, too. ASTERISK_INSTALL_TARGET_OPTS = \ $(ASTERISK_DIRS) \