Create and use a TARGET_ASFLAGS, defaulting to TARGET_CFLAGS. MIPS .S files reasonably assume they are not in mips16 mode. Because "-mips16 -mno-mips16" results in -mno-mips16, I can append that to the TARGET_ASFLAGS. This should be done with $(filter-out)?
Signed-off-by: Jay Carlson <n...@nop.com> --- rules.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rules.mk b/rules.mk index e657eec..ecde2a6 100644 --- a/rules.mk +++ b/rules.mk @@ -63,6 +63,9 @@ endif ifneq ($(findstring -mips32r2,$(TARGET_OPTIMIZATION)),) ARCH_SUFFIX:=_r2 endif +ifneq ($(findstring -mips16,$(TARGET_OPTIMIZATION)),) + TARGET_ASFLAGS_OVERRIDE:=-mno-mips16 +endif ifdef CONFIG_HAS_SPE_FPU TARGET_SUFFIX:=$(TARGET_SUFFIX)spe endif @@ -109,6 +112,7 @@ BUILD_LOG_DIR:=$(TOPDIR)/logs TARGET_PATH:=$(STAGING_DIR_HOST)/bin:$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH))))) TARGET_CFLAGS:=$(TARGET_OPTIMIZATION)$(if $(CONFIG_DEBUG), -g3) TARGET_CXXFLAGS = $(TARGET_CFLAGS) +TARGET_ASFLAGS = $(TARGET_CFLAGS) $(TARGET_ASFLAGS_OVERRIDE) TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib ifneq ($(CONFIG_EXTERNAL_TOOLCHAIN),) @@ -206,7 +210,7 @@ endif TARGET_CONFIGURE_OPTS = \ AR=$(TARGET_CROSS)ar \ - AS="$(TARGET_CC) -c $(TARGET_CFLAGS)" \ + AS="$(TARGET_CC) -c $(TARGET_ASFLAGS)" \ LD=$(TARGET_CROSS)ld \ NM=$(TARGET_CROSS)nm \ CC="$(TARGET_CC)" \ -- 1.7.9.5 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel