build: decouple the mips16 support flag from the toolchain

Add the flags from package.mk instead, and leave libc and gcc
unaffected.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37770
This commit is contained in:
Felix Fietkau 2013-08-14 13:02:29 +00:00
parent 8b8875b305
commit a1a5f59ea3
3 changed files with 9 additions and 10 deletions

View File

@ -13,6 +13,7 @@ PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
PKG_MD5SUM ?= unknown PKG_MD5SUM ?= unknown
PKG_BUILD_PARALLEL ?= PKG_BUILD_PARALLEL ?=
PKG_USE_MIPS16 ?= 1
ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),) ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),)
MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j) MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j)
@ -26,6 +27,12 @@ else
PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL)$(CONFIG_PKG_DEFAULT_PARALLEL),\ PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL)$(CONFIG_PKG_DEFAULT_PARALLEL),\
$(if $(CONFIG_PKG_BUILD_PARALLEL),$(MAKE_J),-j1),-j1) $(if $(CONFIG_PKG_BUILD_PARALLEL),$(MAKE_J),-j1),-j1)
endif endif
ifdef CONFIG_HAS_MIPS16
ifeq ($(strip $(PKG_USE_MIPS16)),1)
TARGET_ASFLAGS_DEFAULT = $(filter-out -mips16 -minterlink-mips16,$(TARGET_CFLAGS))
TARGET_CFLAGS += -mips16 -minterlink-mips16
endif
endif
include $(INCLUDE_DIR)/prereq.mk include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/host.mk include $(INCLUDE_DIR)/host.mk

View File

@ -70,13 +70,6 @@ endif
ifneq ($(filter -mdspr2,$(TARGET_OPTIMIZATION)),) ifneq ($(filter -mdspr2,$(TARGET_OPTIMIZATION)),)
ARCH_SUFFIX:=$(ARCH_SUFFIX)_dspr2 ARCH_SUFFIX:=$(ARCH_SUFFIX)_dspr2
endif endif
ifdef CONFIG_USE_MIPS16
TARGET_OPTIMIZATION+= -minterlink-mips16 -mips16
endif
ifneq ($(findstring -mips16,$(TARGET_OPTIMIZATION)),)
TARGET_ASFLAGS_OVERRIDE:=-mno-mips16
ARCH_SUFFIX:= $(ARCH_SUFFIX)_m16
endif
ifdef CONFIG_HAS_SPE_FPU ifdef CONFIG_HAS_SPE_FPU
TARGET_SUFFIX:=$(TARGET_SUFFIX)spe TARGET_SUFFIX:=$(TARGET_SUFFIX)spe
endif endif
@ -130,7 +123,8 @@ PKG_INFO_DIR := $(STAGING_DIR)/pkginfo
TARGET_PATH:=$(STAGING_DIR_HOST)/bin:$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH))))) TARGET_PATH:=$(STAGING_DIR_HOST)/bin:$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH)))))
TARGET_CFLAGS:=$(TARGET_OPTIMIZATION)$(if $(CONFIG_DEBUG), -g3) $(EXTRA_OPTIMIZATION) TARGET_CFLAGS:=$(TARGET_OPTIMIZATION)$(if $(CONFIG_DEBUG), -g3) $(EXTRA_OPTIMIZATION)
TARGET_CXXFLAGS = $(TARGET_CFLAGS) TARGET_CXXFLAGS = $(TARGET_CFLAGS)
TARGET_ASFLAGS = $(TARGET_CFLAGS) $(TARGET_ASFLAGS_OVERRIDE) TARGET_ASFLAGS_DEFAULT = $(TARGET_CFLAGS)
TARGET_ASFLAGS = $(TARGET_ASFLAGS_DEFAULT)
TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
ifneq ($(CONFIG_EXTERNAL_TOOLCHAIN),) ifneq ($(CONFIG_EXTERNAL_TOOLCHAIN),)

View File

@ -45,8 +45,6 @@ GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \
$(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \ $(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \
$(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500))))) $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500)))))
TARGET_CFLAGS := $(filter-out -mips16,$(TARGET_CFLAGS))
CPU_CFLAGS = \ CPU_CFLAGS = \
-funsigned-char -fno-builtin -fno-asm \ -funsigned-char -fno-builtin -fno-asm \
--std=gnu99 -ffunction-sections -fdata-sections \ --std=gnu99 -ffunction-sections -fdata-sections \