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] [PATCH] ext-toolchain: Automatically set -m64 if the architecture is x86_64
Date: Mon, 5 Mar 2012 11:12:46 +0100	[thread overview]
Message-ID: <20120305111246.68ec6324@skate> (raw)
In-Reply-To: <1327169083-15538-1-git-send-email-arnout@mind.be>

Hello Arnout,

Coming back to this patch, I had a closer look this week-end as I
wanted to integrate it, but I have some comments.

> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -341,16 +341,8 @@ config
> BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201109 Sourcery CodeBench
> toolchain for the x86/x86_64 architectures, from Mentor Graphics. It
> uses gcc 4.6.1, binutils 2.21.53, glibc 2.13, gdb 7.2.50 and kernel
> headers
> -	  3.0.1. It has support for the following variants:
> -	    - Intel Pentium 4, glibc, 32 bits
> -              Default, nothing special to do.
> -            - Intel Atom, glibc, 32 bits
> -              Select an Atom core
> -            - Intel Xeon, glibc, 64 bits
> -              Set BR2_TARGET_OPTIMIZATION to -m64
> -            - Intel Core 2, glibc, 64 bits
> -              Select a Core 2 core
> -              Set BR2_TARGET_OPTIMIZATION to -m64
> +	  3.0.1. It has support for all the i386 and x86_64 variants
> +	  mentioned in the Target Architecture Variant menu.

I disagree with this change. If you select "i386" or "i486" as the
Target Architecture Variant, then this Sourcery CodeBench toolchain
will not work: it only has libc variants for Pentium 4, Atom, Xeon and
Core 2, so if you try to use it on something older than Pentium 4, it
might use nonexistent instructions.

Can you explain why you made this change, or revert it?

> +ifeq ($(call qstrip,$(BR2_ARCH_IS_64)),y)
> +TOOLCHAIN_EXTERNAL_CFLAGS += -m64
> +TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_64
> +endif

I don't agree here. -m64 is not an option that exists for all
64-bits architectures. For example, it does not exist on MIPS. -m64 is
part of the architecture-specific options of gcc, so your change should
rather be:

ifeq ($(BR2_x86_64),y)
TOOLCHAIN_EXTERNAL_CFLAGS += -m64
TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_64
endif

(The 'qstrip' is useless)

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  parent reply	other threads:[~2012-03-05 10:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-21 18:04 [Buildroot] [PATCH] ext-toolchain: Automatically set -m64 if the architecture is x86_64 Arnout Vandecappelle
2012-01-23 21:36 ` Thomas Petazzoni
2012-03-05 10:12 ` Thomas Petazzoni [this message]
2012-03-13 21:55   ` Arnout Vandecappelle
2012-03-14 22:23     ` Thomas Petazzoni
2012-03-13 22:30   ` [Buildroot] [PATCHv2] " Arnout Vandecappelle
2012-03-14 22:25     ` Thomas Petazzoni
2012-03-14 23:01     ` Peter Korsgaard
2012-03-15  8:17       ` Arnout Vandecappelle
2012-03-15  9:44         ` Peter Korsgaard

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=20120305111246.68ec6324@skate \
    --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