Building for an SH target without FPU

Sébastien Michelland sebastien.mld@numericable.fr
Thu Mar 7 20:17:00 GMT 2019


On Wed, 2019-03-06 at 18:04 -0600, Segher Boessenkool wrote:
>
> There is https://gcc.gnu.org/PR64008 which probably is relevant.
>
> Configuring with --enable-targets=all will help.
>
> I use this patch for sh, that may help too:
>
> diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
> index 0204872..7f126ce 100644
> --- a/gcc/config/sh/sh.h
> +++ b/gcc/config/sh/sh.h
> @@ -124,6 +124,9 @@ extern int code_for_indirect_jump_scratch;
>   #define SUPPORT_SH2A_NOFPU 1
>   #endif
>   #if SUPPORT_SH3
> +#define SUPPORT_SH4 1
> +#endif
> +#if SUPPORT_SH4
>   #define SUPPORT_SH4_NOFPU 1
>   #endif
>   #if SUPPORT_SH4_NOFPU

Thanks! I tried --enable-targets=all when building binutils, but it went 
around compiling a toolchain for every supported target (way too much 
for my computer to handle on GCC), so I didn't dare try this option on 
GCC. Did I miss anything?

On 3/7/19 1:40 AM, Oleg Endo wrote:
> 
> Other than that, is "sh4eb-nofpu-elf" actually a valid recognized
> triplet?  Maybe it "works" but does effectively nothing? I don't
> remember....
> 
> In any case, the problem sounds more like a (default) multilib
> configuration.  See also the PR link above and the configuration option
> --with-multilib-list

Looks like you two solved my problem again!

I had found this option but didn't really know how to use it and got a 
"not supported"-like error. Now the context you provided had all the 
defails, and --with-multilib-list=m4-nofpu worked as expected, avoiding 
all FPU instructions when -m4-nofpu is passed. I'm not sure which target 
is being used when no options are given, though.

I'm really grateful for the swift help, thanks a lot!
Sébastien



More information about the Gcc-help mailing list