All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH RESEND] toolchain: use -ffp-contract=off on MIPS in the wrapper when needed
@ 2018-03-08 12:14 Ezequiel Garcia
  2018-03-08 12:33 ` Baruch Siach
  0 siblings, 1 reply; 4+ messages in thread
From: Ezequiel Garcia @ 2018-03-08 12:14 UTC (permalink / raw)
  To: buildroot

From: Johannes Schmitz <johannes.schmitz1@gmail.com>

This fix is necessary for to build for MIPS, for example for the MIPS
XBurst architecture used on ci20 boards.

GCC has replaced (no)mfused-madd with ffp-contract.
Find more details and a long discussion at
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00876.html

Signed-off-by: Johannes Schmitz <johannes.schmitz1@gmail.com>
Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
---
Ci20 builds are currently broken without this patch.

 toolchain/toolchain-wrapper.c  | 3 ---
 toolchain/toolchain-wrapper.mk | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index 2928ea42d0e6..04b263199547 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -79,9 +79,6 @@ static char *predef_args[] = {
 #ifdef BR_OMIT_LOCK_PREFIX
 	"-Wa,-momit-lock-prefix=yes",
 #endif
-#ifdef BR_NO_FUSED_MADD
-	"-mno-fused-madd",
-#endif
 #ifdef BR_BINFMT_FLAT
 	"-Wl,-elf2flt",
 #endif
diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
index 7f72a0cadec9..7faa033f605c 100644
--- a/toolchain/toolchain-wrapper.mk
+++ b/toolchain/toolchain-wrapper.mk
@@ -28,8 +28,12 @@ endif
 
 # Avoid FPU bug on XBurst CPUs
 ifeq ($(BR2_mips_xburst),y)
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y)
+TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
+else
 TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
 endif
+endif
 
 ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
 TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'
-- 
2.16.2

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

* [Buildroot] [PATCH RESEND] toolchain: use -ffp-contract=off on MIPS in the wrapper when needed
  2018-03-08 12:14 [Buildroot] [PATCH RESEND] toolchain: use -ffp-contract=off on MIPS in the wrapper when needed Ezequiel Garcia
@ 2018-03-08 12:33 ` Baruch Siach
  2018-03-09 13:38   ` Ezequiel Garcia
  0 siblings, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2018-03-08 12:33 UTC (permalink / raw)
  To: buildroot

Hi Ezequiel,

On Thu, Mar 08, 2018 at 09:14:30AM -0300, Ezequiel Garcia wrote:
> From: Johannes Schmitz <johannes.schmitz1@gmail.com>
> 
> This fix is necessary for to build for MIPS, for example for the MIPS
> XBurst architecture used on ci20 boards.
> 
> GCC has replaced (no)mfused-madd with ffp-contract.
> Find more details and a long discussion at
> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00876.html
> 
> Signed-off-by: Johannes Schmitz <johannes.schmitz1@gmail.com>
> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
> ---
> Ci20 builds are currently broken without this patch.
> 
>  toolchain/toolchain-wrapper.c  | 3 ---
>  toolchain/toolchain-wrapper.mk | 4 ++++
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> index 2928ea42d0e6..04b263199547 100644
> --- a/toolchain/toolchain-wrapper.c
> +++ b/toolchain/toolchain-wrapper.c
> @@ -79,9 +79,6 @@ static char *predef_args[] = {
>  #ifdef BR_OMIT_LOCK_PREFIX
>  	"-Wa,-momit-lock-prefix=yes",
>  #endif
> -#ifdef BR_NO_FUSED_MADD

Since you remove this macro reference, ...

> -	"-mno-fused-madd",
> -#endif
>  #ifdef BR_BINFMT_FLAT
>  	"-Wl,-elf2flt",
>  #endif
> diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
> index 7f72a0cadec9..7faa033f605c 100644
> --- a/toolchain/toolchain-wrapper.mk
> +++ b/toolchain/toolchain-wrapper.mk
> @@ -28,8 +28,12 @@ endif
>  
>  # Avoid FPU bug on XBurst CPUs
>  ifeq ($(BR2_mips_xburst),y)
> +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y)
> +TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
> +else
>  TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD

... why not remove it here as well?

>  endif
> +endif
>  
>  ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
>  TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH RESEND] toolchain: use -ffp-contract=off on MIPS in the wrapper when needed
  2018-03-08 12:33 ` Baruch Siach
@ 2018-03-09 13:38   ` Ezequiel Garcia
  2018-03-09 14:52     ` Johannes Schmitz
  0 siblings, 1 reply; 4+ messages in thread
From: Ezequiel Garcia @ 2018-03-09 13:38 UTC (permalink / raw)
  To: buildroot

Hi Baruch,

