All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support
@ 2013-07-16  8:03 Thomas Petazzoni
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 01/14] arch: introduce BR2_GCC_TARGET_{FPU, FLOAT_ABI} Thomas Petazzoni
                   ` (13 more replies)
  0 siblings, 14 replies; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

Hello,

Here is a patch series that:

 * improves the support for various floating point possibilities on
   ARM
 * adds support for the ARM EABIhf ABI
 * adds support for the Thumb2 instruction set

Changes since v2:
 * Dropped OABI removal patches, since they have been merged
 * Dropped patch passing gcc options to initial and intermediate
   passes, since it has been merged
 * Fixed the usage of BR2_GCC_TARGET_FLOAT_ABI, as noticed by
   Peter.
 * Added some comments on BR2_GCC_TARGET_FPU, BR2_GCC_TARGET_FLOAT_ABI
   and BR2_GCC_TARGET_MODE to explain what they do.

Changes since v1:
 * Integration of Yann patches to remove OABI.
 * Integration of a gcc fix for the beaglebone_defconfig (patch 1)
 * Select soft float unconditionally on AVR32. Suggested by Peter.
 * Don't enable soft float by default on PowerPC. Suggested by Peter.
 * Integration of an additional patch doing some tab/spaces cleanup in
   arch/Config.in*
 * Support for the Thumb2 instruction set

In summary:

 * Patch 1 introduces the BR2_GCC_TARGET_FLOAT_ABI and
   BR2_GCC_TARGET_FPU hidden options, that will be used by the
   Config.in.<arch> files to define which -mfloat-abi= and -mfpu=
   values they want.

 * Patch 2 moves BR2_SOFT_FLOAT as global hidden option, and adds
   per-architecture visible options. This will allow each architecture
   to do its own business in terms of floating point strategy
   selection, while still providing a global BR2_SOFT_FLOAT for
   Buildroot code that needs to know whether floating point is
   emulated in software or not.

 * Patch 3 is the core of the patch set, adding many new options to
   select various VFP versions for various ARM cores, and adding
   support for the EABIhf ARM ABI. A special attention has been made
   on the Config.in help texts, to help the user making the right
   choice in terms of VFP selection.

 * Patch 4 and 5 adjust gcc and binutils version availabilities
   according to the selected ABI or VFP version.

 * Patch 6 removes the BR2_VFP_FLOAT option that no longer makes any
   sense.

 * Patch 7 updates some defconfig that were using BR2_VFP_FLOAT.

 * Patch 8 updates the beaglebone_defconfig to use EABIhf.

 * Patch 9 updates the external toolchain Config.in options after the
   introduction of the VFP selection and EABIhf ABI.

 * Patch 10 adds a fix for EABIhf that consists in creating a specific
   symbolic link for the dynamic loader, which is needed when gcc 4.7
   is used with eglibc.

 * Patch 11, 12 and 13 add the support for Thumb2

 * Patch 14 makes some minor space vs. tabs cleanups.

Thanks,

Thomas

Thomas Petazzoni (14):
  arch: introduce BR2_GCC_TARGET_{FPU,FLOAT_ABI}
  arch: Refactor BR2_SOFT_FLOAT into per-architecture options
  arch: improve ARM floating point support and add support for EABIhf
  binutils: exclude binutils versions that don't support EABIhf
  gcc: take into account ARM floating point capabilities
  toolchain: remove the old BR2_VFP_FLOAT option
  configs: update defconfigs after VFP option changes
  configs: use new EABIhf option for beaglebone_defconfig
  toolchain-external: update config options after EABIhf introduction
  gcc: create symbolic link to ld-linux in EABIhf/gcc 4.7/eglibc
  arch/arm: add support for Thumb2
  uclibc: use numbered patches for 0.9.33.2
  uclibc: add Thumb2 fixes
  arch: use tabs instead of spaces in Config.in files

 Config.in.legacy                                   |   9 +
 arch/Config.in                                     |  23 +-
 arch/Config.in.arm                                 | 249 +++++++++++++++++++-
 arch/Config.in.avr32                               |   4 +-
 arch/Config.in.bfin                                |   2 +-
 arch/Config.in.mips                                |  10 +
 arch/Config.in.powerpc                             |   9 +
 configs/beaglebone_defconfig                       |   3 +-
 configs/calao_snowball_defconfig                   |   3 +-
 configs/mx53loco_defconfig                         |   3 +-
 configs/qemu_arm_nuri_defconfig                    |   3 +-
 configs/qemu_arm_vexpress_defconfig                |   3 +-
 package/Makefile.in                                |   6 +
 package/binutils/Config.in.host                    |   3 +
 package/gcc/Config.in.host                         |  10 +
 package/gcc/gcc-final/gcc-final.mk                 |  12 +
 package/gcc/gcc.mk                                 |  15 ++
 ...bc-0001-bits-time.h-sync-with-glibc-2.16.patch} |   9 +-
 ...on-of-MSG_WAITFORONE-and-MSG_CMSG_CLOEXE.patch} |  23 +-
 ...p3.patch => uclibc-0003-Add-dup3-syscall.patch} |  22 +-
 ...eps-add-__kernel_long-and-__kernel_ulong.patch} |   7 +-
 ...uclibc-0005-Patch-from-OpenWRT-for-avr32.patch} |  14 +-
 ...estore-stack-pointer-just-after-return-fr.patch |  42 ++++
 ...e.S-Add-missing-IT-instruction-for-Thumb2.patch |  29 +++
 ...8-arm-move-check-for-BX-to-its-own-header.patch | 257 +++++++++++++++++++++
 toolchain/toolchain-buildroot/Config.in.2          |  12 -
 toolchain/toolchain-common.in                      |  21 --
 toolchain/toolchain-external/Config.in             |  24 +-
 toolchain/toolchain-external/ext-tool.mk           |  20 +-
 .../toolchain-external/ext-toolchain-wrapper.c     |  12 +-
 30 files changed, 768 insertions(+), 91 deletions(-)
 rename package/uclibc/0.9.33.2/{uclibc-bits-time.h-sync-with-glibc-2.16.patch => uclibc-0001-bits-time.h-sync-with-glibc-2.16.patch} (82%)
 rename package/uclibc/0.9.33.2/{uclibc-define-MSG_CMSG_CLOEXEC.patch => uclibc-0002-Add-definition-of-MSG_WAITFORONE-and-MSG_CMSG_CLOEXE.patch} (54%)
 rename package/uclibc/0.9.33.2/{uclibc-dup3.patch => uclibc-0003-Add-dup3-syscall.patch} (73%)
 rename package/uclibc/0.9.33.2/{uclibc-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch => uclibc-0004-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch} (98%)
 rename package/uclibc/0.9.33.2/{uclibc-OpenWRT-140-avr32_atomic_fix.patch => uclibc-0005-Patch-from-OpenWRT-for-avr32.patch} (50%)
 create mode 100644 package/uclibc/0.9.33.2/uclibc-0006-arm-clone-restore-stack-pointer-just-after-return-fr.patch
 create mode 100644 package/uclibc/0.9.33.2/uclibc-0007-arm-clone.S-Add-missing-IT-instruction-for-Thumb2.patch
 create mode 100644 package/uclibc/0.9.33.2/uclibc-0008-arm-move-check-for-BX-to-its-own-header.patch

-- 
1.8.1.2

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 01/14] arch: introduce BR2_GCC_TARGET_{FPU, FLOAT_ABI}
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 11:48   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options Thomas Petazzoni
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

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

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

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

diff --git a/arch/Config.in b/arch/Config.in
index 5ca05cd..5bb96c5 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -192,6 +192,18 @@ config BR2_GCC_TARGET_CPU
 config BR2_GCC_TARGET_CPU_REVISION
 	string
 
+# The value of this option will be passed as --with-fpu=<value> when
+# building gcc (internal backend) or -mfpu=<value> in the toolchain
+# wrapper (external toolchain)
+config BR2_GCC_TARGET_FPU
+	string
+
+# The value of this option will be passed as --with-float=<value> when
+# building gcc (internal backend) or -mfloat-abi=<value> in the toolchain
+# wrapper (external toolchain)
+config BR2_GCC_TARGET_FLOAT_ABI
+	string
+
 # Set up target binary format
 choice
 	prompt "Target Binary Format"
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 8bd65fc..bfc41a4 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -167,6 +167,16 @@ HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU))
 endif
 endif
 
+GCC_TARGET_FPU = $(call qstrip,$(BR2_GCC_TARGET_FPU))
+ifneq ($(GCC_TARGET_FPU),)
+HOST_GCC_COMMON_CONF_OPT += --with-fpu=$(GCC_TARGET_FPU)
+endif
+
+GCC_TARGET_FLOAT_ABI = $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
+ifneq ($(GCC_TARGET_FLOAT_ABI),)
+HOST_GCC_COMMON_CONF_OPT += --with-float=$(GCC_TARGET_FLOAT_ABI)
+endif
+
 # Branding works on >= 4.3
 ifneq ($(findstring x4.2.,x$(GCC_VERSION)),x4.2.)
 HOST_GCC_COMMON_CONF_OPT += \
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 8d9f458..9d3dec4 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -145,6 +145,8 @@ CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISIO
 endif
 CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
 CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
+CC_TARGET_FPU_:=$(call qstrip,$(BR2_GCC_TARGET_FPU))
+CC_TARGET_FLOAT_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
 
 # march/mtune/floating point mode needs to be passed to the external toolchain
 # to select the right multilib variant
@@ -168,6 +170,14 @@ ifneq ($(CC_TARGET_ABI_),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -mabi=$(CC_TARGET_ABI_)
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_ABI='"$(CC_TARGET_ABI_)"'
 endif
+ifneq ($(CC_TARGET_FPU_),)
+TOOLCHAIN_EXTERNAL_CFLAGS += -mfpu=$(CC_TARGET_FPU_)
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_FPU='"$(CC_TARGET_FPU_)"'
+endif
+ifneq ($(CC_TARGET_FLOAT_ABI_),)
+TOOLCHAIN_EXTERNAL_CFLAGS += -mfloat-abi=$(CC_TARGET_FLOAT_ABI_)
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_FLOAT_ABI='"$(CC_TARGET_FLOAT_ABI_)"'
+endif
 ifeq ($(BR2_BINFMT_FLAT),y)
 TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
index 9d79d68..f81aed4 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -38,6 +38,12 @@ static char *predef_args[] = {
 #ifdef BR_ABI
 	"-mabi=" BR_ABI,
 #endif
+#ifdef BR_FLOAT_ABI
+	"-mfloat-abi=" BR_FLOAT_ABI,
+#endif
+#ifdef BR2_FPU
+	"-mfpu=" BR_FPU,
+#endif
 #ifdef BR_SOFTFLOAT
 	"-msoft-float",
 #endif /* BR_SOFTFLOAT */
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 01/14] arch: introduce BR2_GCC_TARGET_{FPU, FLOAT_ABI} Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 11:53   ` Peter Korsgaard
  2013-07-16 13:12   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 03/14] arch: improve ARM floating point support and add support for EABIhf Thomas Petazzoni
                   ` (11 subsequent siblings)
  13 siblings, 2 replies; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

As we are going to introduced a more advanced support of floating
point options for the ARM architecture, we need to adjust how the
soft-float option is handled. We replace the current hidden option
BR2_PREFER_SOFT_FLOAT option and the visible BR2_SOFT_FLOAT option by:

 * A global hidden BR2_SOFT_FLOAT option, defined in arch/Config.in,
   that tells whether the architecture-specific code is using software
   emulated floating point. This hidden option can be used throughout
   Buildroot to determine whether soft float is used or not.

 * Per-architecture visible BR2_<arch>_SOFT_FLOAT options, for the
   architecture for which it makes sense, which allows users to select
   soft float emulation when needed.

This change will allow each architecture to have a different way of
presenting its floating point capabilities.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/Config.in                |  3 +++
 arch/Config.in.arm            | 10 ++++++++++
 arch/Config.in.mips           | 10 ++++++++++
 arch/Config.in.powerpc        |  9 +++++++++
 toolchain/toolchain-common.in | 21 ---------------------
 5 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/arch/Config.in b/arch/Config.in
index 5bb96c5..c2dc9e8 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -1,6 +1,9 @@
 config BR2_ARCH_IS_64
        bool
 
+config BR2_SOFT_FLOAT
+	bool
+
 choice
 	prompt "Target Architecture"
 	default BR2_i386
diff --git a/arch/Config.in.arm b/arch/Config.in.arm
index 027dac2..29b2b45 100644
--- a/arch/Config.in.arm
+++ b/arch/Config.in.arm
@@ -79,6 +79,16 @@ endchoice
 config BR2_ARM_EABI
 	def_bool y
 
+config BR2_ARM_SOFT_FLOAT
+	bool "Use soft-float"
+	default y
+	select BR2_SOFT_FLOAT
+	help
+	  If your target CPU does not have a Floating Point Unit (FPU)
+	  or a kernel FPU emulator, but you still wish to support
+	  floating point functions, then everything will need to be
+	  compiled with soft floating point support (-msoft-float).
+
 config BR2_ARM_ENABLE_NEON
 	bool "Enable NEON SIMD extension support"
 	depends on BR2_ARM_CPU_MAYBE_HAS_NEON
diff --git a/arch/Config.in.mips b/arch/Config.in.mips
index 1454fb4..6242bcc 100644
--- a/arch/Config.in.mips
+++ b/arch/Config.in.mips
@@ -52,6 +52,16 @@ config BR2_MIPS_NABI64
 	depends on BR2_ARCH_IS_64
 endchoice
 
+config BR2_MIPS_SOFT_FLOAT
+	bool "Use soft-float"
+	default y
+	select BR2_SOFT_FLOAT
+	help
+	  If your target CPU does not have a Floating Point Unit (FPU)
+	  or a kernel FPU emulator, but you still wish to support
+	  floating point functions, then everything will need to be
+	  compiled with soft floating point support (-msoft-float).
+
 config BR2_ARCH
 	default "mips"		if BR2_mips
 	default "mipsel"	if BR2_mipsel
diff --git a/arch/Config.in.powerpc b/arch/Config.in.powerpc
index 8643efc..ae70a8a 100644
--- a/arch/Config.in.powerpc
+++ b/arch/Config.in.powerpc
@@ -88,6 +88,15 @@ config BR2_powerpc_SPE
 	depends on BR2_powerpc_8540 || BR2_powerpc_8548
 endchoice
 
+config BR2_POWERPC_SOFT_FLOAT
+	bool "Use soft-float"
+	select BR2_SOFT_FLOAT
+	help
+	  If your target CPU does not have a Floating Point Unit (FPU)
+	  or a kernel FPU emulator, but you still wish to support
+	  floating point functions, then everything will need to be
+	  compiled with soft floating point support (-msoft-float).
+
 config BR2_ARCH
 	default "powerpc"	if BR2_powerpc
 
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index 7c9b842..dc3bd2a 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -90,27 +90,6 @@ config BR2_USE_MMU
 	  If your target has a MMU, you should say Y here.  If you
 	  are unsure, just say Y.
 
-config BR2_PREFER_SOFT_FLOAT
-	bool
-	default y if BR2_arm
-	default y if BR2_armeb
-	default y if BR2_avr32
-	default y if BR2_mips
-	default y if BR2_mipsel
-
-config BR2_SOFT_FLOAT
-	bool "Use software floating point by default"
-	depends on BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel || BR2_powerpc
-	# External toolchains will automatically do soft float or hard
-	# float depending on their configuration
-	depends on BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_CTNG
-	default $(BR2_PREFER_SOFT_FLOAT)
-	help
-	  If your target CPU does not have a Floating Point Unit (FPU) or a
-	  kernel FPU emulator, but you still wish to support floating point
-	  functions, then everything will need to be compiled with soft
-	  floating point support (-msoft-float).
-
 config BR2_TARGET_OPTIMIZATION
 	string "Target Optimizations"
 	default "-pipe"
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 03/14] arch: improve ARM floating point support and add support for EABIhf
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 01/14] arch: introduce BR2_GCC_TARGET_{FPU, FLOAT_ABI} Thomas Petazzoni
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:12   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 04/14] binutils: exclude binutils versions that don't support EABIhf Thomas Petazzoni
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

This commit introduces the support for the EABIhf ABI, next to the
existing support we have for EABI and OABI (even though OABI support
is deprecated). EABIhf allows to improve performance of floating point
workload by using floating point registers to transfer floating point
arguments when calling functions, instead of using integer registers
to do, as is done in the 'softfp' floating point model of EABI.

In addition to this, this commit introduces a list of options for the
floating point support:
 * Software floating point
 * VFP
 * VFPv3
 * VFPv3-D16
 * VFPv4
 * VFPv4-D16

and it introduces some logic to make sure the options are only visible
when it makes sense, depending on the ARM core being selected. This is
however made complicated by the fact that certain VFP capabilities are
mandatory on some cores, but optional on some other cores. The kconfig
logic tries to achieve the following goals:

 * Hide options that are definitely not possible.

 * Use safe default values (i.e for Cortex-A5 and A7, the presence of
   the VFPv4 unit is optional, so we default on software floating
   point on these cores)..

 * Show the available possibilities, even if some of them are not
   necessarily working on a particular core (again, for the Cortex-A5
   and A7 cores, there is no way of knowing whether the particular
   variant used by the user has VFPv4 or not, so we select software
   floating point by default, but still show VFP/VFPv3/VFPv4 options).

It is worth noting that this commit doesn't add support for all
possible -mfpu= values on ARM. We haven't added support for fpa, fpe2,
fpe3, maverick (those four are only used on very old ARM cores), for
vfpv3-fp16, vfpv3-d16-fp16, vfpv3xd, vfpv3xd-fp16, neon-fp16,
vfpv4-sp-d16. They can be added quite easily if needed thanks to the
new organization of the Config.in options.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/Config.in.arm  | 219 ++++++++++++++++++++++++++++++++++++++++++++++++----
 package/Makefile.in |   6 ++
 2 files changed, 211 insertions(+), 14 deletions(-)

diff --git a/arch/Config.in.arm b/arch/Config.in.arm
index 29b2b45..2b493c0 100644
--- a/arch/Config.in.arm
+++ b/arch/Config.in.arm
@@ -6,6 +6,31 @@ config BR2_ARM_CPU_HAS_NEON
 config BR2_ARM_CPU_MAYBE_HAS_NEON
 	bool
 
+# for some cores, VFPv2 is optional
+config BR2_ARM_CPU_MAYBE_HAS_VFPV2
+	bool
+
+config BR2_ARM_CPU_HAS_VFPV2
+	bool
+
+# for some cores, VFPv3 is optional
+config BR2_ARM_CPU_MAYBE_HAS_VFPV3
+	bool
+	select BR2_ARM_CPU_MAYBE_HAS_VFPV2
+
+config BR2_ARM_CPU_HAS_VFPV3
+	bool
+	select BR2_ARM_CPU_HAS_VFPV2
+
+# for some cores, VFPv4 is optional
+config BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	bool
+	select BR2_ARM_CPU_MAYBE_HAS_VFPV3
+
+config BR2_ARM_CPU_HAS_VFPV4
+	bool
+	select BR2_ARM_CPU_HAS_VFPV3
+
 choice
 	prompt "Target Architecture Variant"
 	depends on BR2_arm || BR2_armeb
@@ -27,31 +52,40 @@ config BR2_arm10t
 	bool "arm10t"
 config BR2_arm1136jf_s_r0
 	bool "arm1136jf_s rev0"
+	select BR2_ARM_CPU_HAS_VFPV2
 config BR2_arm1136jf_s_r1
 	bool "arm1136jf_s rev1"
+	select BR2_ARM_CPU_HAS_VFPV2
 config BR2_arm1176jz_s
 	bool "arm1176jz-s"
 config BR2_arm1176jzf_s
 	bool "arm1176jzf-s"
+	select BR2_ARM_CPU_HAS_VFPV2
 config BR2_cortex_a5
 	bool "cortex-A5"
 	select BR2_ARM_CPU_MAYBE_HAS_NEON
+	select BR2_ARM_CPU_MAYBE_HAS_VFPV4
 config BR2_cortex_a7
 	bool "cortex-A7"
 	select BR2_ARM_CPU_HAS_NEON
+	select BR2_ARM_CPU_HAS_VFPV4
 config BR2_cortex_a8
 	bool "cortex-A8"
 	select BR2_ARM_CPU_HAS_NEON
+	select BR2_ARM_CPU_HAS_VFPV3
 config BR2_cortex_a9
 	bool "cortex-A9"
 	select BR2_ARM_CPU_MAYBE_HAS_NEON
+	select BR2_ARM_CPU_MAYBE_HAS_VFPV3
 config BR2_cortex_a15
 	bool "cortex-A15"
 	select BR2_ARM_CPU_HAS_NEON
+	select BR2_ARM_CPU_HAS_VFPV4
 config BR2_fa526
 	bool "fa526/626"
 config BR2_pj4
 	bool "pj4"
+	select BR2_ARM_CPU_HAS_VFPV3
 config BR2_strongarm
 	bool "strongarm sa110/sa1100"
 config BR2_xscale
@@ -67,27 +101,56 @@ config BR2_arm1136jf_s
 choice
 	prompt "Target ABI"
 	depends on BR2_arm || BR2_armeb
-	depends on BR2_DEPRECATED
 	default BR2_ARM_EABI
 	help
-	  Application Binary Interface to use
+	  Application Binary Interface to use. The Application Binary
+	  Interface describes the calling conventions (how arguments
+	  are passed to functions, how the return value is passed, how
+	  system calls are made, etc.).
 
-config BR2_ARM_EABI_CHOICE
+config BR2_ARM_EABI
 	bool "EABI"
-endchoice
+	help
+	  The EABI is currently the standard ARM ABI, which is used in
+	  most projects. It supports both the 'soft' floating point
+	  model (in which floating point instructions are emulated in
+	  software) and the 'softfp' floating point model (in which
+	  floating point instructions are executed using an hardware
+	  floating point unit, but floating point arguments to
+	  functions are passed in integer registers).
 
-config BR2_ARM_EABI
-	def_bool y
+	  The 'softfp' floating point model is link-compatible with
+	  the 'soft' floating point model, i.e you can link a library
+	  built 'soft' with some other code built 'softfp'.
 
-config BR2_ARM_SOFT_FLOAT
-	bool "Use soft-float"
-	default y
-	select BR2_SOFT_FLOAT
+	  However, passing the floating point arguments in integer
+	  registers is a bit inefficient, so if your ARM processor has
+	  a floating point unit, and you don't have pre-compiled
+	  'soft' or 'softfp' code, using the EABIhf ABI will provide
+	  better floating point performances.
+
+	  If your processor does not have a floating point unit, then
+	  you must use this ABI.
+
+config BR2_ARM_EABIHF
+	bool "EABIhf"
+	depends on BR2_ARM_CPU_MAYBE_HAS_VFPV2 || BR2_ARM_CPU_HAS_VFPV2
 	help
-	  If your target CPU does not have a Floating Point Unit (FPU)
-	  or a kernel FPU emulator, but you still wish to support
-	  floating point functions, then everything will need to be
-	  compiled with soft floating point support (-msoft-float).
+	  The EABIhf is an extension of EABI which supports the 'hard'
+	  floating point model. This model uses the floating point
+	  unit to execute floating point instructions, and passes
+	  floating point arguments in floating point registers.
+
+	  It is more efficient than EABI for floating point related
+	  workload. However, it does not allow to link against code
+	  that has been pre-built for the 'soft' or 'softfp' floating
+	  point models.
+
+	  If your processor has a floating point unit, and you don't
+	  depend on existing pre-compiled code, this option is most
+	  likely the best choice.
+
+endchoice
 
 config BR2_ARM_ENABLE_NEON
 	bool "Enable NEON SIMD extension support"
@@ -98,6 +161,120 @@ config BR2_ARM_ENABLE_NEON
 	  Select this option if you are certain your particular
 	  implementation has NEON support and you want to use it.
 
+choice
+	prompt "Floating point strategy"
+	depends on BR2_ARM_EABI || BR2_ARM_EABIHF
+	default BR2_ARM_FPU_VFPV4D16 if BR2_ARM_CPU_HAS_VFPV4
+	default BR2_ARM_FPU_VFPV3D16 if BR2_ARM_CPU_HAS_VFPV3
+	default BR2_ARM_FPU_VFPV2 if BR2_ARM_CPU_HAS_VFPV2
+	default BR2_ARM_SOFT_FLOAT if !BR2_ARM_CPU_HAS_VFPV2
+
+config BR2_ARM_SOFT_FLOAT
+	bool "Soft float"
+	depends on BR2_ARM_EABI
+	select BR2_SOFT_FLOAT
+	help
+	  This option allows to use software emulated floating
+	  point. It should be used for ARM cores that do not include a
+	  Vector Floating Point unit, such as ARMv5 cores (ARM926 for
+	  example) or certain ARMv6 cores.
+
+config BR2_ARM_FPU_VFPV2
+	bool "VFPv2"
+	depends on BR2_ARM_CPU_HAS_VFPV2 || BR2_ARM_CPU_MAYBE_HAS_VFPV2
+	help
+	  This option allows to use the VFPv2 floating point unit, as
+	  available in some ARMv6 processors (ARM1136JF-S,
+	  ARM1176JZF-S and ARM11 MPCore).
+
+	  Note that this option is also safe to use for newer cores
+	  such as Cortex-A, because the VFPv3 and VFPv4 units are
+	  backward compatible with VFPv2.
+
+config BR2_ARM_FPU_VFPV3
+	bool "VFPv3"
+	depends on BR2_ARM_CPU_HAS_VFPV3 || BR2_ARM_CPU_MAYBE_HAS_VFPV3
+	help
+	  This option allows to use the VFPv3 floating point unit, as
+	  available in some ARMv7 processors (Cortex-A{8, 9}). This
+	  option requires a VFPv3 unit that has 32 double-precision
+	  registers, which is not necessarily the case in all SOCs
+	  based on Cortex-A{8, 9}. If you're unsure, use VFPv3-D16
+	  instead, which is guaranteed to work on all Cortex-A{8, 9}.
+
+	  Note that this option is also safe to use for newer cores
+	  that have a VFPv4 unit, because VFPv4 is backward compatible
+	  with VFPv3. They must of course also have 32
+	  double-precision registers.
+
+config BR2_ARM_FPU_VFPV3D16
+	bool "VFPv3-D16"
+	depends on BR2_ARM_CPU_HAS_VFPV3 || BR2_ARM_CPU_MAYBE_HAS_VFPV3
+	help
+	  This option allows to use the VFPv3 floating point unit, as
+	  available in some ARMv7 processors (Cortex-A{8, 9}). This
+	  option requires a VFPv3 unit that has 16 double-precision
+	  registers, which is generally the case in all SOCs based on
+	  Cortex-A{8, 9}, even though VFPv3 is technically optional on
+	  Cortex-A9. This is the safest option for those cores.
+
+	  Note that this option is also safe to use for newer cores
+	  such that have a VFPv4 unit, because the VFPv4 is backward
+	  compatible with VFPv3.
+
+config BR2_ARM_FPU_VFPV4
+	bool "VFPv4"
+	depends on BR2_ARM_CPU_HAS_VFPV4 || BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	help
+	  This option allows to use the VFPv4 floating point unit, as
+	  available in some ARMv7 processors (Cortex-A{5, 7, 12,
+	  15}). This option requires a VFPv4 unit that has 32
+	  double-precision registers, which is not necessarily the
+	  case in all SOCs based on Cortex-A{5, 7, 12, 15}. If you're
+	  unsure, you should probably use VFPv4-D16 instead.
+
+	  Note that if you want binary code that works on all ARMv7
+	  cores, including the earlier Cortex-A{8, 9}, you should
+	  instead select VFPv3.
+
+config BR2_ARM_FPU_VFPV4D16
+	bool "VFPv4-D16"
+	depends on BR2_ARM_CPU_HAS_VFPV4 || BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	help
+	  This option allows to use the VFPv4 floating point unit, as
+	  available in some ARMv7 processors (Cortex-A{5, 7, 12,
+	  15}). This option requires a VFPv4 unit that has 16
+	  double-precision registers, which is always available on
+	  Cortex-A12 and Cortex-A15, but optional on Cortex-A5 and
+	  Cortex-A7.
+
+	  Note that if you want binary code that works on all ARMv7
+	  cores, including the earlier Cortex-A{8, 9}, you should
+	  instead select VFPv3-D16.
+
+config BR2_ARM_FPU_NEON
+	bool "NEON"
+	depends on BR2_ARM_CPU_HAS_NEON
+	help
+	  This option allows to use the NEON SIMD unit, as available
+	  in some ARMv7 processors, as a floating-point unit. It
+	  should however be noted that using NEON for floating point
+	  operations doesn't provide a complete compatibility with the
+	  IEEE 754.
+
+config BR2_ARM_FPU_NEON_VFPV4
+	bool "NEON/VFPv4"
+	depends on BR2_ARM_CPU_HAS_VFPV4 || BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	depends on BR2_ARM_CPU_HAS_NEON
+	help
+	  This option allows to use both the VFPv4 and the NEON SIMD
+	  units for floating point operations. Note that some ARMv7
+	  cores do not necessarily have VFPv4 and/or NEON support, for
+	  example on Cortex-A5 and Cortex-A7, support for VFPv4 and
+	  NEON is optional.
+
+endchoice
+
 config BR2_ARCH
 	default "arm"	if BR2_arm
 	default "armeb"	if BR2_armeb
@@ -153,3 +330,17 @@ config BR2_GCC_TARGET_ARCH
 
 config BR2_GCC_TARGET_ABI
 	default "aapcs-linux"
+
+config BR2_GCC_TARGET_FPU
+	default "vfp"		if BR2_ARM_FPU_VFPV2
+	default "vfpv3"		if BR2_ARM_FPU_VFPV3
+	default "vfpv3-d16" 	if BR2_ARM_FPU_VFPV3D16
+	default "vfpv4" 	if BR2_ARM_FPU_VFPV4
+	default "vfpv4-d16" 	if BR2_ARM_FPU_VFPV4D16
+	default "neon" 		if BR2_ARM_FPU_NEON
+	default "neon-vfpv4" 	if BR2_ARM_FPU_NEON_VFPV4
+
+config BR2_GCC_TARGET_FLOAT_ABI
+	default "soft"		if BR2_ARM_SOFT_FLOAT
+	default "softfp"	if !BR2_ARM_SOFT_FLOAT && BR2_ARM_EABI
+	default "hard"		if !BR2_ARM_SOFT_FLOAT && BR2_ARM_EABIHF
diff --git a/package/Makefile.in b/package/Makefile.in
index 06db122..a597290 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -39,6 +39,12 @@ ABI=gnueabi
 else
 ABI=eabi
 endif
+else ifeq ($(BR2_ARM_EABIHF),y)
+ifeq ($(LIBC),uclibc)
+ABI=gnueabihf
+else
+ABI=eabihf
+endif
 endif
 
 # For FSL PowerPC there's SPE
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 04/14] binutils: exclude binutils versions that don't support EABIhf
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 03/14] arch: improve ARM floating point support and add support for EABIhf Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:12   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 05/14] gcc: take into account ARM floating point capabilities Thomas Petazzoni
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

The ARM EABIhf support was introduced in Binutils 2.22, so earlier
versions should not be selected when EABIhf is used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/binutils/Config.in.host | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host
index 3d687fe..9ddaed7 100644
--- a/package/binutils/Config.in.host
+++ b/package/binutils/Config.in.host
@@ -14,14 +14,17 @@ choice
 
 	config BR2_BINUTILS_VERSION_2_20_1
 		depends on !BR2_avr32
+		depends on !BR2_ARM_EABIHF
 		bool "binutils 2.20.1"
 
 	config BR2_BINUTILS_VERSION_2_21
 		depends on !BR2_avr32
+		depends on !BR2_ARM_EABIHF
 		bool "binutils 2.21"
 
 	config BR2_BINUTILS_VERSION_2_21_1
 		depends on !BR2_avr32
+		depends on !BR2_ARM_EABIHF
 		bool "binutils 2.21.1"
 
 	config BR2_BINUTILS_VERSION_2_22
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 05/14] gcc: take into account ARM floating point capabilities
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 04/14] binutils: exclude binutils versions that don't support EABIhf Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:13   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 06/14] toolchain: remove the old BR2_VFP_FLOAT option Thomas Petazzoni
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

The ARM EABIhf support was introduced in gcc 4.6.x, so versions
earlier than this one should not be used when EABIhf is selected.

The ARM VFPv4 support was introduced in gcc 4.5.x, so versions earlier
than this one should not be used when VFPv4 is used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/Config.in.host | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
index a529d14..1f9aa9a 100644
--- a/package/gcc/Config.in.host
+++ b/package/gcc/Config.in.host
@@ -22,15 +22,22 @@ choice
 
 	config BR2_GCC_VERSION_4_3_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_cortex_a5 && !BR2_cortex_a7 && !BR2_cortex_a8 && !BR2_cortex_a9 && !BR2_cortex_a15 && !BR2_x86_atom && !BR2_powerpc_e300c2 && !BR2_powerpc_e300c3 && !BR2_powerpc_e500mc && !BR2_powerpc_464 && !BR2_powerpc_464fp && !BR2_powerpc_476 && !BR2_powerpc_476fp && !BR2_fa526 && !BR2_pj4
+		depends on !BR2_ARM_EABIHF
 		bool "gcc 4.3.x"
 
 	config BR2_GCC_VERSION_4_4_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_cortex_a5 && !BR2_cortex_a7 && !BR2_cortex_a15 && !BR2_x86_atom && !BR2_powerpc_476 && !BR2_powerpc_476fp && !BR2_fa526 && !BR2_pj4
 		bool "gcc 4.4.x"
+		# ARM EABIhf support appeared in gcc 4.6
+		depends on !BR2_ARM_EABIHF
+		# VFPv4 support appeared in gcc 4.5
+		depends on !BR2_ARM_FPU_VFPV4 && !BR2_ARM_FPU_VFPV4D16
 
 	config BR2_GCC_VERSION_4_5_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_cortex_a7 && !BR2_cortex_a15 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_fa526 && !BR2_pj4
 		select BR2_GCC_NEEDS_MPC
+		# ARM EABIhf support appeared in gcc 4.6
+		depends on !BR2_ARM_EABIHF
 		bool "gcc 4.5.x"
 
 	config BR2_GCC_VERSION_4_6_X
@@ -40,17 +47,20 @@ choice
 
 	config BR2_GCC_VERSION_4_7_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_pj4
+		depends on !BR2_ARM_OABI
 		select BR2_GCC_NEEDS_MPC
 		bool "gcc 4.7.x"
 
 	config BR2_GCC_VERSION_4_8_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8
 		select BR2_GCC_NEEDS_MPC
+		depends on !BR2_ARM_OABI
 		bool "gcc 4.8.x"
 
 	config BR2_GCC_VERSION_SNAP
 		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8
 		select BR2_GCC_NEEDS_MPC
+		depends on !BR2_ARM_OABI
 		bool "gcc snapshot"
 endchoice
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 06/14] toolchain: remove the old BR2_VFP_FLOAT option
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 05/14] gcc: take into account ARM floating point capabilities Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:15   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 07/14] configs: update defconfigs after VFP option changes Thomas Petazzoni
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

Now that we have a much better way of selecting between the various
VFP versions and capabilities, the BR2_VFP_FLOAT version no longer
makes sense. This commit gets rid of it, and adds the appropriate
Config.in.legacy code.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 Config.in.legacy                                     |  9 +++++++++
 toolchain/toolchain-buildroot/Config.in.2            | 12 ------------
 toolchain/toolchain-external/ext-tool.mk             |  5 -----
 toolchain/toolchain-external/ext-toolchain-wrapper.c |  3 ---
 4 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/Config.in.legacy b/Config.in.legacy
index 01bf900..b92b656 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -76,6 +76,15 @@ config BR2_ELF2FLT
 	  BR2_PACKAGE_HOST_ELF2FLT due to the conversion of elf2flt to
 	  the package infrastructure.
 
+config BR2_VFP_FLOAT
+	bool "the ARM VFP floating point option has been renamed"
+	select BR2_LEGACY
+	help
+	  Due to a major refactoring of the floating-point handling of
+	  the ARM architecture support, the BR2_VFP_FLOAT option has
+	  been replaced with a choice of options that allows to select
+	  between various VFP versions/capabilities.
+
 ###############################################################################
 comment "Legacy options removed in 2013.05"
 
diff --git a/toolchain/toolchain-buildroot/Config.in.2 b/toolchain/toolchain-buildroot/Config.in.2
index e223d9d..a9c102f 100644
--- a/toolchain/toolchain-buildroot/Config.in.2
+++ b/toolchain/toolchain-buildroot/Config.in.2
@@ -28,16 +28,4 @@ config BR2_TOOLCHAIN_BUILDROOT_USE_SSP
 
 source "package/elf2flt/Config.in.host"
 
-config BR2_VFP_FLOAT
-	bool "Use ARM Vector Floating Point unit"
-	depends on !BR2_SOFT_FLOAT
-	depends on BR2_arm || BR2_armeb
-	help
-	  Setting this option will enable the "-mfpu=vfp" option.
-	  If your ARM CPU has a Vector Floating Point Unit (VFP)
-	  and the toolchain supports the option, then the
-	  code can be optimized.
-
-	  Most people will answer N.
-
 endif
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 9d3dec4..67fc40d 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -196,11 +196,6 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
 endif
 
-ifeq ($(BR2_VFP_FLOAT),y)
-TOOLCHAIN_EXTERNAL_CFLAGS += -mfpu=vfp
-TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_VFPFLOAT=1
-endif
-
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
 TOOLCHAIN_EXTERNAL_DEPENDENCIES = $(TOOLCHAIN_EXTERNAL_DIR)/.extracted
 endif
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
index f81aed4..afca6fa 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -47,9 +47,6 @@ static char *predef_args[] = {
 #ifdef BR_SOFTFLOAT
 	"-msoft-float",
 #endif /* BR_SOFTFLOAT */
-#ifdef BR_VFPFLOAT
-	"-mfpu=vfp",
-#endif /* BR_VFPFLOAT */
 #ifdef BR_64
 	"-m64",
 #endif
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 07/14] configs: update defconfigs after VFP option changes
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 06/14] toolchain: remove the old BR2_VFP_FLOAT option Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:16   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig Thomas Petazzoni
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 configs/calao_snowball_defconfig    | 3 +--
 configs/mx53loco_defconfig          | 3 +--
 configs/qemu_arm_nuri_defconfig     | 3 +--
 configs/qemu_arm_vexpress_defconfig | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/configs/calao_snowball_defconfig b/configs/calao_snowball_defconfig
index 0631b52..90421a4 100644
--- a/configs/calao_snowball_defconfig
+++ b/configs/calao_snowball_defconfig
@@ -1,10 +1,9 @@
 BR2_arm=y
 BR2_cortex_a9=y
 BR2_KERNEL_HEADERS_3_4=y
-# BR2_SOFT_FLOAT is not set
+BR2_ARM_FPU_VFPV3D16=y
 BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
-BR2_VFP_FLOAT=y
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA2"
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig
index ff3948b..08de3da 100644
--- a/configs/mx53loco_defconfig
+++ b/configs/mx53loco_defconfig
@@ -1,8 +1,7 @@
 # Architecture
 BR2_arm=y
 BR2_cortex_a8=y
-# BR2_SOFT_FLOAT is not set
-BR2_VFP_FLOAT=y
+BR2_ARM_FPU_VFPV3D16=y
 
 # System
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
diff --git a/configs/qemu_arm_nuri_defconfig b/configs/qemu_arm_nuri_defconfig
index 26eb815..1e435a6 100644
--- a/configs/qemu_arm_nuri_defconfig
+++ b/configs/qemu_arm_nuri_defconfig
@@ -2,8 +2,7 @@
 BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
-BR2_VFP_FLOAT=y
-# BR2_SOFT_FLOAT is not set
+BR2_ARM_FPU_VFPV3D16=y
 
 # System
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
diff --git a/configs/qemu_arm_vexpress_defconfig b/configs/qemu_arm_vexpress_defconfig
index 12d1d0b..2cc6db9 100644
--- a/configs/qemu_arm_vexpress_defconfig
+++ b/configs/qemu_arm_vexpress_defconfig
@@ -2,8 +2,7 @@
 BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
-BR2_VFP_FLOAT=y
-# BR2_SOFT_FLOAT is not set
+BR2_ARM_FPU_VFPV3D16=y
 
 # System
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (6 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 07/14] configs: update defconfigs after VFP option changes Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:19   ` Peter Korsgaard
  2013-07-16 13:39   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 09/14] toolchain-external: update config options after EABIhf introduction Thomas Petazzoni
                   ` (5 subsequent siblings)
  13 siblings, 2 replies; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 configs/beaglebone_defconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configs/beaglebone_defconfig b/configs/beaglebone_defconfig
index a141320..d6b5c31 100644
--- a/configs/beaglebone_defconfig
+++ b/configs/beaglebone_defconfig
@@ -1,8 +1,7 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a8=y
-BR2_EXTRA_GCC_CONFIG_OPTIONS="--with-fpu=vfpv3 --with-float=hard"
-# BR2_SOFT_FLOAT is not set
+BR2_ARM_EABIHF=y
 
 # system
 BR2_TARGET_GENERIC_HOSTNAME="beaglebone"
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 09/14] toolchain-external: update config options after EABIhf introduction
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (7 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:21   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 10/14] gcc: create symbolic link to ld-linux in EABIhf/gcc 4.7/eglibc Thomas Petazzoni
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

The introduction of the EABIhf ABI requires a few updates to the
configuration options for external toolchains, in order to ensure that
the user doesn't do any invalid selection. In detail:

 * The Linaro ARM toolchains now depend on BR2_ARM_EABIHF, because
   that's the ABI they use, and it is incompatible with EABI. The
   comment about the availability of Linaro toolchains is updated to
   inform users selecting EABI that they should select EABIhf if they
   want to see Linaro toolchains.

 * The Sourcery CodeBench toolchains now depend on BR2_ARM_EABI,
   because that's the ABI they use. A comment is added to inform users
   that have selected EABIhf that Sourcery CodeBench are only
   available when EABI is used.

 * The Arago toolchains now depend on BR2_ARM_EABI, because that's the
   ABI they use. The description of the ARMv7 Arago toolchain is also
   slightly improved.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/toolchain-external/Config.in | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 130b705..324401f 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -8,6 +8,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_06
 	depends on BR2_arm
 	depends on BR2_GCC_TARGET_ARCH = "armv7-a"
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABIHF
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -27,6 +28,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_05
 	depends on BR2_arm
 	depends on BR2_GCC_TARGET_ARCH = "armv7-a"
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABIHF
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -46,6 +48,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_04
 	depends on BR2_arm
 	depends on BR2_GCC_TARGET_ARCH = "armv7-a"
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABIHF
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -60,14 +63,16 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_04
 
 	  To use this toolchain, you must disable soft float usage.
 
-comment "Linaro toolchains available for Cortex-A{5,8,9,15}"
+comment "Linaro toolchains available for Cortex-A{5,7,8,9,15} and the EABIhf ABI"
 	depends on BR2_arm
 	depends on BR2_GCC_TARGET_ARCH != "armv7-a"
+	depends on !BR2_ARM_EABIHF
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201305
 	bool "Sourcery CodeBench ARM 2013.05"
 	depends on BR2_arm
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABI
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -92,6 +97,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201203
 	bool "Sourcery CodeBench ARM 2012.03"
 	depends on BR2_arm
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABI
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -116,6 +122,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201109
 	bool "Sourcery CodeBench ARM 2011.09"
 	depends on BR2_arm
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABI
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -136,11 +143,17 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201109
 	      Select BR2_SOFT_FLOAT
 	      Set BR2_TARGET_OPTIMIZATION to -mthumb
 
+comment "Sourcery CodeBench toolchains available for the EABI ABI"
+	depends on BR2_arm
+	depends on !BR2_ARM_EABI
+
 config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV7A_201109
 	bool "Arago ARMv7 2011.09"
 	depends on BR2_arm
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
 	depends on BR2_GCC_TARGET_ARCH = "armv7-a"
+	depends on BR2_ARM_EABI
+	depends on BR2_ARM_CPU_HAS_VFPV3 || BR2_ARM_CPU_MAYBE_HAS_VFPV3
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -149,9 +162,11 @@ config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV7A_201109
 	  Texas Instruments Arago 2011.09 toolchain, with gcc 4.5.3,
 	  binutils 2.20.1, glibc 2.12, gdb 7.2.
 
-	  This toolchain uses -mfloat-abi=softfp (i.e use FPU
-	  instructions, but pass floating point function arguments in
-	  non-floating point registers).
+	  This toolchain uses -mfloat-abi=softfp (i.e can use FPU
+	  instructions, but passes floating point function arguments
+	  in integer registers), and requires a VFPv3 floating point
+	  unit to work properly. This unit is available on most
+	  Cortex-A ARM processors, but not all.
 
 config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109
 	bool "Arago ARMv5 2011.09"
@@ -160,6 +175,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109
 	depends on BR2_GCC_TARGET_ARCH != "armv4t" && \
 		BR2_GCC_TARGET_ARCH != "armv4" && \
 		BR2_GCC_TARGET_ARCH != "armv5t"
+	depends on BR2_ARM_EABI
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 10/14] gcc: create symbolic link to ld-linux in EABIhf/gcc 4.7/eglibc
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (8 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 09/14] toolchain-external: update config options after EABIhf introduction Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:23   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 11/14] arch/arm: add support for Thumb2 Thomas Petazzoni
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

When using eglibc, the ld-linux loader is installed as
ld-linux-armhf.so.3, but gcc 4.7.x was not yet updated, and generates
binaries that reference ld-linux.so.3. This was fixed starting with
gcc 4.8.x. In order to be able to use gcc 4.7, we create the
appropriate symbolic link.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/gcc-final/gcc-final.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index 0db2eaa..b89b2b7 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -90,6 +90,18 @@ endef
 
 HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_CREATE_SIMPLE_SYMLINKS
 
+# In gcc 4.7.x, the ARM EABIhf library loader path for eglibc was not
+# correct, so we create a symbolic link to make things work
+# properly. eglibc installs the library loader as ld-linux-armhf.so.3,
+# but gcc creates binaries that reference ld-linux.so.3.
+ifeq ($(BR2_arm)$(BR2_ARM_EABIHF)$(BR2_GCC_VERSION_4_7_X)$(BR2_TOOLCHAIN_BUILDROOT_EGLIBC),yyyy)
+define HOST_GCC_FINAL_LD_LINUX_LINK
+	ln -sf ld-linux-armhf.so.3 $(TARGET_DIR)/lib/ld-linux.so.3
+	ln -sf ld-linux-armhf.so.3 $(STAGING_DIR)/lib/ld-linux.so.3
+endef
+HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_LD_LINUX_LINK
+endif
+
 # Cannot use the HOST_GCC_FINAL_USR_LIBS mechanism below, because we want
 # libgcc_s to be installed in /lib and not /usr/lib. We add +x on
 # libgcc_s to ensure it will be stripped.
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 11/14] arch/arm: add support for Thumb2
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (9 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 10/14] gcc: create symbolic link to ld-linux in EABIhf/gcc 4.7/eglibc Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:29   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 12/14] uclibc: use numbered patches for 0.9.33.2 Thomas Petazzoni
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

Until now, we were using the default ARM instruction set, as used by
the toolchain: the 32 bits ARM instruction set for the internal
backend, and for external toolchain, whatever default was chosen when
the toolchain was generated.

This commit adds support for the Thumb2 instruction set. To do so, it:

 * provides a menuconfig choice between ARM and Thumb2. The choice is
   only shown when Thumb2 is supported, i.e on ARMv7-A CPUs.

 * passes the --with-mode={arm,thumb} option when building gcc in the
   internal backend. This tells the compiler which type of
   instructions it should generate.

 * passes the m{arm,thumb} option in the external toolchain
   wrapper. ARM and Thumb2 code can freely be mixed together, so the
   fact that the C library has been built either ARM or Thumb2 and
   that the rest of the code is built Thumb2 or ARM is not a problem.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/Config.in                                     |  6 ++++
 arch/Config.in.arm                                 | 36 ++++++++++++++++++++++
 package/gcc/gcc.mk                                 |  5 +++
 toolchain/toolchain-external/ext-tool.mk           |  5 +++
 .../toolchain-external/ext-toolchain-wrapper.c     |  3 ++
 5 files changed, 55 insertions(+)

diff --git a/arch/Config.in b/arch/Config.in
index c2dc9e8..c2147a4 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -207,6 +207,12 @@ config BR2_GCC_TARGET_FPU
 config BR2_GCC_TARGET_FLOAT_ABI
 	string
 
+# The value of this option will be passed as --with-mode=<value> when
+# building gcc (internal backend) or -m<value> in the toolchain
+# wrapper (external toolchain)
+config BR2_GCC_TARGET_MODE
+	string
+
 # Set up target binary format
 choice
 	prompt "Target Binary Format"
diff --git a/arch/Config.in.arm b/arch/Config.in.arm
index 2b493c0..94c32c9 100644
--- a/arch/Config.in.arm
+++ b/arch/Config.in.arm
@@ -31,6 +31,9 @@ config BR2_ARM_CPU_HAS_VFPV4
 	bool
 	select BR2_ARM_CPU_HAS_VFPV3
 
+config BR2_ARM_CPU_HAS_THUMB2
+	bool
+
 choice
 	prompt "Target Architecture Variant"
 	depends on BR2_arm || BR2_armeb
@@ -65,22 +68,27 @@ config BR2_cortex_a5
 	bool "cortex-A5"
 	select BR2_ARM_CPU_MAYBE_HAS_NEON
 	select BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	select BR2_ARM_CPU_HAS_THUMB2
 config BR2_cortex_a7
 	bool "cortex-A7"
 	select BR2_ARM_CPU_HAS_NEON
 	select BR2_ARM_CPU_HAS_VFPV4
+	select BR2_ARM_CPU_HAS_THUMB2
 config BR2_cortex_a8
 	bool "cortex-A8"
 	select BR2_ARM_CPU_HAS_NEON
 	select BR2_ARM_CPU_HAS_VFPV3
+	select BR2_ARM_CPU_HAS_THUMB2
 config BR2_cortex_a9
 	bool "cortex-A9"
 	select BR2_ARM_CPU_MAYBE_HAS_NEON
 	select BR2_ARM_CPU_MAYBE_HAS_VFPV3
+	select BR2_ARM_CPU_HAS_THUMB2
 config BR2_cortex_a15
 	bool "cortex-A15"
 	select BR2_ARM_CPU_HAS_NEON
 	select BR2_ARM_CPU_HAS_VFPV4
+	select BR2_ARM_CPU_HAS_THUMB2
 config BR2_fa526
 	bool "fa526/626"
 config BR2_pj4
@@ -275,6 +283,30 @@ config BR2_ARM_FPU_NEON_VFPV4
 
 endchoice
 
+choice
+	prompt "ARM instruction set"
+	depends on BR2_ARM_CPU_HAS_THUMB2
+
+config BR2_ARM_INSTRUCTIONS_ARM_CHOICE
+	bool "ARM"
+	help
+	  This option instructs the compiler to generate regular ARM
+	  instructions, that are all 32 bits wide.
+
+config BR2_ARM_INSTRUCTIONS_THUMB2
+	bool "Thumb2"
+	help
+	  This option instructions the compiler to generate Thumb2
+	  instructions, which allows to mix 16 bits instructions and
+	  32 bits instructions. This generally provides a much smaller
+	  compiled binary size.
+
+endchoice
+
+config BR2_ARM_INSTRUCTIONS_ARM
+	def_bool y
+	depends on !BR2_ARM_INSTRUCTIONS_THUMB2
+
 config BR2_ARCH
 	default "arm"	if BR2_arm
 	default "armeb"	if BR2_armeb
@@ -344,3 +376,7 @@ config BR2_GCC_TARGET_FLOAT_ABI
 	default "soft"		if BR2_ARM_SOFT_FLOAT
 	default "softfp"	if !BR2_ARM_SOFT_FLOAT && BR2_ARM_EABI
 	default "hard"		if !BR2_ARM_SOFT_FLOAT && BR2_ARM_EABIHF
+
+config BR2_GCC_TARGET_MODE
+	default "arm"		if BR2_ARM_INSTRUCTIONS_ARM
+	default "thumb"		if BR2_ARM_INSTRUCTIONS_THUMB2
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index bfc41a4..d620980 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -177,6 +177,11 @@ ifneq ($(GCC_TARGET_FLOAT_ABI),)
 HOST_GCC_COMMON_CONF_OPT += --with-float=$(GCC_TARGET_FLOAT_ABI)
 endif
 
+GCC_TARGET_MODE = $(call qstrip,$(BR2_GCC_TARGET_MODE))
+ifneq ($(GCC_TARGET_MODE),y)
+HOST_GCC_COMMON_CONF_OPT += --with-mode=$(GCC_TARGET_MODE)
+endif
+
 # Branding works on >= 4.3
 ifneq ($(findstring x4.2.,x$(GCC_VERSION)),x4.2.)
 HOST_GCC_COMMON_CONF_OPT += \
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 67fc40d..b9ae68f 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -147,6 +147,7 @@ CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
 CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
 CC_TARGET_FPU_:=$(call qstrip,$(BR2_GCC_TARGET_FPU))
 CC_TARGET_FLOAT_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
+CC_TARGET_MODE_:=$(call qstrip,$(BR2_GCC_TARGET_MODE))
 
 # march/mtune/floating point mode needs to be passed to the external toolchain
 # to select the right multilib variant
@@ -178,6 +179,10 @@ ifneq ($(CC_TARGET_FLOAT_ABI_),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -mfloat-abi=$(CC_TARGET_FLOAT_ABI_)
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_FLOAT_ABI='"$(CC_TARGET_FLOAT_ABI_)"'
 endif
+ifneq ($(CC_TARGET_MODE_),)
+TOOLCHAIN_EXTERNAL_CFLAGS += -m$(CC_TARGET_MODE_)
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_MODE='"$(CC_TARGET_MODE_)"'
+endif
 ifeq ($(BR2_BINFMT_FLAT),y)
 TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
index afca6fa..460f255 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -47,6 +47,9 @@ static char *predef_args[] = {
 #ifdef BR_SOFTFLOAT
 	"-msoft-float",
 #endif /* BR_SOFTFLOAT */
+#ifdef BR_MODE
+	"-m" BR_MODE,
+#endif
 #ifdef BR_64
 	"-m64",
 #endif
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 12/14] uclibc: use numbered patches for 0.9.33.2
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (10 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 11/14] arch/arm: add support for Thumb2 Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:31   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 13/14] uclibc: add Thumb2 fixes Thomas Petazzoni
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 14/14] arch: use tabs instead of spaces in Config.in files Thomas Petazzoni
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

In preparation to the addition of more patches that require a correct
ordering, rename uClibc 0.9.33.2 patches.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...bc-0001-bits-time.h-sync-with-glibc-2.16.patch} |  9 +++++----
 ...on-of-MSG_WAITFORONE-and-MSG_CMSG_CLOEXE.patch} | 23 ++++++++++++++++------
 ...p3.patch => uclibc-0003-Add-dup3-syscall.patch} | 22 ++++++++++-----------
 ...eps-add-__kernel_long-and-__kernel_ulong.patch} |  7 ++++---
 ...uclibc-0005-Patch-from-OpenWRT-for-avr32.patch} | 14 ++++++++++++-
 5 files changed, 49 insertions(+), 26 deletions(-)
 rename package/uclibc/0.9.33.2/{uclibc-bits-time.h-sync-with-glibc-2.16.patch => uclibc-0001-bits-time.h-sync-with-glibc-2.16.patch} (82%)
 rename package/uclibc/0.9.33.2/{uclibc-define-MSG_CMSG_CLOEXEC.patch => uclibc-0002-Add-definition-of-MSG_WAITFORONE-and-MSG_CMSG_CLOEXE.patch} (54%)
 rename package/uclibc/0.9.33.2/{uclibc-dup3.patch => uclibc-0003-Add-dup3-syscall.patch} (73%)
 rename package/uclibc/0.9.33.2/{uclibc-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch => uclibc-0004-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch} (98%)
 rename package/uclibc/0.9.33.2/{uclibc-OpenWRT-140-avr32_atomic_fix.patch => uclibc-0005-Patch-from-OpenWRT-for-avr32.patch} (50%)

diff --git a/package/uclibc/0.9.33.2/uclibc-bits-time.h-sync-with-glibc-2.16.patch b/package/uclibc/0.9.33.2/uclibc-0001-bits-time.h-sync-with-glibc-2.16.patch
similarity index 82%
rename from package/uclibc/0.9.33.2/uclibc-bits-time.h-sync-with-glibc-2.16.patch
rename to package/uclibc/0.9.33.2/uclibc-0001-bits-time.h-sync-with-glibc-2.16.patch
index 2ad0032..d93df6d 100644
--- a/package/uclibc/0.9.33.2/uclibc-bits-time.h-sync-with-glibc-2.16.patch
+++ b/package/uclibc/0.9.33.2/uclibc-0001-bits-time.h-sync-with-glibc-2.16.patch
@@ -1,7 +1,7 @@
-From 3d1b82c7d9dce11c733fe23a85df7f975c7e2486 Mon Sep 17 00:00:00 2001
+From bb08cd16cb0353b3d4116ca8959dbecd2e78f545 Mon Sep 17 00:00:00 2001
 From: Peter Korsgaard <jacmet@sunsite.dk>
 Date: Tue, 3 Jul 2012 15:54:57 +0200
-Subject: [PATCH] bits/time.h: sync with glibc 2.16
+Subject: [PATCH 1/8] bits/time.h: sync with glibc 2.16
 
 CLOCK_MONOTONIC_RAW is available since 2.6.28
 (2d42244ae71d: clocksource: introduce CLOCK_MONOTONIC_RAW), and
@@ -10,8 +10,9 @@ CLOCK_REALTIME_COARSE).
 
 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 ---
- libc/sysdeps/linux/common/bits/time.h |    6 ++++++
+ libc/sysdeps/linux/common/bits/time.h | 6 ++++++
  1 file changed, 6 insertions(+)
 
 diff --git a/libc/sysdeps/linux/common/bits/time.h b/libc/sysdeps/linux/common/bits/time.h
@@ -32,5 +33,5 @@ index 7ed54bf..c871223 100644
  /* Flag to indicate time is absolute.  */
  #   define TIMER_ABSTIME		1
 -- 
-1.7.10.4
+1.8.1.2
 
diff --git a/package/uclibc/0.9.33.2/uclibc-define-MSG_CMSG_CLOEXEC.patch b/package/uclibc/0.9.33.2/uclibc-0002-Add-definition-of-MSG_WAITFORONE-and-MSG_CMSG_CLOEXE.patch
similarity index 54%
rename from package/uclibc/0.9.33.2/uclibc-define-MSG_CMSG_CLOEXEC.patch
rename to package/uclibc/0.9.33.2/uclibc-0002-Add-definition-of-MSG_WAITFORONE-and-MSG_CMSG_CLOEXE.patch
index c699b6b..9353e5b 100644
--- a/package/uclibc/0.9.33.2/uclibc-define-MSG_CMSG_CLOEXEC.patch
+++ b/package/uclibc/0.9.33.2/uclibc-0002-Add-definition-of-MSG_WAITFORONE-and-MSG_CMSG_CLOEXE.patch
@@ -1,15 +1,23 @@
-Add definition of MSG_WAITFORONE and MSG_CMSG_CLOEXEC
+From e95694dfd24779acaab0bb1500f182e46f8a518d Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 13 Jul 2013 17:13:55 +0200
+Subject: [PATCH 2/8] Add definition of MSG_WAITFORONE and MSG_CMSG_CLOEXEC
 
 From yocto:
 http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-core/uclibc/uclibc-0.9.33/define-MSG_CMSG_CLOEXEC.patch
 
 Upstream-Status: Pending
 
-Index: git/libc/sysdeps/linux/common/bits/socket.h
-===================================================================
---- git.orig/libc/sysdeps/linux/common/bits/socket.h	2012-01-26 23:23:21.537456132 -0800
-+++ git/libc/sysdeps/linux/common/bits/socket.h	2012-01-26 23:25:10.125461388 -0800
-@@ -235,8 +235,15 @@
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libc/sysdeps/linux/common/bits/socket.h | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h
+index 7e12733..338fd92 100644
+--- a/libc/sysdeps/linux/common/bits/socket.h
++++ b/libc/sysdeps/linux/common/bits/socket.h
+@@ -235,8 +235,15 @@ enum
  #define	MSG_ERRQUEUE	MSG_ERRQUEUE
      MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
  #define	MSG_NOSIGNAL	MSG_NOSIGNAL
@@ -26,3 +34,6 @@ Index: git/libc/sysdeps/linux/common/bits/socket.h
    };
  
  
+-- 
+1.8.1.2
+
diff --git a/package/uclibc/0.9.33.2/uclibc-dup3.patch b/package/uclibc/0.9.33.2/uclibc-0003-Add-dup3-syscall.patch
similarity index 73%
rename from package/uclibc/0.9.33.2/uclibc-dup3.patch
rename to package/uclibc/0.9.33.2/uclibc-0003-Add-dup3-syscall.patch
index 87fe2a6..663b0e1 100644
--- a/package/uclibc/0.9.33.2/uclibc-dup3.patch
+++ b/package/uclibc/0.9.33.2/uclibc-0003-Add-dup3-syscall.patch
@@ -1,16 +1,18 @@
+From 518bc50ae42540574bba360225c8a65b56b79148 Mon Sep 17 00:00:00 2001
 From: Jonas Bonn <jonas@southpole.se>
-Subject: [RFC PATCH 16/38] Add dup3 syscall
-Date: Tue,  6 Sep 2011 10:30:40 +0200
+Date: Tue, 6 Sep 2011 10:30:40 +0200
+Subject: [PATCH 3/8] Add dup3 syscall
 
 Signed-off-by: Jonas Bonn <jonas@southpole.se>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 ---
- include/unistd.h                 |    4 ++++
- libc/sysdeps/linux/common/dup3.c |   15 +++++++++++++++
- 2 files changed, 19 insertions(+), 0 deletions(-)
+ include/unistd.h                 |  4 ++++
+ libc/sysdeps/linux/common/dup3.c | 17 +++++++++++++++++
+ 2 files changed, 21 insertions(+)
  create mode 100644 libc/sysdeps/linux/common/dup3.c
 
 diff --git a/include/unistd.h b/include/unistd.h
-index 9568790..7c2fa4a 100644
+index 1b2fd4d..f7d070b 100644
 --- a/include/unistd.h
 +++ b/include/unistd.h
 @@ -513,6 +513,10 @@ extern int dup (int __fd) __THROW __wur;
@@ -26,7 +28,7 @@ index 9568790..7c2fa4a 100644
  #ifdef __USE_GNU
 diff --git a/libc/sysdeps/linux/common/dup3.c b/libc/sysdeps/linux/common/dup3.c
 new file mode 100644
-index 0000000..5fdab2e
+index 0000000..7b57438
 --- /dev/null
 +++ b/libc/sysdeps/linux/common/dup3.c
 @@ -0,0 +1,17 @@
@@ -48,9 +50,5 @@ index 0000000..5fdab2e
 +libc_hidden_def(dup3)
 +#endif
 -- 
-1.7.5.4
+1.8.1.2
 
-_______________________________________________
-uClibc mailing list
-uClibc at uclibc.org
-http://lists.busybox.net/mailman/listinfo/uclibc
diff --git a/package/uclibc/0.9.33.2/uclibc-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch b/package/uclibc/0.9.33.2/uclibc-0004-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch
similarity index 98%
rename from package/uclibc/0.9.33.2/uclibc-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch
rename to package/uclibc/0.9.33.2/uclibc-0004-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch
index 4ba60e9..0381ba8 100644
--- a/package/uclibc/0.9.33.2/uclibc-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch
+++ b/package/uclibc/0.9.33.2/uclibc-0004-libc-sysdeps-add-__kernel_long-and-__kernel_ulong.patch
@@ -1,7 +1,7 @@
-From 6a76edddaa62ff06f178143b582167734cb55c18 Mon Sep 17 00:00:00 2001
+From 7fef6b983456e4c529a5239ea90715050e6f4452 Mon Sep 17 00:00:00 2001
 From: Chris Packham <chris.packham@alliedtelesis.co.nz>
 Date: Mon, 1 Oct 2012 18:12:54 +1300
-Subject: [PATCH] libc/sysdeps: add __kernel_long and __kernel_ulong
+Subject: [PATCH 4/8] libc/sysdeps: add __kernel_long and __kernel_ulong
 
 Linux 3.4 added __kernel_long_t and __kernel_ulong_t and various
 exported header files were updated to use these new types. Add the
@@ -50,6 +50,7 @@ I can break this up per arch or per maintainer if requested.
  22 files changed, 50 insertions(+)
 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 ---
  libc/sysdeps/linux/alpha/bits/kernel_types.h      | 2 ++
  libc/sysdeps/linux/arm/bits/kernel_types.h        | 2 ++
@@ -388,5 +389,5 @@ index 44f1075..ed38f2e 100644
  
  /* Beginning in 2.6 kernels, which is the first version that includes the
 -- 
-1.8.1.5
+1.8.1.2
 
diff --git a/package/uclibc/0.9.33.2/uclibc-OpenWRT-140-avr32_atomic_fix.patch b/package/uclibc/0.9.33.2/uclibc-0005-Patch-from-OpenWRT-for-avr32.patch
similarity index 50%
rename from package/uclibc/0.9.33.2/uclibc-OpenWRT-140-avr32_atomic_fix.patch
rename to package/uclibc/0.9.33.2/uclibc-0005-Patch-from-OpenWRT-for-avr32.patch
index e28b6d2..9b6be2b 100644
--- a/package/uclibc/0.9.33.2/uclibc-OpenWRT-140-avr32_atomic_fix.patch
+++ b/package/uclibc/0.9.33.2/uclibc-0005-Patch-from-OpenWRT-for-avr32.patch
@@ -1,9 +1,18 @@
-Patch from OpenWRT for avr32.
+From b0bbb35065e1c8fdd308573f38eed35c30760d87 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 13 Jul 2013 17:14:49 +0200
+Subject: [PATCH 5/8] Patch from OpenWRT for avr32.
 
 https://dev.openwrt.org/browser/trunk/toolchain/uClibc/patches-0.9.32/140-avr32_atomic_fix.patch
 
 Signed-off-by: Simon Dawson <spdawson@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libc/sysdeps/linux/avr32/bits/atomic.h | 1 +
+ 1 file changed, 1 insertion(+)
 
+diff --git a/libc/sysdeps/linux/avr32/bits/atomic.h b/libc/sysdeps/linux/avr32/bits/atomic.h
+index e6be41f..3bc2aee 100644
 --- a/libc/sysdeps/linux/avr32/bits/atomic.h
 +++ b/libc/sysdeps/linux/avr32/bits/atomic.h
 @@ -28,6 +28,7 @@ typedef uintmax_t uatomic_max_t;
@@ -14,3 +23,6 @@ Signed-off-by: Simon Dawson <spdawson@gmail.com>
  		__typeof__(*(mem)) __prev;				\
  		__asm__ __volatile__(					\
  			"/* __arch_compare_and_exchange_val_32_acq */\n" \
+-- 
+1.8.1.2
+
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 13/14] uclibc: add Thumb2 fixes
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (11 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 12/14] uclibc: use numbered patches for 0.9.33.2 Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:32   ` Peter Korsgaard
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 14/14] arch: use tabs instead of spaces in Config.in files Thomas Petazzoni
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

