diff mbox series

[edk2] BaseTools/tools_def ARM: use softfloat target for CLANG3x

Message ID 20181219145023.5419-1-ard.biesheuvel@linaro.org
State Superseded
Headers show
Series [edk2] BaseTools/tools_def ARM: use softfloat target for CLANG3x | expand

Commit Message

Ard Biesheuvel Dec. 19, 2018, 2:50 p.m. UTC
The target triplet we use for CLANG35 and CLANG38 specifies a
hardfloat target, and so the binaries that are emitted are
annotated as using VFP registers for passing floating point
arguments, even though no VFP is used anywhere in the code.

This works fine as long as we don't try to link against code
that uses software floating point, since combining object files
with different floating point calling conventions is not permitted.

So switch to the softfloat arm-linux-gnueabi triplet instead.
Unfortunately, this requires all CLANG3x/ARM users to install
another cross toolchain.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 BaseTools/Conf/tools_def.template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.19.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Gao, Liming Dec. 20, 2018, 6:51 a.m. UTC | #1
Ard:
  So, this change requires ARM users to install the additional tool chain? If yes, could you list the detail impact to user?

Thanks
Liming
>-----Original Message-----

>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard

>Biesheuvel

>Sent: Wednesday, December 19, 2018 10:50 PM

>To: edk2-devel@lists.01.org

>Cc: Gao, Liming <liming.gao@intel.com>

>Subject: [edk2] [PATCH] BaseTools/tools_def ARM: use softfloat target for

>CLANG3x

>

>The target triplet we use for CLANG35 and CLANG38 specifies a

>hardfloat target, and so the binaries that are emitted are

>annotated as using VFP registers for passing floating point

>arguments, even though no VFP is used anywhere in the code.

>

>This works fine as long as we don't try to link against code

>that uses software floating point, since combining object files

>with different floating point calling conventions is not permitted.

>

>So switch to the softfloat arm-linux-gnueabi triplet instead.

>Unfortunately, this requires all CLANG3x/ARM users to install

>another cross toolchain.

>

>Contributed-under: TianoCore Contribution Agreement 1.1

>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>---

> BaseTools/Conf/tools_def.template | 4 ++--

> 1 file changed, 2 insertions(+), 2 deletions(-)

>

>diff --git a/BaseTools/Conf/tools_def.template

>b/BaseTools/Conf/tools_def.template

>index 2ba833e1fb06..f82bc72327d8 100755

>--- a/BaseTools/Conf/tools_def.template

>+++ b/BaseTools/Conf/tools_def.template

>@@ -5231,7 +5231,7 @@ RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z

>common-page-size=0x20

> *_CLANG35_*_DLINK_PATH           = ENV(CLANG35_BIN)clang

> *_CLANG35_*_ASLDLINK_PATH        = ENV(CLANG35_BIN)clang

>

>-DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf

>+DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabi

> DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu

>

> DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -

>Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare

>-Wno-empty-body -Wno-unknown-warning-option

>@@ -5384,7 +5384,7 @@ NOOPT_CLANG38_X64_DLINK2_FLAGS     =

>DEF(GCC5_X64_DLINK2_FLAGS) -O0

> ##################

> # CLANG38 ARM definitions

> ##################

>-DEFINE CLANG38_ARM_TARGET        = -target arm-linux-gnueabihf

>+DEFINE CLANG38_ARM_TARGET        = -target arm-linux-gnueabi

> DEFINE CLANG38_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS)

>DEF(CLANG38_ARM_TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-

>movt

> DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET)

>DEF(GCC_ARM_DLINK_FLAGS)

>

>--

>2.19.2

>

>_______________________________________________

>edk2-devel mailing list

>edk2-devel@lists.01.org

>https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Dec. 20, 2018, 8:14 a.m. UTC | #2
On Thu, 20 Dec 2018 at 07:54, Gao, Liming <liming.gao@intel.com> wrote:
>

> Ard:

>   So, this change requires ARM users to install the additional tool chain? If yes, could you list the detail impact to user?

