All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	clang-built-linux@googlegroups.com,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Philipp Rudo <prudo@linux.ibm.com>,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 03/12] s390: purgatory: pass --target option to clang
Date: Tue, 9 Apr 2019 09:30:49 -0700	[thread overview]
Message-ID: <20190409163049.GA2046@archlinux-i9> (raw)
In-Reply-To: <CAK8P3a39NqQOp+0=WYuWh0UmpH=kEFLKyymNYm8DH-0gx9XaaQ@mail.gmail.com>

On Tue, Apr 09, 2019 at 08:43:09AM +0200, Arnd Bergmann wrote:
> On Tue, Apr 9, 2019 at 12:03 AM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > On Mon, Apr 08, 2019 at 11:26:16PM +0200, Arnd Bergmann wrote:
> > > The purgatory Makefile does not inherit the original cflags,
> > > so clang falls back to the default target architecture when
> > > building it, typically this would be x86 when cross-compiling.
> > >
> > > Pass --target=s390x-linux to all compilers that understand
> > > this option.
> > >
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > ---
> > >  arch/s390/purgatory/Makefile | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
> > > index ce6a3f75065b..3a14b968cec3 100644
> > > --- a/arch/s390/purgatory/Makefile
> > > +++ b/arch/s390/purgatory/Makefile
> > > @@ -22,6 +22,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
> > >  KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
> > >  KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
> > >  KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
> > > +KBUILD_CFLAGS += $(call cc-option,--target=s390x-linux)
> > >  KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
> > >  KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
> > >
> > Would
> >
> > ifdef CONFIG_CC_IS_CLANG
> > KBUILD_CFLAGS += --target=s390x-linux
> > endif
> >
> > be a little clearer (and save a cc-option call)?
> 
> Fine with me as well. Actually I noticed later that we need the same
> thing for arch/s390/boot/Makefile and arch/s390/boot/compressed/Makefile
> in some form, so maybe we should drop this one for now and find
> a solution that works for all three of them. The boot stuff is the one
> patch I did not send, since I did not think I had a good solution there,
> just one that happened to make it build.
> 

It did just occur to me that we added the --target and --gcc-toolchain
flags to a clang specific variable, CLANG_FLAGS, that has already been
used by powerpc in commit 813af51f5d30 ("powerpc/boot: Set target when
cross-compiling for clang"). I assume that could be used here?

Nathan

> > Otherwise, makes sense.
> >
> > Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
> 
>  Thanks,
> 
>        Arnd

  reply	other threads:[~2019-04-09 16:30 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 21:26 [PATCH 01/12] s390: remove -fno-strength-reduce flag Arnd Bergmann
2019-04-08 21:26 ` [PATCH 02/12] s390: don't build vdso32 with clang Arnd Bergmann
2019-04-10 15:57   ` Martin Schwidefsky
2019-04-10 16:26   ` Nick Desaulniers
2019-04-10 19:00     ` Arnd Bergmann
2019-04-08 21:26 ` [PATCH 03/12] s390: purgatory: pass --target option to clang Arnd Bergmann
2019-04-08 22:03   ` Nathan Chancellor
2019-04-09  6:43     ` Arnd Bergmann
2019-04-09 16:30       ` Nathan Chancellor [this message]
2019-04-09 18:11         ` Nick Desaulniers
2019-04-08 21:26 ` [PATCH 04/12] s390: qeth: address type mismatch warning Arnd Bergmann
2019-04-08 22:16   ` Nathan Chancellor
2019-04-09  6:44     ` Arnd Bergmann
2019-04-10 15:58   ` Martin Schwidefsky
2019-04-08 21:26 ` [PATCH 05/12] s390: zcrypt: initialize variables before_use Arnd Bergmann
2019-04-08 22:31   ` Nathan Chancellor
2019-04-09  9:54   ` Harald Freudenberger
2019-04-09 10:13     ` Arnd Bergmann
2019-04-10 15:59     ` Martin Schwidefsky
2019-04-10 18:57       ` Arnd Bergmann
2019-04-11  7:40         ` Martin Schwidefsky
2019-04-08 21:26 ` [PATCH 06/12] s390: ctcm: fix ctcm_new_device error return code Arnd Bergmann
2019-04-08 22:33   ` Nathan Chancellor
2019-04-10 16:00   ` Martin Schwidefsky
2019-04-08 21:26 ` [PATCH 07/12] s390: cio: fix cio_irb declaration Arnd Bergmann
2019-04-08 22:35   ` Nathan Chancellor
2019-04-09 13:13   ` Sebastian Ott
2019-04-08 21:26 ` [PATCH 08/12] s390: syscall_wrapper: avoid clang warning Arnd Bergmann
2019-04-10 16:00   ` Martin Schwidefsky
2019-04-08 21:26 ` [PATCH 09/12] s390: make __load_psw_mask work with clang Arnd Bergmann
2019-04-10 16:01   ` Martin Schwidefsky
2019-04-08 21:26 ` [PATCH 10/12] s390: avoid __builtin_return_address(n) on clang Arnd Bergmann
2019-04-10 16:03   ` Martin Schwidefsky
2019-04-10 16:14     ` Steven Rostedt
2019-04-10 19:07       ` Arnd Bergmann
2019-04-11  7:32         ` Martin Schwidefsky
2019-04-08 21:26 ` [PATCH 11/12] s390: make chkbss work with clang Arnd Bergmann
2019-04-10 16:02   ` Martin Schwidefsky
2019-04-08 21:26 ` [PATCH 12/12] [PROBABLY WRONG] s390: void '0' constraint in inline assembly Arnd Bergmann
2019-04-10 13:55   ` Martin Schwidefsky
2019-04-10 16:35     ` Nick Desaulniers
2019-04-10 18:55     ` Arnd Bergmann
2019-04-10 15:57 ` [PATCH 01/12] s390: remove -fno-strength-reduce flag Martin Schwidefsky

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=20190409163049.GA2046@archlinux-i9 \
    --to=natechancellor@gmail.com \
    --cc=arnd@arndb.de \
    --cc=brueckner@linux.ibm.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=prudo@linux.ibm.com \
    --cc=schwidefsky@de.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.