Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] SH4A target: error: command line option ‘-m4-nofpu’ is not supported by this configuration
Date: Fri, 2 Dec 2016 09:58:21 +0100	[thread overview]
Message-ID: <20161202095821.0b9fc50c@free-electrons.com> (raw)
In-Reply-To: <DM5PR04MB0635AD43067B754A23B8BAEE958F0@DM5PR04MB0635.namprd04.prod.outlook.com>

Hello,

First of all, thanks for your detailed bug report. It's very nice to
have such a minimal Buildroot .config and kernel configuration to
easily reproduce the problem.

On Thu, 1 Dec 2016 23:59:04 +0000, John Gulbrandsen wrote:

> I?m attempting to use buildroot to create cross-compiler, Linux kernel, boot loader etc. for a custom board that uses a Hitachi SH7786 CPU that has two SH4A CPU cores. It appears something goes wrong in the Linux build when a SH4A target CPU is selected in menuconfig. When a SH4 CPU is selected, everything builds fine but I would rather configure the build for my exact CPU. How do I fix this?
> 
> Note that I have tried to use these additional GCC settings but no difference:
> BR2_EXTRA_GCC_CONFIG_OPTIONS="--with-multilib-list=m4a,m4a-nofpu"
> BR2_EXTRA_GCC_CONFIG_OPTIONS="--with-multilib-list=m4,m4-nofpu"
> 
> See below for make (verbose) output. The below build uses this extra GCC options: BR2_EXTRA_GCC_CONFIG_OPTIONS="--with-multilib-list=m4a,m4a-nofpu"

We are already passing those options to the gcc build. From
package/gcc/gcc-final/gcc-final.mk:

# The kernel wants to use the -m4-nofpu option to make sure that it
# doesn't use floating point operations.
ifeq ($(BR2_sh4)$(BR2_sh4eb),y)
HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4,m4-nofpu"
HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
endif
ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y)
HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu"
HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
endif

So I believe your problem is a mismatch between your CPU selection at
the Buildroot level and at the kernel level. You have configured your
Buildroot for SH4A (so the compiler supports m4a/m4a-nofpu), but the CPU
selected in the kernel configuration is a SH4, so the kernel uses the
-m4-nofpu option.

Here is what the kernel is doing:

cflags-$(CONFIG_CPU_SH4)                := $(call cc-option,-m4,) \
        $(call cc-option,-mno-implicit-fp,-m4-nofpu)
cflags-$(CONFIG_CPU_SH4A)               += $(call cc-option,-m4a,) \
                                           $(call cc-option,-m4a-nofpu,)

So, you need to either:

 - Adjust your Buildroot configuration to use SH4

 - Adjust your Linux kernel configuration to use a SH4A

I will run some test builds to verify my theory.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-12-02  8:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 23:59 [Buildroot] SH4A target: error: command line option ‘-m4-nofpu’ is not supported by this configuration John Gulbrandsen
2016-12-02  8:58 ` Thomas Petazzoni [this message]
2016-12-02 18:41   ` John Gulbrandsen
2016-12-02 20:31     ` Thomas Petazzoni
2016-12-03  0:30       ` John Gulbrandsen

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=20161202095821.0b9fc50c@free-electrons.com \
    --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