toolchain: Add the possibility to have a mcpu option with wrapper
authorStany MARCEL <stanypub@gmail.com>
Tue, 1 Nov 2011 12:19:16 +0000 (13:19 +0100)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 2 Nov 2011 10:48:05 +0000 (11:48 +0100)
Permit to define the mcpu of the external toolchain wrapper, based on
BR2_GCC_TARGET_CPU.

Signed-off-by: Stany MARCEL <stanypub@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
toolchain/toolchain-external/ext-tool.mk
toolchain/toolchain-external/ext-toolchain-wrapper.c

index 572917ff0b9277309a555d78c2dae507dcfa5f13..a52621cd7ba3033a12fc97bb5456408b5f3cf65f 100644 (file)
@@ -127,6 +127,7 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS = \
        -DBR_SYSROOT='"$(STAGING_DIR)"'
 
 CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
+CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU))
 CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
 CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
 
@@ -140,6 +141,10 @@ ifneq ($(CC_TARGET_ARCH_),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -march=$(CC_TARGET_ARCH_)
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_ARCH='"$(CC_TARGET_ARCH_)"'
 endif
+ifneq ($(CC_TARGET_CPU_),)
+TOOLCHAIN_EXTERNAL_CFLAGS += -mcpu=$(CC_TARGET_CPU_)
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_CPU='"$(CC_TARGET_CPU_)"'
+endif
 ifneq ($(CC_TARGET_ABI_),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -mabi=$(CC_TARGET_ABI_)
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_ABI='"$(CC_TARGET_ABI_)"'
index 3e230616101196b6441b354e5210497da1dee599..cc404f3e947796cd06b711c626387aa640721a22 100644 (file)
@@ -28,6 +28,9 @@ static char *predef_args[] = {
 #ifdef BR_TUNE
        "-mtune=" BR_TUNE,
 #endif /* BR_TUNE */
+#ifdef BR_CPU
+       "-mcpu=" BR_CPU,
+#endif
 #ifdef BR_ABI
        "-mabi=" BR_ABI,
 #endif