This commit adds three patches to uClibc that are needed to make
Thumb2 support work properly:

 uclibc-0006-arm-clone-restore-stack-pointer-just-after-return-fr.patch
 uclibc-0007-arm-clone.S-Add-missing-IT-instruction-for-Thumb2.patch
 uclibc-0008-arm-move-check-for-BX-to-its-own-header.patch

The first one is a necessary dependency of the second one. Both of
those patches have already been merged upstream, after 0.9.33.2. The
third one hasn't been merged upstream yet, but it has already been
submitted a while ago by Yann E. Morin, without receiving attention
from upstream.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...estore-stack-pointer-just-after-return-fr.patch |  42 ++++
 ...e.S-Add-missing-IT-instruction-for-Thumb2.patch |  29 +++
 ...8-arm-move-check-for-BX-to-its-own-header.patch | 257 +++++++++++++++++++++
 3 files changed, 328 insertions(+)
 create mode 100644 package/uclibc/0.9.33.2/uclibc-0006-arm-clone-restore-stack-pointer-just-after-return-fr.patch
 create mode 100644 package/uclibc/0.9.33.2/uclibc-0007-arm-clone.S-Add-missing-IT-instruction-for-Thumb2.patch
 create mode 100644 package/uclibc/0.9.33.2/uclibc-0008-arm-move-check-for-BX-to-its-own-header.patch