>


As mentioned in the commit log

> >Unfortunately, this requires all CLANG3x/ARM users to install

> >another cross toolchain.


but in fact, you only need arm-linux-gnueabi binutils, so I will
update that. Could you elaborate on what level of detail you had in
mind beyond that?



> Thanks

> Liming

> >-----Original Message-----

> >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard

> >Biesheuvel

> >Sent: Wednesday, December 19, 2018 10:50 PM

> >To: edk2-devel@lists.01.org

> >Cc: Gao, Liming <liming.gao@intel.com>

> >Subject: [edk2] [PATCH] BaseTools/tools_def ARM: use softfloat target for

> >CLANG3x

> >

> >The target triplet we use for CLANG35 and CLANG38 specifies a

> >hardfloat target, and so the binaries that are emitted are

> >annotated as using VFP registers for passing floating point

> >arguments, even though no VFP is used anywhere in the code.

> >

> >This works fine as long as we don't try to link against code

> >that uses software floating point, since combining object files

> >with different floating point calling conventions is not permitted.

> >

> >So switch to the softfloat arm-linux-gnueabi triplet instead.

> >Unfortunately, this requires all CLANG3x/ARM users to install

> >another cross toolchain.

> >

> >Contributed-under: TianoCore Contribution Agreement 1.1

> >Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> >---

> > BaseTools/Conf/tools_def.template | 4 ++--

> > 1 file changed, 2 insertions(+), 2 deletions(-)

> >

> >diff --git a/BaseTools/Conf/tools_def.template

> >b/BaseTools/Conf/tools_def.template

> >index 2ba833e1fb06..f82bc72327d8 100755

> >--- a/BaseTools/Conf/tools_def.template

> >+++ b/BaseTools/Conf/tools_def.template

> >@@ -5231,7 +5231,7 @@ RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z

> >common-page-size=0x20

> > *_CLANG35_*_DLINK_PATH           = ENV(CLANG35_BIN)clang

> > *_CLANG35_*_ASLDLINK_PATH        = ENV(CLANG35_BIN)clang

> >

> >-DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf

> >+DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabi

> > DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu

> >

> > DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -

> >Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare

> >-Wno-empty-body -Wno-unknown-warning-option

> >@@ -5384,7 +5384,7 @@ NOOPT_CLANG38_X64_DLINK2_FLAGS     =

> >DEF(GCC5_X64_DLINK2_FLAGS) -O0

> > ##################

> > # CLANG38 ARM definitions

> > ##################

> >-DEFINE CLANG38_ARM_TARGET        = -target arm-linux-gnueabihf

> >+DEFINE CLANG38_ARM_TARGET        = -target arm-linux-gnueabi

> > DEFINE CLANG38_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS)

> >DEF(CLANG38_ARM_TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-

> >movt

> > DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET)

> >DEF(GCC_ARM_DLINK_FLAGS)

> >

> >--

> >2.19.2

> >

> >_______________________________________________

> >edk2-devel mailing list

> >edk2-devel@lists.01.org

> >https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 2ba833e1fb06..f82bc72327d8 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -5231,7 +5231,7 @@  RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
 *_CLANG35_*_DLINK_PATH           = ENV(CLANG35_BIN)clang
 *_CLANG35_*_ASLDLINK_PATH        = ENV(CLANG35_BIN)clang
 
-DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf
+DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabi
 DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu
 
 DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unknown-warning-option
@@ -5384,7 +5384,7 @@  NOOPT_CLANG38_X64_DLINK2_FLAGS     = DEF(GCC5_X64_DLINK2_FLAGS) -O0
 ##################
 # CLANG38 ARM definitions
 ##################
-DEFINE CLANG38_ARM_TARGET        = -target arm-linux-gnueabihf
+DEFINE CLANG38_ARM_TARGET        = -target arm-linux-gnueabi
 DEFINE CLANG38_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS) DEF(CLANG38_ARM_TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-movt
 DEFINE CLANG38_ARM_DLINK_FLAGS   = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLAGS)