asterisk-13.x: change LOW_MEMORY and -march=native treatment

- LOW_MEMORY is known to cause sporadic crashes, disable it by default.
- Prevent Asterisk from adding -march=native to CFLAGS.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2018-01-16 20:09:53 +01:00
parent 6fba6f38a5
commit 6053ff527b
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,11 @@
menu "Advanced configuration"
depends on PACKAGE_asterisk13
config ASTERISK13_LOW_MEMORY
bool "Optimize Asterisk 13 for low memory usage"
default n
help
Warning: this feature is known to cause problems with some modules.
Disable it if you experience problems like segmentation faults.
endmenu

View file

@ -50,6 +50,10 @@ define Package/asterisk13/install/sounds
$(CP) $(PKG_INSTALL_DIR)/usr/share/asterisk/sounds/en/$(2) $(1)/usr/share/asterisk/sounds/
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
define BuildAsterisk13Module
define Package/asterisk13-$(1)
$$(call Package/asterisk13/Default)
@ -268,6 +272,19 @@ define Build/Compile
$(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" \
CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR)/host/include/libxml2" \
LDFLAGS="$(HOST_LDFLAGS) -lxml2"
$(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree
cd "$(PKG_BUILD_DIR)" && \
./menuselect/menuselect \
--disable BUILD_NATIVE \
$(if $(CONFIG_ASTERISK13_LOW_MEMORY),--enable LOW_MEMORY) \
menuselect.makeopts
# Hack:
# When changing anything in MENUSELECT_CFLAGS the file ".lastclean"
# gets deleted. E.g. when compiling on x86 for x86 "--disable
# BUILD_NATIVE" changes MENUSELECT_CFLAGS and the file gets removed.
# But that will result in a rebuild attempt of menuselect which will
# likely fail. Prevent that by recreating ".lastclean".
$(CP) "$(PKG_BUILD_DIR)/.cleancount" "$(PKG_BUILD_DIR)/.lastclean"
$(call Build/Compile/Default,all install samples)
endef