diff --git a/package/uclibc/0.9.33.2/uclibc-0006-arm-clone-restore-stack-pointer-just-after-return-fr.patch b/package/uclibc/0.9.33.2/uclibc-0006-arm-clone-restore-stack-pointer-just-after-return-fr.patch
new file mode 100644
index 0000000..de97850
--- /dev/null
+++ b/package/uclibc/0.9.33.2/uclibc-0006-arm-clone-restore-stack-pointer-just-after-return-fr.patch
@@ -0,0 +1,42 @@
+From 963671276c0ef14458e0a7990107bcd2c075f3cd Mon Sep 17 00:00:00 2001
+From: Filippo Arcidiacono <filippo.arcidiacono@st.com>
+Date: Mon, 10 Dec 2012 09:50:52 +0100
+Subject: [PATCH 6/8] arm: clone: restore stack pointer just after return from
+ syscall
+
+If the syscall returns with an error the stack pointer and r4 register
+are not restored because the instruction 'ldmnefd sp!, {r4}' is executed
+after branching to '__error' label.
+This bug has been spotted out by running './utstest clone 5' from LTP
+built with -fstack-protector-all compiler flag as log below:
+
+root at cortex-a9:/usr/tests/ltp/testcases/bin# ./utstest clone 5
+stack smashing detected: ./utstest terminated()
+
+Regression introduced by commit e58798e107d652644629a1daaa95d76430808d53
+
+Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
+Signed-off-by: Giuseppe Di Giore <giuseppe.di-giore@st.com>
+Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libc/sysdeps/linux/arm/clone.S | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
+index fdc05b8..e4101ba 100644
+--- a/libc/sysdeps/linux/arm/clone.S
++++ b/libc/sysdeps/linux/arm/clone.S
+@@ -111,8 +111,8 @@ __clone:
+ 	ldr	r4, [sp, #12]
+ 	DO_CALL (clone)
+ 	movs	a1, a1
+-	blt	__error
+ 	ldmnefd	sp!, {r4}
++	blt	__error
+ 	IT(t, ne)
+ #if defined(__USE_BX__)
+ 	bxne	lr
+-- 
+1.8.1.2
+
diff --git a/package/uclibc/0.9.33.2/uclibc-0007-arm-clone.S-Add-missing-IT-instruction-for-Thumb2.patch b/package/uclibc/0.9.33.2/uclibc-0007-arm-clone.S-Add-missing-IT-instruction-for-Thumb2.patch
new file mode 100644
index 0000000..f4097e9
--- /dev/null
+++ b/package/uclibc/0.9.33.2/uclibc-0007-arm-clone.S-Add-missing-IT-instruction-for-Thumb2.patch
@@ -0,0 +1,29 @@
+From c12211a2f1832169e31063512b3e2081e503e856 Mon Sep 17 00:00:00 2001
+From: Will Newton <will.newton@linaro.org>
+Date: Tue, 2 Apr 2013 13:53:35 +0100
+Subject: [PATCH 7/8] arm/clone.S: Add missing IT instruction for Thumb2.
+
+The conditional load needs to be made part of an IT block on Thumb2
+cores.
+
+Signed-off-by: Will Newton <will.newton@linaro.org>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libc/sysdeps/linux/arm/clone.S | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
+index e4101ba..1f7f09d 100644
+--- a/libc/sysdeps/linux/arm/clone.S
++++ b/libc/sysdeps/linux/arm/clone.S
+@@ -111,6 +111,7 @@ __clone:
+ 	ldr	r4, [sp, #12]
+ 	DO_CALL (clone)
+ 	movs	a1, a1
++	IT(t, ne)
+ 	ldmnefd	sp!, {r4}
+ 	blt	__error
+ 	IT(t, ne)
+-- 
+1.8.1.2
+
diff --git a/package/uclibc/0.9.33.2/uclibc-0008-arm-move-check-for-BX-to-its-own-header.patch b/package/uclibc/0.9.33.2/uclibc-0008-arm-move-check-for-BX-to-its-own-header.patch
new file mode 100644
index 0000000..c3031b4
--- /dev/null
+++ b/package/uclibc/0.9.33.2/uclibc-0008-arm-move-check-for-BX-to-its-own-header.patch
@@ -0,0 +1,257 @@
+From 06827e81c976d16aa5861a40ac0d780b63a4d470 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Thu, 11 Apr 2013 23:02:03 +0200
+Subject: [PATCH 8/8] arm: move check for BX to its own header
+
+As Will noticed, the header this check is currently done in
+is asm-only, and is not meant to be included from C code.
+This breaks compilation when compiled for a Thumb2-aware CPU.
+
+Move the BX check to its own header, and revert 7a246fd.
+
+Reported-by: Will Newton <will.newton@gmail.com>
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Cc: Will Newton <will.newton@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ ldso/ldso/arm/dl-startup.h            |  2 +-
+ ldso/ldso/arm/resolve.S               |  1 +
+ libc/string/arm/_memcpy.S             |  1 +
+ libc/string/arm/memcmp.S              |  1 +
+ libc/string/arm/memset.S              |  1 +
+ libc/string/arm/strcmp.S              |  1 +
+ libc/string/arm/strlen.S              |  1 +
+ libc/sysdeps/linux/arm/__longjmp.S    |  2 +-
+ libc/sysdeps/linux/arm/bits/arm_asm.h |  8 --------
+ libc/sysdeps/linux/arm/bits/arm_bx.h  | 34 ++++++++++++++++++++++++++++++++++
+ libc/sysdeps/linux/arm/clone.S        |  1 +
+ libc/sysdeps/linux/arm/mmap64.S       |  1 +
+ libc/sysdeps/linux/arm/syscall-eabi.S |  1 +
+ libc/sysdeps/linux/arm/sysdep.h       |  2 +-
+ libc/sysdeps/linux/arm/vfork.S        |  1 +
+ 15 files changed, 47 insertions(+), 11 deletions(-)
+ create mode 100644 libc/sysdeps/linux/arm/bits/arm_bx.h
+
+diff --git a/ldso/ldso/arm/dl-startup.h b/ldso/ldso/arm/dl-startup.h
+index f7d6052..8d6122b 100644
+--- a/ldso/ldso/arm/dl-startup.h
++++ b/ldso/ldso/arm/dl-startup.h
+@@ -7,7 +7,7 @@
+  */
+ 
+ #include <features.h>
+-#include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ #if !defined(__thumb__)
+ __asm__(
+diff --git a/ldso/ldso/arm/resolve.S b/ldso/ldso/arm/resolve.S
+index 08889d0..600d3af 100644
+--- a/ldso/ldso/arm/resolve.S
++++ b/ldso/ldso/arm/resolve.S
+@@ -92,6 +92,7 @@
+ 
+ #include <sys/syscall.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ #include <features.h>
+ 
+diff --git a/libc/string/arm/_memcpy.S b/libc/string/arm/_memcpy.S
+index b26080d..c59f5b8 100644
+--- a/libc/string/arm/_memcpy.S
++++ b/libc/string/arm/_memcpy.S
+@@ -40,6 +40,7 @@
+ #include <features.h>
+ #include <endian.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ #if !defined(THUMB1_ONLY)
+ /*
+diff --git a/libc/string/arm/memcmp.S b/libc/string/arm/memcmp.S
+index 65409f4..9f78415 100644
+--- a/libc/string/arm/memcmp.S
++++ b/libc/string/arm/memcmp.S
+@@ -31,6 +31,7 @@
+ 
+ #include <features.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ .text
+ .global memcmp
+diff --git a/libc/string/arm/memset.S b/libc/string/arm/memset.S
+index 66aa603..6f78128 100644
+--- a/libc/string/arm/memset.S
++++ b/libc/string/arm/memset.S
+@@ -20,6 +20,7 @@
+ #include <features.h>
+ #include <sys/syscall.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ .text
+ .global memset
+diff --git a/libc/string/arm/strcmp.S b/libc/string/arm/strcmp.S
+index 97363c1..8b77ab0 100644
+--- a/libc/string/arm/strcmp.S
++++ b/libc/string/arm/strcmp.S
+@@ -31,6 +31,7 @@
+ 
+ #include <features.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ .text
+ .global strcmp
+diff --git a/libc/string/arm/strlen.S b/libc/string/arm/strlen.S
+index 949e918..141f849 100644
+--- a/libc/string/arm/strlen.S
++++ b/libc/string/arm/strlen.S
+@@ -21,6 +21,7 @@
+ #include <endian.h>
+ #include <sys/syscall.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ /* size_t strlen(const char *S)
+  * entry: r0 -> string
+diff --git a/libc/sysdeps/linux/arm/__longjmp.S b/libc/sysdeps/linux/arm/__longjmp.S
+index 5faf4ec..7418dc2 100644
+--- a/libc/sysdeps/linux/arm/__longjmp.S
++++ b/libc/sysdeps/linux/arm/__longjmp.S
+@@ -19,11 +19,11 @@
+ 
+ #include <features.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ #define _SETJMP_H
+ #define _ASM
+ #include <bits/setjmp.h>
+ 
+-
+ .global __longjmp
+ .type __longjmp,%function
+ .align 2
+diff --git a/libc/sysdeps/linux/arm/bits/arm_asm.h b/libc/sysdeps/linux/arm/bits/arm_asm.h
+index 921c9a3..ff8ea92 100644
+--- a/libc/sysdeps/linux/arm/bits/arm_asm.h
++++ b/libc/sysdeps/linux/arm/bits/arm_asm.h
+@@ -24,12 +24,4 @@
+ #define THUMB1_ONLY 1
+ #endif
+ 
+-#if defined(__USE_BX__)
+-# if (   defined (__ARM_ARCH_2__)  || defined (__ARM_ARCH_3__) \
+-      || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \
+-     )
+-#  error Use of BX was requested, but is not available on the target processor.
+-# endif /* ARCH level */
+-#endif /* __USE_BX__ */
+-
+ #endif /* _ARM_ASM_H */
+diff --git a/libc/sysdeps/linux/arm/bits/arm_bx.h b/libc/sysdeps/linux/arm/bits/arm_bx.h
+new file mode 100644
+index 0000000..321490e
+--- /dev/null
++++ b/libc/sysdeps/linux/arm/bits/arm_bx.h
+@@ -0,0 +1,34 @@
++/* Copyright (C) 2013 Yann E. MORIN <yann.morin.1998@free.fr>
++ *
++ * This file is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with the GNU C Library; if not, see
++ * <http://www.gnu.org/licenses/>.
++ */
++
++#ifndef _ARM_BX_H
++#define _ARM_BX_H
++
++/* We need features.h first */
++#if !defined _FEATURES_H
++#error Please include features.h first
++#endif /* features.h not yet included */
++
++#if defined(__USE_BX__)
++# if (   defined (__ARM_ARCH_2__)  || defined (__ARM_ARCH_3__) \
++      || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \
++     )
++#  error Use of BX was requested, but is not available on the target processor.
++# endif /* ARCH level */
++#endif /* __USE_BX__ */
++
++#endif /* _ARM_BX_H */
+diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
+index 1f7f09d..4d646be 100644
+--- a/libc/sysdeps/linux/arm/clone.S
++++ b/libc/sysdeps/linux/arm/clone.S
+@@ -25,6 +25,7 @@
+ #include <bits/errno.h>
+ #include <sys/syscall.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ #if defined(__NR_clone)
+ /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+diff --git a/libc/sysdeps/linux/arm/mmap64.S b/libc/sysdeps/linux/arm/mmap64.S
+index 7071541..bd2cfb8 100644
+--- a/libc/sysdeps/linux/arm/mmap64.S
++++ b/libc/sysdeps/linux/arm/mmap64.S
+@@ -21,6 +21,7 @@
+ #include <bits/errno.h>
+ #include <sys/syscall.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ #if defined __UCLIBC_HAS_LFS__ && defined __NR_mmap2
+ 
+diff --git a/libc/sysdeps/linux/arm/syscall-eabi.S b/libc/sysdeps/linux/arm/syscall-eabi.S
+index b931882..019f701 100644
+--- a/libc/sysdeps/linux/arm/syscall-eabi.S
++++ b/libc/sysdeps/linux/arm/syscall-eabi.S
+@@ -18,6 +18,7 @@
+ 
+ #include <sys/syscall.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ /* In the EABI syscall interface, we don't need a special syscall to
+    implement syscall().  It won't work reliably with 64-bit arguments
+diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h
+index e498695..9c1dbca 100644
+--- a/libc/sysdeps/linux/arm/sysdep.h
++++ b/libc/sysdeps/linux/arm/sysdep.h
+@@ -21,7 +21,7 @@
+ #define _LINUX_ARM_SYSDEP_H 1
+ 
+ #include <common/sysdep.h>
+-#include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ #include <sys/syscall.h>
+ /* For Linux we can use the system call table in the header file
+diff --git a/libc/sysdeps/linux/arm/vfork.S b/libc/sysdeps/linux/arm/vfork.S
+index 17d6a4d..6c55d71 100644
+--- a/libc/sysdeps/linux/arm/vfork.S
++++ b/libc/sysdeps/linux/arm/vfork.S
+@@ -7,6 +7,7 @@
+ 
+ #include <features.h>
+ #include <bits/arm_asm.h>
++#include <bits/arm_bx.h>
+ 
+ #define _ERRNO_H
+ #include <bits/errno.h>
+-- 
+1.8.1.2
+
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 14/14] arch: use tabs instead of spaces in Config.in files
  2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
                   ` (12 preceding siblings ...)
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 13/14] uclibc: add Thumb2 fixes Thomas Petazzoni
@ 2013-07-16  8:03 ` Thomas Petazzoni
  2013-07-16 13:32   ` Peter Korsgaard
  13 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16  8:03 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/Config.in       | 2 +-
 arch/Config.in.avr32 | 4 ++--
 arch/Config.in.bfin  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/Config.in b/arch/Config.in
index c2147a4..0b5b218 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -1,5 +1,5 @@
 config BR2_ARCH_IS_64
-       bool
+	bool
 
 config BR2_SOFT_FLOAT
 	bool
diff --git a/arch/Config.in.avr32 b/arch/Config.in.avr32
index ebf8454..199c150 100644
--- a/arch/Config.in.avr32
+++ b/arch/Config.in.avr32
@@ -1,5 +1,5 @@
 config BR2_ARCH
-       default "avr32"
+	default "avr32"
 
 config BR2_ENDIAN
-       default "BIG"
+	default "BIG"
diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index f755c8d..415fc89 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -66,7 +66,7 @@ config BR2_ARCH
 	default "bfin"
 
 config BR2_ENDIAN
-        default "LITTLE"
+	default "LITTLE"
 
 config BR2_GCC_TARGET_CPU
 	default bf606		if BR2_bf606
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 01/14] arch: introduce BR2_GCC_TARGET_{FPU, FLOAT_ABI}
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 01/14] arch: introduce BR2_GCC_TARGET_{FPU, FLOAT_ABI} Thomas Petazzoni
@ 2013-07-16 11:48   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 11:48 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@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:
 Thomas> BR2_GCC_TARGET_{FPU,FLOAT_ABI}, that allows to define the
 Thomas> --with-{fpu,float} gcc configure options for the internal backend, or
 Thomas> the -m{fpu,float-abi} options for the flags of the external toolchain
 Thomas> wrapper.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options Thomas Petazzoni
@ 2013-07-16 11:53   ` Peter Korsgaard
  2013-07-16 12:12     ` Thomas Petazzoni
  2013-07-16 13:12   ` Peter Korsgaard
  1 sibling, 1 reply; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 11:53 UTC (permalink / raw)
  To: buildroot

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

 Thomas> As we are going to introduced a more advanced support of floating
 Thomas> point options for the ARM architecture, we need to adjust how the
 Thomas> soft-float option is handled. We replace the current hidden option
 Thomas> BR2_PREFER_SOFT_FLOAT option and the visible BR2_SOFT_FLOAT option by:

 Thomas>  * A global hidden BR2_SOFT_FLOAT option, defined in arch/Config.in,
 Thomas>    that tells whether the architecture-specific code is using software
 Thomas>    emulated floating point. This hidden option can be used throughout
 Thomas>    Buildroot to determine whether soft float is used or not.

 Thomas>  * Per-architecture visible BR2_<arch>_SOFT_FLOAT options, for the
 Thomas>    architecture for which it makes sense, which allows users to select
 Thomas>    soft float emulation when needed.

 Thomas> This change will allow each architecture to have a different way of
 Thomas> presenting its floating point capabilities.

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 Thomas> ---
 Thomas>  arch/Config.in                |  3 +++
 Thomas>  arch/Config.in.arm            | 10 ++++++++++
 Thomas>  arch/Config.in.mips           | 10 ++++++++++
 Thomas>  arch/Config.in.powerpc        |  9 +++++++++

What about arc/avr32/bfin/microblaze/sh/sparc/xtensa? Some of them
apparently were broken in this regard already, and some of them are not
supported by the internal toolchain, but with this change atleast
Buildroot will always think they use hardfloat.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options
  2013-07-16 11:53   ` Peter Korsgaard
@ 2013-07-16 12:12     ` Thomas Petazzoni
  2013-07-16 12:34       ` Peter Korsgaard
  0 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16 12:12 UTC (permalink / raw)
  To: buildroot

Dear Peter Korsgaard,

On Tue, 16 Jul 2013 13:53:46 +0200, Peter Korsgaard wrote:

>  Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>  Thomas> ---
>  Thomas>  arch/Config.in                |  3 +++
>  Thomas>  arch/Config.in.arm            | 10 ++++++++++
>  Thomas>  arch/Config.in.mips           | 10 ++++++++++
>  Thomas>  arch/Config.in.powerpc        |  9 +++++++++
> 
> What about arc/avr32/bfin/microblaze/sh/sparc/xtensa? Some of them
> apparently were broken in this regard already, and some of them are not
> supported by the internal toolchain, but with this change atleast
> Buildroot will always think they use hardfloat.

avr32 already selects BR2_SOFT_FLOAT in the current git master.

config BR2_avr32
        bool "AVR32"
        select BR2_SOFT_FLOAT

On the other platforms you mentioned, BR2_SOFT_FLOAT was always false:

config BR2_SOFT_FLOAT
        bool "Use software floating point by default"
        depends on BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel || BR2_powerpc

which explains why I didn't take care of any of them. I honestly have
no idea for those platforms which ones do soft-float, which ones do
hard-float. It already took me a while to get a minimal understanding
of how things work in the ARM world in terms of floating point
support :)

From the perspective of those architectures, the BR2_SOFT_FLOAT value
was always false, and continues to be false after my patches. If this
is not correct, it should certainly be fixed, but I don't think this is
something that gets broken by my patches: it would have already been
wrong, and the Buildroot code already believes those architectures are
all hard float.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options
  2013-07-16 12:12     ` Thomas Petazzoni
@ 2013-07-16 12:34       ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 12:34 UTC (permalink / raw)
  To: buildroot

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

 >> What about arc/avr32/bfin/microblaze/sh/sparc/xtensa? Some of them
 >> apparently were broken in this regard already, and some of them are not
 >> supported by the internal toolchain, but with this change atleast
 >> Buildroot will always think they use hardfloat.

 Thomas> avr32 already selects BR2_SOFT_FLOAT in the current git master.

 Thomas> config BR2_avr32
 Thomas>         bool "AVR32"
 Thomas>         select BR2_SOFT_FLOAT

Ahh, good - I missed that.

 Thomas> On the other platforms you mentioned, BR2_SOFT_FLOAT was always
 Thomas> false:

Indeed.

 Thomas> From the perspective of those architectures, the BR2_SOFT_FLOAT
 Thomas> value was always false, and continues to be false after my
 Thomas> patches. If this is not correct, it should certainly be fixed,
 Thomas> but I don't think this is something that gets broken by my
 Thomas> patches: it would have already been wrong, and the Buildroot
 Thomas> code already believes those architectures are all hard float.

Ok, so the patch doesn't make it any worse than it already was, so I'll
apply it.

Thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options Thomas Petazzoni
  2013-07-16 11:53   ` Peter Korsgaard
@ 2013-07-16 13:12   ` Peter Korsgaard
  1 sibling, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:12 UTC (permalink / raw)
  To: buildroot

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

 Thomas> As we are going to introduced a more advanced support of floating
 Thomas> point options for the ARM architecture, we need to adjust how the
 Thomas> soft-float option is handled. We replace the current hidden option
 Thomas> BR2_PREFER_SOFT_FLOAT option and the visible BR2_SOFT_FLOAT option by:

 Thomas>  * A global hidden BR2_SOFT_FLOAT option, defined in arch/Config.in,
 Thomas>    that tells whether the architecture-specific code is using software
 Thomas>    emulated floating point. This hidden option can be used throughout
 Thomas>    Buildroot to determine whether soft float is used or not.

 Thomas>  * Per-architecture visible BR2_<arch>_SOFT_FLOAT options, for the
 Thomas>    architecture for which it makes sense, which allows users to select
 Thomas>    soft float emulation when needed.

 Thomas> This change will allow each architecture to have a different way of
 Thomas> presenting its floating point capabilities.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 03/14] arch: improve ARM floating point support and add support for EABIhf
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 03/14] arch: improve ARM floating point support and add support for EABIhf Thomas Petazzoni
@ 2013-07-16 13:12   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:12 UTC (permalink / raw)
  To: buildroot

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

 Thomas> This commit introduces the support for the EABIhf ABI, next to the
 Thomas> existing support we have for EABI and OABI (even though OABI support
 Thomas> is deprecated). EABIhf allows to improve performance of floating point
 Thomas> workload by using floating point registers to transfer floating point
 Thomas> arguments when calling functions, instead of using integer registers
 Thomas> to do, as is done in the 'softfp' floating point model of EABI.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 04/14] binutils: exclude binutils versions that don't support EABIhf
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 04/14] binutils: exclude binutils versions that don't support EABIhf Thomas Petazzoni
@ 2013-07-16 13:12   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:12 UTC (permalink / raw)
  To: buildroot

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

 Thomas> The ARM EABIhf support was introduced in Binutils 2.22, so earlier
 Thomas> versions should not be selected when EABIhf is used.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 05/14] gcc: take into account ARM floating point capabilities
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 05/14] gcc: take into account ARM floating point capabilities Thomas Petazzoni
@ 2013-07-16 13:13   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:13 UTC (permalink / raw)
  To: buildroot

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

 Thomas> The ARM EABIhf support was introduced in gcc 4.6.x, so versions
 Thomas> earlier than this one should not be used when EABIhf is selected.

 Thomas> The ARM VFPv4 support was introduced in gcc 4.5.x, so versions earlier
 Thomas> than this one should not be used when VFPv4 is used.

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 Thomas> ---
 Thomas>  package/gcc/Config.in.host | 10 ++++++++++
 Thomas>  1 file changed, 10 insertions(+)

 Thomas> diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
 Thomas> index a529d14..1f9aa9a 100644
 Thomas> --- a/package/gcc/Config.in.host
 Thomas> +++ b/package/gcc/Config.in.host
 Thomas> @@ -22,15 +22,22 @@ choice
 
 Thomas>  	config BR2_GCC_VERSION_4_3_X
 Thomas>  		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_cortex_a5 && !BR2_cortex_a7 && !BR2_cortex_a8 && !BR2_cortex_a9 && !BR2_cortex_a15 && !BR2_x86_atom && !BR2_powerpc_e300c2 && !BR2_powerpc_e300c3 && !BR2_powerpc_e500mc && !BR2_powerpc_464 && !BR2_powerpc_464fp && !BR2_powerpc_476 && !BR2_powerpc_476fp && !BR2_fa526 && !BR2_pj4
 Thomas> +		depends on !BR2_ARM_EABIHF
 Thomas>  		bool "gcc 4.3.x"
 
 Thomas>  	config BR2_GCC_VERSION_4_4_X
 Thomas>  		depends on !BR2_arc && !BR2_avr32 && !BR2_cortex_a5 && !BR2_cortex_a7 && !BR2_cortex_a15 && !BR2_x86_atom && !BR2_powerpc_476 && !BR2_powerpc_476fp && !BR2_fa526 && !BR2_pj4
 Thomas>  		bool "gcc 4.4.x"
 Thomas> +		# ARM EABIhf support appeared in gcc 4.6
 Thomas> +		depends on !BR2_ARM_EABIHF
 Thomas> +		# VFPv4 support appeared in gcc 4.5
 Thomas> +		depends on !BR2_ARM_FPU_VFPV4 && !BR2_ARM_FPU_VFPV4D16
 
 Thomas>  	config BR2_GCC_VERSION_4_5_X
 Thomas>  		depends on !BR2_arc && !BR2_avr32 && !BR2_cortex_a7 && !BR2_cortex_a15 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_fa526 && !BR2_pj4
 Thomas>  		select BR2_GCC_NEEDS_MPC
 Thomas> +		# ARM EABIhf support appeared in gcc 4.6
 Thomas> +		depends on !BR2_ARM_EABIHF
 Thomas>  		bool "gcc 4.5.x"
 
 Thomas>  	config BR2_GCC_VERSION_4_6_X
 Thomas> @@ -40,17 +47,20 @@ choice
 
 Thomas>  	config BR2_GCC_VERSION_4_7_X
 Thomas>  		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_pj4
 Thomas> +		depends on !BR2_ARM_OABI

OABI is gone, so these can be dropped.

Committed with that fixed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 06/14] toolchain: remove the old BR2_VFP_FLOAT option
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 06/14] toolchain: remove the old BR2_VFP_FLOAT option Thomas Petazzoni
@ 2013-07-16 13:15   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:15 UTC (permalink / raw)
  To: buildroot

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

 Thomas> Now that we have a much better way of selecting between the various
 Thomas> VFP versions and capabilities, the BR2_VFP_FLOAT version no longer
 Thomas> makes sense. This commit gets rid of it, and adds the appropriate
 Thomas> Config.in.legacy code.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 07/14] configs: update defconfigs after VFP option changes
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 07/14] configs: update defconfigs after VFP option changes Thomas Petazzoni
@ 2013-07-16 13:16   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:16 UTC (permalink / raw)
  To: buildroot

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

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig Thomas Petazzoni
@ 2013-07-16 13:19   ` Peter Korsgaard
  2013-07-16 13:32     ` Thomas Petazzoni
  2013-07-16 13:39   ` Peter Korsgaard
  1 sibling, 1 reply; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:19 UTC (permalink / raw)
  To: buildroot

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

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 Thomas> ---
 Thomas>  configs/beaglebone_defconfig | 3 +--
 Thomas>  1 file changed, 1 insertion(+), 2 deletions(-)

Did you test build this? I had a beaglebone derived config (but with
latest linaro), and u-boot failed to build with:

/home/peko/source/buildroot/output/host/usr/bin/arm-linux-gnueabihf-gcc -DDO_DEPS_ONLY \
		-g  -Os   -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -I/home/peko/source/buildroot/output/build/uboot-2013.04/include -fno-builtin -ffreestanding -nostdinc -isystem /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/include -pipe  -DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a -Wall -Wstrict-prototypes       \
			-o arch/arm/cpu/armv7/am33xx/asm-offsets.s arch/arm/cpu/armv7/am33xx/asm-offsets.c -c -S; \
	else \
		touch arch/arm/cpu/armv7/am33xx/asm-offsets.s; \
	fi
arm-linux-gnueabihf-gcc: error: -mfloat-abi=soft and -mfloat-abi=hard may not be used together
make[1]: *** [lib/asm-offsets.s] Error 1

Because of the hard/soft float mixup. It might not happen with the
internal toolchain as we're not forcing -mfloat-abi=hard on the command
line, but I haven't tried yet.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 09/14] toolchain-external: update config options after EABIhf introduction
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 09/14] toolchain-external: update config options after EABIhf introduction Thomas Petazzoni
@ 2013-07-16 13:21   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:21 UTC (permalink / raw)
  To: buildroot

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

 Thomas> The introduction of the EABIhf ABI requires a few updates to the
 Thomas> configuration options for external toolchains, in order to ensure that
 Thomas> the user doesn't do any invalid selection. In detail:

 Thomas>  * The Linaro ARM toolchains now depend on BR2_ARM_EABIHF, because
 Thomas>    that's the ABI they use, and it is incompatible with EABI. The
 Thomas>    comment about the availability of Linaro toolchains is updated to
 Thomas>    inform users selecting EABI that they should select EABIhf if they
 Thomas>    want to see Linaro toolchains.

 Thomas>  * The Sourcery CodeBench toolchains now depend on BR2_ARM_EABI,
 Thomas>    because that's the ABI they use. A comment is added to inform users
 Thomas>    that have selected EABIhf that Sourcery CodeBench are only
 Thomas>    available when EABI is used.

 Thomas>  * The Arago toolchains now depend on BR2_ARM_EABI, because that's the
 Thomas>    ABI they use. The description of the ARMv7 Arago toolchain is also
 Thomas>    slightly improved.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 10/14] gcc: create symbolic link to ld-linux in EABIhf/gcc 4.7/eglibc
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 10/14] gcc: create symbolic link to ld-linux in EABIhf/gcc 4.7/eglibc Thomas Petazzoni
@ 2013-07-16 13:23   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:23 UTC (permalink / raw)
  To: buildroot

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

 Thomas> When using eglibc, the ld-linux loader is installed as
 Thomas> ld-linux-armhf.so.3, but gcc 4.7.x was not yet updated, and generates
 Thomas> binaries that reference ld-linux.so.3. This was fixed starting with
 Thomas> gcc 4.8.x. In order to be able to use gcc 4.7, we create the
 Thomas> appropriate symbolic link.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 11/14] arch/arm: add support for Thumb2
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 11/14] arch/arm: add support for Thumb2 Thomas Petazzoni
@ 2013-07-16 13:29   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:29 UTC (permalink / raw)
  To: buildroot

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

 Thomas> Until now, we were using the default ARM instruction set, as used by
 Thomas> the toolchain: the 32 bits ARM instruction set for the internal
 Thomas> backend, and for external toolchain, whatever default was chosen when
 Thomas> the toolchain was generated.

 Thomas> This commit adds support for the Thumb2 instruction set. To do so, it:

 Thomas>  * provides a menuconfig choice between ARM and Thumb2. The choice is
 Thomas>    only shown when Thumb2 is supported, i.e on ARMv7-A CPUs.

 Thomas>  * passes the --with-mode={arm,thumb} option when building gcc in the
 Thomas>    internal backend. This tells the compiler which type of
 Thomas>    instructions it should generate.

 Thomas>  * passes the m{arm,thumb} option in the external toolchain
 Thomas>    wrapper. ARM and Thumb2 code can freely be mixed together, so the
 Thomas>    fact that the C library has been built either ARM or Thumb2 and
 Thomas>    that the rest of the code is built Thumb2 or ARM is not a problem.

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 Thomas> ---
 Thomas>  arch/Config.in                                     |  6 ++++
 Thomas>  arch/Config.in.arm                                 | 36 ++++++++++++++++++++++
 Thomas>  package/gcc/gcc.mk                                 |  5 +++
 Thomas>  toolchain/toolchain-external/ext-tool.mk           |  5 +++
 Thomas>  .../toolchain-external/ext-toolchain-wrapper.c     |  3 ++
 Thomas>  5 files changed, 55 insertions(+)


 Thomas> +++ b/package/gcc/gcc.mk
 Thomas> @@ -177,6 +177,11 @@ ifneq ($(GCC_TARGET_FLOAT_ABI),)
 Thomas>  HOST_GCC_COMMON_CONF_OPT += --with-float=$(GCC_TARGET_FLOAT_ABI)
 Thomas>  endif
 
 Thomas> +GCC_TARGET_MODE = $(call qstrip,$(BR2_GCC_TARGET_MODE))
 Thomas> +ifneq ($(GCC_TARGET_MODE),y)

This should check against the empty string and not 'y'.

Committed with that fixed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 12/14] uclibc: use numbered patches for 0.9.33.2
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 12/14] uclibc: use numbered patches for 0.9.33.2 Thomas Petazzoni
@ 2013-07-16 13:31   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:31 UTC (permalink / raw)
  To: buildroot

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

 Thomas> In preparation to the addition of more patches that require a correct
 Thomas> ordering, rename uClibc 0.9.33.2 patches.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 13/14] uclibc: add Thumb2 fixes
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 13/14] uclibc: add Thumb2 fixes Thomas Petazzoni
@ 2013-07-16 13:32   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:32 UTC (permalink / raw)
  To: buildroot

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

 Thomas> This commit adds three patches to uClibc that are needed to make
 Thomas> Thumb2 support work properly:

 Thomas>  uclibc-0006-arm-clone-restore-stack-pointer-just-after-return-fr.patch
 Thomas>  uclibc-0007-arm-clone.S-Add-missing-IT-instruction-for-Thumb2.patch
 Thomas>  uclibc-0008-arm-move-check-for-BX-to-its-own-header.patch

 Thomas> The first one is a necessary dependency of the second one. Both of
 Thomas> those patches have already been merged upstream, after 0.9.33.2. The
 Thomas> third one hasn't been merged upstream yet, but it has already been
 Thomas> submitted a while ago by Yann E. Morin, without receiving attention
 Thomas> from upstream.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 14/14] arch: use tabs instead of spaces in Config.in files
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 14/14] arch: use tabs instead of spaces in Config.in files Thomas Petazzoni
@ 2013-07-16 13:32   ` Peter Korsgaard
  0 siblings, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:32 UTC (permalink / raw)
  To: buildroot

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

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16 13:19   ` Peter Korsgaard
@ 2013-07-16 13:32     ` Thomas Petazzoni
  2013-07-16 13:39       ` Peter Korsgaard
  0 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16 13:32 UTC (permalink / raw)
  To: buildroot

Dear Peter Korsgaard,

On Tue, 16 Jul 2013 15:19:04 +0200, Peter Korsgaard wrote:

> Did you test build this? I had a beaglebone derived config (but with
> latest linaro), and u-boot failed to build with:

Yes, I tried beaglebone_defconfig, which uses an internal toolchain...
which would not exhibit this problem.

> /home/peko/source/buildroot/output/host/usr/bin/arm-linux-gnueabihf-gcc -DDO_DEPS_ONLY \
> 		-g  -Os   -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -I/home/peko/source/buildroot/output/build/uboot-2013.04/include -fno-builtin -ffreestanding -nostdinc -isystem /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/include -pipe  -DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a -Wall -Wstrict-prototypes       \
> 			-o arch/arm/cpu/armv7/am33xx/asm-offsets.s arch/arm/cpu/armv7/am33xx/asm-offsets.c -c -S; \
> 	else \
> 		touch arch/arm/cpu/armv7/am33xx/asm-offsets.s; \
> 	fi
> arm-linux-gnueabihf-gcc: error: -mfloat-abi=soft and -mfloat-abi=hard may not be used together
> make[1]: *** [lib/asm-offsets.s] Error 1
> 
> Because of the hard/soft float mixup. It might not happen with the
> internal toolchain as we're not forcing -mfloat-abi=hard on the command
> line, but I haven't tried yet.

Unfortunately, I'm not sure how to fix this particular problem. It's
gcc that is too stupid to understand that -msoft-float appearing in the
command line after -mfloat-abi=hard should take precedence over
-mfloat-abi=hard. I believe we already had this case in the past, maybe
not specifically with those options, but with other options.

One solution I see to this is not very nice:

	if (gcc command line contains -msoft-float) {
		do not pass -mfloat-abi and -mfpu arguments
	}

The other solution is to simply not pass -mfloat-abi=hard, assuming the
toolchain would by default generate such binaries, which should be the
case because EABI and EABIhf are not compatible. However, we should
still pass -mfloat-abi=soft/softfp as needed.

That makes me think that I should maybe add a check that ensures that
the ABI selection (EABI/EABIhf) matches the one provided by the
external toolchain (which is useful when custom external toolchains are
used).

Thoughts?

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16 13:32     ` Thomas Petazzoni
@ 2013-07-16 13:39       ` Peter Korsgaard
  2013-07-16 13:47         ` Thomas Petazzoni
  0 siblings, 1 reply; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:39 UTC (permalink / raw)
  To: buildroot

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

 Thomas> Dear Peter Korsgaard,
 Thomas> On Tue, 16 Jul 2013 15:19:04 +0200, Peter Korsgaard wrote:

 >> Did you test build this? I had a beaglebone derived config (but with
 >> latest linaro), and u-boot failed to build with:

 Thomas> Yes, I tried beaglebone_defconfig, which uses an internal toolchain...
 Thomas> which would not exhibit this problem.

Ok, good. Then I'll commit it.


 Thomas> Unfortunately, I'm not sure how to fix this particular problem. It's
 Thomas> gcc that is too stupid to understand that -msoft-float appearing in the
 Thomas> command line after -mfloat-abi=hard should take precedence over
 Thomas> -mfloat-abi=hard. I believe we already had this case in the past, maybe
 Thomas> not specifically with those options, but with other options.

 Thomas> One solution I see to this is not very nice:

 Thomas> 	if (gcc command line contains -msoft-float) {
 Thomas> 		do not pass -mfloat-abi and -mfpu arguments
 Thomas> 	}

You mean in the toolchain wrapper? Yddrk.


 Thomas> The other solution is to simply not pass -mfloat-abi=hard, assuming the
 Thomas> toolchain would by default generate such binaries, which should be the
 Thomas> case because EABI and EABIhf are not compatible. However, we should
 Thomas> still pass -mfloat-abi=soft/softfp as needed.

That could work, but also doesn't sound really nice. Presumably gcc
doesn't complain about -mfloat-abi=softfp -mfloat-abi=soft as those are
compatible.


 Thomas> That makes me think that I should maybe add a check that ensures that
 Thomas> the ABI selection (EABI/EABIhf) matches the one provided by the
 Thomas> external toolchain (which is useful when custom external toolchains are
 Thomas> used).

That would be a nice addition, yes.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16  8:03 ` [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig Thomas Petazzoni
  2013-07-16 13:19   ` Peter Korsgaard
@ 2013-07-16 13:39   ` Peter Korsgaard
  1 sibling, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 13:39 UTC (permalink / raw)
  To: buildroot

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

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16 13:39       ` Peter Korsgaard
@ 2013-07-16 13:47         ` Thomas Petazzoni
  2013-07-16 15:06           ` Spenser Gilliland
  0 siblings, 1 reply; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16 13:47 UTC (permalink / raw)
  To: buildroot

Dear Peter Korsgaard,

On Tue, 16 Jul 2013 15:39:19 +0200, Peter Korsgaard wrote:

>  Thomas> Yes, I tried beaglebone_defconfig, which uses an internal toolchain...
>  Thomas> which would not exhibit this problem.
> 
> Ok, good. Then I'll commit it.
> 
> 
>  Thomas> Unfortunately, I'm not sure how to fix this particular problem. It's
>  Thomas> gcc that is too stupid to understand that -msoft-float appearing in the
>  Thomas> command line after -mfloat-abi=hard should take precedence over
>  Thomas> -mfloat-abi=hard. I believe we already had this case in the past, maybe
>  Thomas> not specifically with those options, but with other options.
> 
>  Thomas> One solution I see to this is not very nice:
> 
>  Thomas> 	if (gcc command line contains -msoft-float) {
>  Thomas> 		do not pass -mfloat-abi and -mfpu arguments
>  Thomas> 	}
> 
> You mean in the toolchain wrapper? Yddrk.

Yes, I meant in the toolchain wrapper. I'm pretty sure we had a similar
discussion not long ago about an incompatibility between options
hard-coded into the wrapper and additional options passed to the
compiler.

>  Thomas> The other solution is to simply not pass -mfloat-abi=hard, assuming the
>  Thomas> toolchain would by default generate such binaries, which should be the
>  Thomas> case because EABI and EABIhf are not compatible. However, we should
>  Thomas> still pass -mfloat-abi=soft/softfp as needed.
> 
> That could work, but also doesn't sound really nice. Presumably gcc
> doesn't complain about -mfloat-abi=softfp -mfloat-abi=soft as those are
> compatible.

$ arm-linux-gnueabihf-gcc -mfloat-abi=hard -msoft-float -c toto.c
arm-linux-gnueabihf-gcc: erreur: -mfloat-abi=soft and -mfloat-abi=hard may not be used together
$ arm-linux-gnueabihf-gcc -mfloat-abi=soft -msoft-float -c toto.c
$ arm-linux-gnueabihf-gcc -mfloat-abi=softfp -msoft-float -c toto.c
$ arm-linux-gnueabihf-gcc -mfloat-abi=softfp -mfloat-abi=soft -msoft-float -c toto.c
$

So I'm not sure how to handle that.

>  Thomas> That makes me think that I should maybe add a check that ensures that
>  Thomas> the ABI selection (EABI/EABIhf) matches the one provided by the
>  Thomas> external toolchain (which is useful when custom external toolchains are
>  Thomas> used).
> 
> That would be a nice addition, yes.

Indeed, I'll try to cook a patch for this.

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16 13:47         ` Thomas Petazzoni
@ 2013-07-16 15:06           ` Spenser Gilliland
  2013-07-16 15:23             ` Thomas Petazzoni
  2013-07-16 15:31             ` Peter Korsgaard
  0 siblings, 2 replies; 39+ messages in thread
From: Spenser Gilliland @ 2013-07-16 15:06 UTC (permalink / raw)
  To: buildroot

Thomas,

>
>>  Thomas> Yes, I tried beaglebone_defconfig, which uses an internal toolchain...
>>  Thomas> which would not exhibit this problem.
>>
>> Ok, good. Then I'll commit it.
>>
>>
>>  Thomas> Unfortunately, I'm not sure how to fix this particular problem. It's
>>  Thomas> gcc that is too stupid to understand that -msoft-float appearing in the
>>  Thomas> command line after -mfloat-abi=hard should take precedence over
>>  Thomas> -mfloat-abi=hard. I believe we already had this case in the past, maybe
>>  Thomas> not specifically with those options, but with other options.
>>
>>  Thomas> One solution I see to this is not very nice:
>>
>>  Thomas>      if (gcc command line contains -msoft-float) {
>>  Thomas>              do not pass -mfloat-abi and -mfpu arguments
>>  Thomas>      }
>>
>> You mean in the toolchain wrapper? Yddrk.
>
> Yes, I meant in the toolchain wrapper. I'm pretty sure we had a similar
> discussion not long ago about an incompatibility between options
> hard-coded into the wrapper and additional options passed to the
> compiler.

FWIW; The following thread explains the situation for UBoot

http://u-boot.10912.n7.nabble.com/U-Boot-RFC-PATCH-ARMV7-Patch-to-fix-hard-float-build-issues-td22107.html

In summary, uboot will keep -msoft-float and will not accept the patch
for reasons of preventing possible floating point assembly being
generated.

IMHO: the simple solution could be to just do a CFLAGS=$(filter
-mfloat-abi=hard, $(TARGET_CFLAGS)) when passing to uboot as uboot
should not generate any float code at all.

>>  Thomas> The other solution is to simply not pass -mfloat-abi=hard, assuming the
>>  Thomas> toolchain would by default generate such binaries, which should be the
>>  Thomas> case because EABI and EABIhf are not compatible. However, we should
>>  Thomas> still pass -mfloat-abi=soft/softfp as needed.
>>
>> That could work, but also doesn't sound really nice. Presumably gcc
>> doesn't complain about -mfloat-abi=softfp -mfloat-abi=soft as those are
>> compatible.
>
> $ arm-linux-gnueabihf-gcc -mfloat-abi=hard -msoft-float -c toto.c
> arm-linux-gnueabihf-gcc: erreur: -mfloat-abi=soft and -mfloat-abi=hard may not be used together
> $ arm-linux-gnueabihf-gcc -mfloat-abi=soft -msoft-float -c toto.c
> $ arm-linux-gnueabihf-gcc -mfloat-abi=softfp -msoft-float -c toto.c
> $ arm-linux-gnueabihf-gcc -mfloat-abi=softfp -mfloat-abi=soft -msoft-float -c toto.c
> $
>
> So I'm not sure how to handle that.
>
>>  Thomas> That makes me think that I should maybe add a check that ensures that
>>  Thomas> the ABI selection (EABI/EABIhf) matches the one provided by the
>>  Thomas> external toolchain (which is useful when custom external toolchains are
>>  Thomas> used).
>>
>> That would be a nice addition, yes.
>
> Indeed, I'll try to cook a patch for this.

Thanks,
Spenser

--
Spenser Gilliland
Computer Engineer
Doctoral Candidate

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16 15:06           ` Spenser Gilliland
@ 2013-07-16 15:23             ` Thomas Petazzoni
  2013-07-16 15:31             ` Peter Korsgaard
  1 sibling, 0 replies; 39+ messages in thread
From: Thomas Petazzoni @ 2013-07-16 15:23 UTC (permalink / raw)
  To: buildroot

Dear Spenser Gilliland,

On Tue, 16 Jul 2013 10:06:22 -0500, Spenser Gilliland wrote:

> In summary, uboot will keep -msoft-float and will not accept the patch
> for reasons of preventing possible floating point assembly being
> generated.
> 
> IMHO: the simple solution could be to just do a CFLAGS=$(filter
> -mfloat-abi=hard, $(TARGET_CFLAGS)) when passing to uboot as uboot
> should not generate any float code at all.

That's not possible because -mfloat-abi=hard is not passed through
CFLAGS, but directly hardcoded into the external toolchain wrapper. The
reasoning for hardcoding that into the external toolchain wrapper is
that people using $(O)/host/usr/bin/<arch>-gcc to build their own stuff
outside of Buildroot will automagically get the proper flags, without
having to worry about this.

So we can't just "filter" flags in uboot.mk as you suggest,
unfortunately.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig
  2013-07-16 15:06           ` Spenser Gilliland
  2013-07-16 15:23             ` Thomas Petazzoni
@ 2013-07-16 15:31             ` Peter Korsgaard
  1 sibling, 0 replies; 39+ messages in thread
From: Peter Korsgaard @ 2013-07-16 15:31 UTC (permalink / raw)
  To: buildroot

>>>>> "Spenser" == Spenser Gilliland <spenser@gillilanding.com> writes:

Hi,

 Spenser> FWIW; The following thread explains the situation for UBoot

 Spenser> http://u-boot.10912.n7.nabble.com/U-Boot-RFC-PATCH-ARMV7-Patch-to-fix-hard-float-build-issues-td22107.html

Thanks.

 Spenser> IMHO: the simple solution could be to just do a CFLAGS=$(filter
 Spenser> -mfloat-abi=hard, $(TARGET_CFLAGS)) when passing to uboot as uboot
 Spenser> should not generate any float code at all.

That unfortunately doesn't work as -mfloat-abi=hard is baked into the
toolchain wrapper. I'm afraid the only solution is to detect
-mfloat-abi=soft* in the wrapper and then skip -mfloat-abi=hard like
Thomas suggested - Or to rely on the defaults of the toolchain and never
pass it.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2013-07-16 15:31 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-16  8:03 [Buildroot] [PATCHv3 00/14] ARM floating point improvements, EABIhf and Thumb2 support Thomas Petazzoni
2013-07-16  8:03 ` [Buildroot] [PATCHv3 01/14] arch: introduce BR2_GCC_TARGET_{FPU, FLOAT_ABI} Thomas Petazzoni
2013-07-16 11:48   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 02/14] arch: Refactor BR2_SOFT_FLOAT into per-architecture options Thomas Petazzoni
2013-07-16 11:53   ` Peter Korsgaard
2013-07-16 12:12     ` Thomas Petazzoni
2013-07-16 12:34       ` Peter Korsgaard
2013-07-16 13:12   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 03/14] arch: improve ARM floating point support and add support for EABIhf Thomas Petazzoni
2013-07-16 13:12   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 04/14] binutils: exclude binutils versions that don't support EABIhf Thomas Petazzoni
2013-07-16 13:12   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 05/14] gcc: take into account ARM floating point capabilities Thomas Petazzoni
2013-07-16 13:13   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 06/14] toolchain: remove the old BR2_VFP_FLOAT option Thomas Petazzoni
2013-07-16 13:15   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 07/14] configs: update defconfigs after VFP option changes Thomas Petazzoni
2013-07-16 13:16   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 08/14] configs: use new EABIhf option for beaglebone_defconfig Thomas Petazzoni
2013-07-16 13:19   ` Peter Korsgaard
2013-07-16 13:32     ` Thomas Petazzoni
2013-07-16 13:39       ` Peter Korsgaard
2013-07-16 13:47         ` Thomas Petazzoni
2013-07-16 15:06           ` Spenser Gilliland
2013-07-16 15:23             ` Thomas Petazzoni
2013-07-16 15:31             ` Peter Korsgaard
2013-07-16 13:39   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 09/14] toolchain-external: update config options after EABIhf introduction Thomas Petazzoni
2013-07-16 13:21   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 10/14] gcc: create symbolic link to ld-linux in EABIhf/gcc 4.7/eglibc Thomas Petazzoni
2013-07-16 13:23   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 11/14] arch/arm: add support for Thumb2 Thomas Petazzoni
2013-07-16 13:29   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 12/14] uclibc: use numbered patches for 0.9.33.2 Thomas Petazzoni
2013-07-16 13:31   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 13/14] uclibc: add Thumb2 fixes Thomas Petazzoni
2013-07-16 13:32   ` Peter Korsgaard
2013-07-16  8:03 ` [Buildroot] [PATCHv3 14/14] arch: use tabs instead of spaces in Config.in files Thomas Petazzoni
2013-07-16 13:32   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.