buildroot: allow enabling MIPS16 user-space build
authorFlorian Fainelli <florian@openwrt.org>
Fri, 5 Apr 2013 12:36:12 +0000 (12:36 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Fri, 5 Apr 2013 12:36:12 +0000 (12:36 +0000)
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

Config.in
rules.mk
scripts/metadata.pl
target/Config.in

index 8de6e1aa877498ae998cf49fc82d15fd9f80f685..7b03c7a245e9a7ec8cf2fa1ebb8ff1b243f1d1ff 100644 (file)
--- a/Config.in
+++ b/Config.in
@@ -681,6 +681,17 @@ menuconfig TARGET_OPTIONS
 
                  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 "target/imagebuilder/Config.in"
index 59ab50b92262510fbc7fab3d9f64aa3adaa655c0..56129917e453f32b7f7e5305435dd6fabbdfcd49 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -63,6 +63,9 @@ endif
 ifneq ($(filter -mips%r2,$(TARGET_OPTIMIZATION)),)
   ARCH_SUFFIX:=_r2
 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
index b04cd8cc3d943c470a952b7bce79b42d9b36caef..6249127e3ddfc158626a8e1ab8f7adf91221e2e9 100755 (executable)
@@ -174,6 +174,7 @@ sub target_config_features(@) {
                /ramdisk/ and $ret .= "\tselect USES_INITRAMFS\n";
                /powerpc64/ and $ret .= "\tselect powerpc64\n";
                /nommu/ and $ret .= "\tselect NOMMU\n";
+               /mips16/ and $ret .= "\tselect HAS_MIPS16\n";
        }
        return $ret;
 }
index 31f3ced51df20722dc6a6b773ea486d32ef9e313..79a91b1afb352a44c0ec4003a4eb3736047658f1 100644 (file)
@@ -66,6 +66,10 @@ config PROFILE_KCONFIG
 config NOMMU
        bool
 
+config HAS_MIPS16
+       depends (mips || mipsel || mips64 || mips64el)
+       bool
+
 # Architecture selection
 
 config arm