linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: <linuxppc-dev@ozlabs.org>, Anton Blanchard <anton@samba.org>,
	<imunsie@au.ibm.com>
Subject: Re: [PATCH] powerpc/Makefile: Use cflags-y/aflags-y for setting endian options
Date: Wed, 10 Aug 2016 00:36:58 +1000	[thread overview]
Message-ID: <20160810003658.527c34e0@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <1470746626-1989-1-git-send-email-mpe@ellerman.id.au>

On Tue,  9 Aug 2016 22:43:46 +1000
Michael Ellerman <mpe@ellerman.id.au> wrote:

> When we introduced the little endian support, we added the endian flags
> to CC directly using override. I don't know the history of why we did
> that, I suspect no one does.
> 
> Although this mostly works, it has one bug, which is that CROSS32CC
> doesn't get -mbig-endian. That means when the compiler is little endian
> by default and the user is building big endian, vdso32 is incorrectly
> compiled as little endian and the kernel fails to build.
> 
> Instead we can add the endian flags to cflags-y/aflags-y, and then
> append those to KBUILD_CFLAGS/KBUILD_AFLAGS.
> 
> This has the advantage of being 1) less ugly, 2) the documented way of
> adding flags in the arch Makefile and 3) it fixes building vdso32 with a
> LE toolchain.

This seems okay to me.

> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  arch/powerpc/Makefile | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index ca254546cd05..1934707bf321 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -66,29 +66,28 @@ endif
>  UTS_MACHINE := $(OLDARCH)
>  
>  ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
> -override CC	+= -mlittle-endian
> -ifneq ($(cc-name),clang)
> -override CC	+= -mno-strict-align
> -endif
> -override AS	+= -mlittle-endian
>  override LD	+= -EL
> -override CROSS32CC += -mlittle-endian
>  override CROSS32AS += -mlittle-endian

Can't we get rid of CROSS32AS? If not, then should it get the
-mbig-endian override?

Thanks,
Nick

  reply	other threads:[~2016-08-09 14:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 12:43 [PATCH] powerpc/Makefile: Use cflags-y/aflags-y for setting endian options Michael Ellerman
2016-08-09 14:36 ` Nicholas Piggin [this message]
2016-08-10  5:20   ` Michael Ellerman
2016-08-11 11:16 ` Michael Ellerman

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=20160810003658.527c34e0@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=anton@samba.org \
    --cc=imunsie@au.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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;
as well as URLs for NNTP newsgroup(s).