linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Nicholas Piggin <npiggin@gmail.com>, linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	linuxppc-dev@lists.ozlabs.org,
	Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [PATCH v2 4/5] powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS
Date: Thu, 10 May 2018 23:03:08 +1000	[thread overview]
Message-ID: <878t8rzmr7.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20180510051659.15356-5-npiggin@gmail.com>

Nicholas Piggin <npiggin@gmail.com> writes:

> The powerpc toolchain can compile combinations of 32/64 bit and
> big/little endian, so it's convenient to consider, e.g.,
>
>   `CC -m64 -mbig-endian`
>
> To be the C compiler for the purpose of invoking it to build target
> artifacts. So overriding the the CC variable to include thse flags
> works for this purpose.
>
> Unfortunately that is not compatible with the way the proposed new
> Kconfig macro language will work.
>
> After previous patches in this series, these flags can be carefully
> passed in using flags instead.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>  arch/powerpc/Makefile   | 16 +++++++++-------
>  scripts/recordmcount.pl |  8 ++++++++

We should probably at least Cc Rostedt on the recordmcount.pl change.

> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
> index 191eb949d52c..919711dd9d6c 100755
> --- a/scripts/recordmcount.pl
> +++ b/scripts/recordmcount.pl
> @@ -274,6 +274,14 @@ if ($arch eq "x86_64") {

Despite what the above says you're patching the powerpc entry AFAICS, so
I guess that's pretty harmless.

>      if ($bits == 64) {
>  	$type = ".quad";
>      }
> +    $ld .= " -EB ";
> +    if ($endian eq "big") {
> +	    $cc .= " -mbig-endian ";
> +	    $ld .= " -EB ";

Don't we end up with two "-EB"s for the big endian case?

Or do I understand perl even less than I thought I did?

> +    } else {
> +	    $cc .= " -mlittle-endian ";
> +	    $ld .= " -EL ";
> +    }
>  
>  } elsif ($arch eq "arm") {
>      $alignment = 2;

cheers

  reply	other threads:[~2018-05-10 13:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10  5:16 [PATCH v2 0/5] kbuild and powerpc patches for new Kconfig language Nicholas Piggin
2018-05-10  5:16 ` [PATCH v2 1/5] powerpc/kbuild: set default generic machine type for 32-bit compile Nicholas Piggin
2018-05-10 13:10   ` Segher Boessenkool
2018-05-10 13:24     ` Nicholas Piggin
2018-05-10 14:29       ` Segher Boessenkool
2018-05-10 14:52   ` Segher Boessenkool
2018-05-10  5:16 ` [PATCH v2 2/5] powerpc/kbuild: remove CROSS32 defines from top level powerpc Makefile Nicholas Piggin
2018-05-10  5:16 ` [PATCH v2 3/5] kbuild: call cc-option with the current set of KBUILD_CFLAGS Nicholas Piggin
2018-05-10  5:29   ` Masahiro Yamada
2018-05-10  6:09     ` Nicholas Piggin
2018-05-10  5:16 ` [PATCH v2 4/5] powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS Nicholas Piggin
2018-05-10 13:03   ` Michael Ellerman [this message]
2018-05-10 13:11     ` Nicholas Piggin
2018-05-10  5:16 ` [PATCH v2 5/5] powerpc/kbuild: move -mprofile-kernel check to Kconfig Nicholas Piggin

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=878t8rzmr7.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /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).