buildroot: allow enabling MIPS16 user-space build

Enabling MIPS16 is made conditional on advertising the "mips16" feature
for a specific target since it requires support from the CPU
(HAS_MIPS16) and the actual use of MIPS16 for building packages
(USE_MIPS16).

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 36202
This commit is contained in:
Florian Fainelli 2013-04-05 12:36:12 +00:00
parent f223d0927e
commit 9e1d2c15d9
4 changed files with 19 additions and 0 deletions

View File

@ -681,6 +681,17 @@ menuconfig TARGET_OPTIONS
Most people will answer N. Most people will answer N.
config USE_MIPS16
bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS
depends on HAS_MIPS16
help
If your target CPU does support the MIPS16 instruction set
and you want to use it for packages, enable this option.
MIPS16 produces smaller binaries thus reducing pressure on
caches and TLB.
Most people will answer N.
source "toolchain/Config.in" source "toolchain/Config.in"
source "target/imagebuilder/Config.in" source "target/imagebuilder/Config.in"

View File

@ -63,6 +63,9 @@ endif
ifneq ($(filter -mips%r2,$(TARGET_OPTIMIZATION)),) ifneq ($(filter -mips%r2,$(TARGET_OPTIMIZATION)),)
ARCH_SUFFIX:=_r2 ARCH_SUFFIX:=_r2
endif endif
ifdef CONFIG_USE_MIPS16
TARGET_OPTIMIZATION+= -minterlink-mips16 -mips16
endif
ifneq ($(findstring -mips16,$(TARGET_OPTIMIZATION)),) ifneq ($(findstring -mips16,$(TARGET_OPTIMIZATION)),)
TARGET_ASFLAGS_OVERRIDE:=-mno-mips16 TARGET_ASFLAGS_OVERRIDE:=-mno-mips16
ARCH_SUFFIX:= $(ARCH_SUFFIX)_m16 ARCH_SUFFIX:= $(ARCH_SUFFIX)_m16

View File

@ -174,6 +174,7 @@ sub target_config_features(@) {
/ramdisk/ and $ret .= "\tselect USES_INITRAMFS\n"; /ramdisk/ and $ret .= "\tselect USES_INITRAMFS\n";
/powerpc64/ and $ret .= "\tselect powerpc64\n"; /powerpc64/ and $ret .= "\tselect powerpc64\n";
/nommu/ and $ret .= "\tselect NOMMU\n"; /nommu/ and $ret .= "\tselect NOMMU\n";
/mips16/ and $ret .= "\tselect HAS_MIPS16\n";
} }
return $ret; return $ret;
} }

View File

@ -66,6 +66,10 @@ config PROFILE_KCONFIG
config NOMMU config NOMMU
bool bool
config HAS_MIPS16
depends (mips || mipsel || mips64 || mips64el)
bool
# Architecture selection # Architecture selection
config arm config arm