All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: clang-built-linux@googlegroups.com,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	linux-s390@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Philipp Rudo <prudo@linux.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/4] s390: boot, purgatory: pass $(CLANG_FLAGS) where needed
Date: Mon, 15 Apr 2019 10:35:52 +0200	[thread overview]
Message-ID: <20190415083605.2560074-2-arnd@arndb.de> (raw)
In-Reply-To: <20190415083605.2560074-1-arnd@arndb.de>

The purgatory and boot Makefiles do 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.

Add $(CLANG_FLAGS) everywhere so we pass the correct --target=s390x-linux
option when cross-compiling.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/s390/Makefile           | 4 ++--
 arch/s390/purgatory/Makefile | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 9c079a506325..9a228786e34f 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -17,9 +17,9 @@ KBUILD_CFLAGS_MODULE += -fPIC
 KBUILD_AFLAGS	+= -m64
 KBUILD_CFLAGS	+= -m64
 aflags_dwarf	:= -Wa,-gdwarf-2
-KBUILD_AFLAGS_DECOMPRESSOR := -m64 -D__ASSEMBLY__
+KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__
 KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))
-KBUILD_CFLAGS_DECOMPRESSOR := -m64 -O2
+KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2
 KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
 KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float
 KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
index ce6a3f75065b..ecd0b3847fef 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 += $(CLANG_FLAGS)
 KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
 KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
 
-- 
2.20.0


  reply	other threads:[~2019-04-15  8:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15  8:35 [PATCH v2 1/4] s390: only build for new CPUs with clang Arnd Bergmann
2019-04-15  8:35 ` Arnd Bergmann [this message]
2019-04-15 16:12   ` [PATCH v2 2/4] s390: boot, purgatory: pass $(CLANG_FLAGS) where needed Nathan Chancellor
2019-05-03 14:26     ` Heiko Carstens
2019-04-15  8:35 ` [PATCH v2 3/4] s390: drop CONFIG_VIRT_TO_BUS Arnd Bergmann
2019-05-03 14:26   ` Heiko Carstens
2019-04-15  8:35 ` [PATCH v2 4/4] s390: fix clang -Wpointer-sign warnigns in boot code Arnd Bergmann
2019-04-22 17:51   ` Nick Desaulniers
2019-04-23  8:05     ` Arnd Bergmann
2019-04-23 18:21       ` Nick Desaulniers
2019-05-03 14:27   ` Heiko Carstens
2019-05-03 14:25 ` [PATCH v2 1/4] s390: only build for new CPUs with clang Heiko Carstens

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=20190415083605.2560074-2-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=gor@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=prudo@linux.ibm.com \
    --cc=schwidefsky@de.ibm.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 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.