On 8 March 2018 at 09:33, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi Ezequiel,
>
> On Thu, Mar 08, 2018 at 09:14:30AM -0300, Ezequiel Garcia wrote:
>> From: Johannes Schmitz <johannes.schmitz1@gmail.com>
>>
>> This fix is necessary for to build for MIPS, for example for the MIPS
>> XBurst architecture used on ci20 boards.
>>
>> GCC has replaced (no)mfused-madd with ffp-contract.
>> Find more details and a long discussion at
>> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00876.html
>>
>> Signed-off-by: Johannes Schmitz <johannes.schmitz1@gmail.com>
>> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
>> ---
>> Ci20 builds are currently broken without this patch.
>>
>>  toolchain/toolchain-wrapper.c  | 3 ---
>>  toolchain/toolchain-wrapper.mk | 4 ++++
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
>> index 2928ea42d0e6..04b263199547 100644
>> --- a/toolchain/toolchain-wrapper.c
>> +++ b/toolchain/toolchain-wrapper.c
>> @@ -79,9 +79,6 @@ static char *predef_args[] = {
>>  #ifdef BR_OMIT_LOCK_PREFIX
>>       "-Wa,-momit-lock-prefix=yes",
>>  #endif
>> -#ifdef BR_NO_FUSED_MADD
>
> Since you remove this macro reference, ...
>
>> -     "-mno-fused-madd",
>> -#endif
>>  #ifdef BR_BINFMT_FLAT
>>       "-Wl,-elf2flt",
>>  #endif
>> diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
>> index 7f72a0cadec9..7faa033f605c 100644
>> --- a/toolchain/toolchain-wrapper.mk
>> +++ b/toolchain/toolchain-wrapper.mk
>> @@ -28,8 +28,12 @@ endif
>>
>>  # Avoid FPU bug on XBurst CPUs
>>  ifeq ($(BR2_mips_xburst),y)
>> +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y)
>> +TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
>> +else
>>  TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
>
> ... why not remove it here as well?
>

OK, so now I actually looked at this patch, and I think that it's
all wrong:

1. BR_FP_CONTRACT_OFF is not used anywhere.
2. BR_NO_FUSED_MADD usage is removed,
although it's still defined for GCC < 4.6.

Johannes, want to give a shot@sending a correct version?
Probably we just need to add:

#ifdef BR_FP_CONTRACT_OFF
    "-ffp-contract=off",
#endif

somewhere?
-- 
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar

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

* [Buildroot] [PATCH RESEND] toolchain: use -ffp-contract=off on MIPS in the wrapper when needed
  2018-03-09 13:38   ` Ezequiel Garcia
@ 2018-03-09 14:52     ` Johannes Schmitz
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schmitz @ 2018-03-09 14:52 UTC (permalink / raw)
  To: buildroot

2018-03-09 14:38 GMT+01:00 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>:

> Hi Baruch,
>
> On 8 March 2018 at 09:33, Baruch Siach <baruch@tkos.co.il> wrote:
> > Hi Ezequiel,
> >
> > On Thu, Mar 08, 2018 at 09:14:30AM -0300, Ezequiel Garcia wrote:
> >> From: Johannes Schmitz <johannes.schmitz1@gmail.com>
> >>
> >> This fix is necessary for to build for MIPS, for example for the MIPS
> >> XBurst architecture used on ci20 boards.
> >>
> >> GCC has replaced (no)mfused-madd with ffp-contract.
> >> Find more details and a long discussion at
> >> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00876.html
> >>
> >> Signed-off-by: Johannes Schmitz <johannes.schmitz1@gmail.com>
> >> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
> >> ---
> >> Ci20 builds are currently broken without this patch.
> >>
> >>  toolchain/toolchain-wrapper.c  | 3 ---
> >>  toolchain/toolchain-wrapper.mk | 4 ++++
> >>  2 files changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/toolchain/toolchain-wrapper.c
> b/toolchain/toolchain-wrapper.c
> >> index 2928ea42d0e6..04b263199547 100644
> >> --- a/toolchain/toolchain-wrapper.c
> >> +++ b/toolchain/toolchain-wrapper.c
> >> @@ -79,9 +79,6 @@ static char *predef_args[] = {
> >>  #ifdef BR_OMIT_LOCK_PREFIX
> >>       "-Wa,-momit-lock-prefix=yes",
> >>  #endif
> >> -#ifdef BR_NO_FUSED_MADD
> >
> > Since you remove this macro reference, ...
> >
> >> -     "-mno-fused-madd",
> >> -#endif
> >>  #ifdef BR_BINFMT_FLAT
> >>       "-Wl,-elf2flt",
> >>  #endif
> >> diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/
> toolchain-wrapper.mk
> >> index 7f72a0cadec9..7faa033f605c 100644
> >> --- a/toolchain/toolchain-wrapper.mk
> >> +++ b/toolchain/toolchain-wrapper.mk
> >> @@ -28,8 +28,12 @@ endif
> >>
> >>  # Avoid FPU bug on XBurst CPUs
> >>  ifeq ($(BR2_mips_xburst),y)
> >> +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y)
> >> +TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
> >> +else
> >>  TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
> >
> > ... why not remove it here as well?
> >
>
> OK, so now I actually looked at this patch, and I think that it's
> all wrong:
>
> 1. BR_FP_CONTRACT_OFF is not used anywhere.
> 2. BR_NO_FUSED_MADD usage is removed,
> although it's still defined for GCC < 4.6.
>
> Johannes, want to give a shot at sending a correct version?
> Probably we just need to add:
>
> #ifdef BR_FP_CONTRACT_OFF
>     "-ffp-contract=off",
> #endif
>
> somewhere?
> --
> Ezequiel Garc?a, VanguardiaSur
> www.vanguardiasur.com.ar
>
Hello,
I will give it a try.

Regards
Johannes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180309/2451a79c/attachment.html>

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

end of thread, other threads:[~2018-03-09 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08 12:14 [Buildroot] [PATCH RESEND] toolchain: use -ffp-contract=off on MIPS in the wrapper when needed Ezequiel Garcia
2018-03-08 12:33 ` Baruch Siach
2018-03-09 13:38   ` Ezequiel Garcia
2018-03-09 14:52     ` Johannes Schmitz

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.