[Buildroot] [PATCHv2 12/25] arch: introduce BR2_GCC_TARGET_{FPU, FLOAT}

Peter Korsgaard jacmet at uclibc.org
Sun Jul 14 20:36:23 UTC 2013

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni at free-electrons.com> writes:

 Thomas> Buildroot already has the BR2_GCC_TARGET_{TUNE,ARCH,ABI,CPU} hidden
 Thomas> kconfig strings that allow per-architecture Config.in files to feed
 Thomas> the appropriate values of --with-{tune,arch,abi-cpu} when building
 Thomas> gcc, or the appropriate flags for the external toolchain wrapper.

 Thomas> This commit has two additional options: BR2_GCC_TARGET_{FPU,FLOAT},
 Thomas> that allows to define the --with-{fpu,float} gcc configure options for
 Thomas> the internal backend, or the -mfpu/-mfloat-abi options for the flags
 Thomas> of the external toolchain wrapper.

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
 Thomas> ---
 Thomas>  arch/Config.in                                       |  6 ++++++
 Thomas>  package/gcc/gcc.mk                                   | 10 ++++++++++
 Thomas>  toolchain/toolchain-external/ext-tool.mk             | 10 ++++++++++
 Thomas>  toolchain/toolchain-external/ext-toolchain-wrapper.c |  6 ++++++
 Thomas>  4 files changed, 32 insertions(+)

 Thomas> diff --git a/arch/Config.in b/arch/Config.in
 Thomas> index 5ca05cd..d95d4ef 100644
 Thomas> --- a/arch/Config.in
 Thomas> +++ b/arch/Config.in
 Thomas> @@ -192,6 +192,12 @@ config BR2_GCC_TARGET_CPU
 Thomas>  	string
 Thomas> +config BR2_GCC_TARGET_FPU
 Thomas> +	string
 Thomas> +
 Thomas> +config BR2_GCC_TARGET_FLOAT_ABI
 Thomas> +	string

This looks fishy. The commit message talks about TARGET_FLOAT, but you
are adding TARGET_FLOAT_ABI here.

 Thomas> +
 Thomas>  # Set up target binary format
 Thomas>  choice
 Thomas>  	prompt "Target Binary Format"
 Thomas> diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
 Thomas> index 8bd65fc..bfc41a4 100644
 Thomas> --- a/package/gcc/gcc.mk
 Thomas> +++ b/package/gcc/gcc.mk
 Thomas> @@ -167,6 +167,16 @@ HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU))
 Thomas>  endif
 Thomas>  endif
 Thomas> +GCC_TARGET_FPU = $(call qstrip,$(BR2_GCC_TARGET_FPU))
 Thomas> +ifneq ($(GCC_TARGET_FPU),)
 Thomas> +HOST_GCC_COMMON_CONF_OPT += --with-fpu=$(GCC_TARGET_FPU)
 Thomas> +endif
 Thomas> +
 Thomas> +GCC_TARGET_FLOAT_ABI = $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
 Thomas> +ifneq ($(GCC_TARGET_FLOAT_ABI),)

And passing it as --with-float here.

 Thomas> +++ b/toolchain/toolchain-external/ext-tool.mk
 Thomas> @@ -145,6 +145,8 @@ CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISIO
 Thomas>  endif
 Thomas>  CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
 Thomas>  CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
 Thomas> +CC_TARGET_FLOAT_:=$(call qstrip,$(BR2_GCC_TARGET_FLOAT))
 Thomas> +CC_TARGET_FPU_:=$(call qstrip,$(BR2_GCC_TARGET_FPU))

Here you use TARGET_FLOAT.

NIT: It would be a bit nicer to keep them in the same order as Config.in
/ gcc.mk.

 Thomas>  # march/mtune/floating point mode needs to be passed to the external toolchain
 Thomas>  # to select the right multilib variant
 Thomas> @@ -168,6 +170,14 @@ ifneq ($(CC_TARGET_ABI_),)
 Thomas>  endif
 Thomas> +ifneq ($(CC_TARGET_FLOAT_),)

And pass it as -mfloat-abi here (except you used the wrong variable, so
it's never passed).

What was the idea here?

Bye, Peter Korsgaard

More information about the buildroot mailing list