From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] toolchain: Fix the toolchain-wrapper to support more recent GCC versions
Date: Fri, 12 Jan 2018 22:39:52 +0100 [thread overview]
Message-ID: <20180112223952.754b344d@windsurf.lan> (raw)
In-Reply-To: <1515514108-18962-1-git-send-email-johannes.schmitz1@gmail.com>
Hello,
On Tue, 9 Jan 2018 17:08:27 +0100, Johannes Schmitz wrote:
> This fix is necessary for to build for MIPS, for example for the MIPS
> XBurst architecture used on ci20 boards.
>
> Signed-off-by: Johannes Schmitz <johannes.schmitz1@gmail.com>
This is a bit short on explanation. Can you explain what it is fixing?
Why is -mno-fused-madd no longer sufficient in recent gcc versions?
The commit title is also not quite good, it doesn't mention that it's
MIPS-related. Perhaps:
toolchain: use -ffp-contract=off on MIPS XBust in the wrapper when needed
> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> index 2928ea4..dd3a25e 100644
> --- a/toolchain/toolchain-wrapper.c
> +++ b/toolchain/toolchain-wrapper.c
> @@ -79,8 +79,14 @@ static char *predef_args[] = {
> #ifdef BR_OMIT_LOCK_PREFIX
> "-Wa,-momit-lock-prefix=yes",
> #endif
> -#ifdef BR_NO_FUSED_MADD
> - "-mno-fused-madd",
> +#ifdef BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
This condition is not needed, because toolchain-wrapper.mk is already
taking care of passing BR_NO_FUSED_MADD or BR2_FP_CONTRACT_OFF.
> + #ifdef BR_FP_CONTRACT_OFF
> + "-ffp-contract=off",
> + #endif
> +#else
> + #ifdef BR_NO_FUSED_MADD
> + "-mno-fused-madd",
> + #endif
> #endif
> #ifdef BR_BINFMT_FLAT
> "-Wl,-elf2flt",
> diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
> index 7f72a0c..b7a4b9b 100644
> --- a/toolchain/toolchain-wrapper.mk
> +++ b/toolchain/toolchain-wrapper.mk
> @@ -28,7 +28,11 @@ endif
>
> # Avoid FPU bug on XBurst CPUs
> ifeq ($(BR2_mips_xburst),y)
> -TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
> + 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
Please don't indent lines. That's the Buildroot convention.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2018-01-12 21:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-09 16:08 [Buildroot] [PATCH 1/2] toolchain: Fix the toolchain-wrapper to support more recent GCC versions Johannes Schmitz
2018-01-09 16:08 ` [Buildroot] [PATCH 2/2] board/ci20: Implement creation of a basic sdcard image for ci20 Johannes Schmitz
2018-01-12 21:44 ` Thomas Petazzoni
2018-01-12 21:39 ` Thomas Petazzoni [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-01-09 16:07 [Buildroot] [PATCH 1/2] toolchain: Fix the toolchain-wrapper to support more recent GCC versions Johannes Schmitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180112223952.754b344d@windsurf.lan \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox