* [PATCH] arm: Define with_float to hard when target name ends with hf
@ 2022-08-17 8:35 Christophe Lyon
2022-08-17 11:46 ` Richard Earnshaw
0 siblings, 1 reply; 2+ messages in thread
From: Christophe Lyon @ 2022-08-17 8:35 UTC (permalink / raw)
To: gcc-patches
On arm, the --with-float= configure option is used to define include
files search path (among other things). However, when targeting
arm-linux-gnueabihf, one would expect to automatically default to the
hard-float ABI, but this is not the case. As a consequence, GCC
bootstrap fails on an arm-linux-gnueabihf target if --with-float=hard
is not used.
This patch checks if the target name ends with 'hf' and defines
with_float to hard if not already defined. This is achieved in
gcc/config.gcc, just before selecting the default CPU depending on the
$with_float value.
2022-08-17 Christophe Lyon <christophe.lyon@arm.com>
gcc/
* config.gcc (arm): Define with_float to hard if target name ends
with 'hf'.
---
gcc/config.gcc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 4e3b15bb5e9..02f58970db0 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1314,6 +1314,13 @@ arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
tm_file="$tm_file arm/uclinuxfdpiceabi.h"
;;
esac
+ # Define with_float to "hard" if not already defined and
+ # target name ends with "hf"
+ case $target:$with_float in
+ arm*-*-*hf:)
+ with_float=hard
+ ;;
+ esac
# Generation of floating-point instructions requires at least ARMv5te.
if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then
target_cpu_cname="arm10e"
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] arm: Define with_float to hard when target name ends with hf
2022-08-17 8:35 [PATCH] arm: Define with_float to hard when target name ends with hf Christophe Lyon
@ 2022-08-17 11:46 ` Richard Earnshaw
0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2022-08-17 11:46 UTC (permalink / raw)
To: Christophe Lyon, gcc-patches
On 17/08/2022 09:35, Christophe Lyon via Gcc-patches wrote:
> On arm, the --with-float= configure option is used to define include
> files search path (among other things). However, when targeting
> arm-linux-gnueabihf, one would expect to automatically default to the
> hard-float ABI, but this is not the case. As a consequence, GCC
> bootstrap fails on an arm-linux-gnueabihf target if --with-float=hard
> is not used.
>
> This patch checks if the target name ends with 'hf' and defines
> with_float to hard if not already defined. This is achieved in
> gcc/config.gcc, just before selecting the default CPU depending on the
> $with_float value.
>
> 2022-08-17 Christophe Lyon <christophe.lyon@arm.com>
>
> gcc/
> * config.gcc (arm): Define with_float to hard if target name ends
> with 'hf'.
> ---
> gcc/config.gcc | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/gcc/config.gcc b/gcc/config.gcc
> index 4e3b15bb5e9..02f58970db0 100644
> --- a/gcc/config.gcc
> +++ b/gcc/config.gcc
> @@ -1314,6 +1314,13 @@ arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
> tm_file="$tm_file arm/uclinuxfdpiceabi.h"
> ;;
> esac
> + # Define with_float to "hard" if not already defined and
> + # target name ends with "hf"
> + case $target:$with_float in
> + arm*-*-*hf:)
> + with_float=hard
> + ;;
> + esac
> # Generation of floating-point instructions requires at least ARMv5te.
> if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then
> target_cpu_cname="arm10e"
OK.
R.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-17 11:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17 8:35 [PATCH] arm: Define with_float to hard when target name ends with hf Christophe Lyon
2022-08-17 11:46 ` Richard Earnshaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).