From patchwork Wed Apr 10 20:12:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 162041 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6619672jan; Wed, 10 Apr 2019 13:13:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBWTPaE05Tqa191XKsCXAFHuzp+eAuAJGC2d8+aDbYMgPiOYE2KTYwPT8oEhzGl2Js8pui X-Received: by 2002:a63:3dca:: with SMTP id k193mr41801100pga.146.1554927197062; Wed, 10 Apr 2019 13:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554927197; cv=none; d=google.com; s=arc-20160816; b=QMAraRVDXOHO+k3D/7ucchLXoOb7OfcUBOQMaZyh9o7wZOuh9UZsb1i1sps5vA3SxR E5L9ZyIUUf7TtxeODUI5VVp1vaXnaC5s3BcbtlkzDwwr2cyP5liYI/pHCf/hQDp/Osyn gt+NNyEiZrrHtj/oOFTYznZ8IWx0Qa++dZntJrJpr1eXjqkJjNmQiCsPpxwI9ZirI01d qfR4p1AE3XAhB8QE2aS2Dz2ihbR+hETpK7ZaeOUl5A1hITtGL7tTXP1nMZ5cpUkQDJ44 GLAH3UrC2Vd5+TwDsxe3zprz0xP2EeSMH7jnUh/Ku37B/Tsm7exHwKmP6qGoKbIxEMQA Kvxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=kPt2XsEyCbPmbn9i6ATxC31Z5Dt7T6jbUbdP6EqoOpg=; b=MqBKhTafPdopPIOorMI8lSsXODzlh9NhwE8c39D1N9iZXTwa4VlndQVj8PUUbAVOkL IpJM0nRmvyayhb1dISdaKKkRvieR+sOx11T8ZvHQk2yasRm4OxcGhDdX7xv6Z31S6zI/ VwMh1sW3iQkwNKYgBPJ6CC4yxF7xxmTkwz3fgY5EA+/HaLP2Amt9GVcl1LmD0WAuCBEs Vhwb3OJFhQEJI41eDqwwQV+h7SDEcsn8pyPV3K6vVS6slE9J4BrRZ/VGldODuawY+E8L Mqyly20FbyjzXZUKMiWYan8SgoD+wZmx4JgVg7G8CeEbWJ8xmkZK366vmIjq9MGfZC8y l1mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si31822718pgp.391.2019.04.10.13.13.16; Wed, 10 Apr 2019 13:13:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbfDJUNP (ORCPT + 31 others); Wed, 10 Apr 2019 16:13:15 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:36257 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfDJUNO (ORCPT ); Wed, 10 Apr 2019 16:13:14 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MlNYj-1gTSBm1LDx-00lmDM; Wed, 10 Apr 2019 22:13:03 +0200 From: Arnd Bergmann To: Martin Schwidefsky , Heiko Carstens , Vasily Gorbik Cc: clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , linux-s390@vger.kernel.org, Arnd Bergmann , Masahiro Yamada , Philipp Rudo , Tony Krowiak , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] s390: only build for new CPUs with clang Date: Wed, 10 Apr 2019 22:12:40 +0200 Message-Id: <20190410201300.3528984-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:YFRyT6qgQvR+qhv9mS8yRRrUceXDy65GVtgAlXxGmTGhW0mDZ+G sI/5jMlMr9MwxKef2jS8TKnJ35YjTPZiEl5+ul6LZtq5sYpgcpjtrdmOGN+kYg5Yf5+YfpG +w2AA30VLJNmhdTbBnuHrUJ4K5zwSGeU5ZShR3lWtHUZJuPOjblN5alLhDr6d0JDiD1uz6b GgBiBUG+OU4uh4bsgH7Bw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:jjrGWuM0PD8=:IlJsEhIuRgSxnbYHMlwwo0 nd30BGZEK74vNeQuI/ufq5rl1AIJohJA4P2XKvdQ3If1ZZRxy+o83hx+oe5yPPy4aO6I4HT5J TGjN/S6DQzQuoWZK9DdfL5p2+E8l/LloGpxH3pWhOLun0GQKmDswrA6fTPkatx7SIsDRC+sri /aUWngk3I9cxPYzZ7PAvhAZbYJf0zEIafKTbNGt9gZ1gYVjix660Q/9z6nzd01e3oP/mLnSEb FoApA+gTSBOjl//k6tyKnhb2JVzOVoNYZk+gkxqiKVxxdheSRvz2h55H4hzc5FZM8UwYqPCVK 330bxP+a9vKOTmY7+Df4z4v0zmczImwk2XZwFblLh4G9NGhPq+ryz6MTdUylJn+Nicy4h482c +T2ZX7WHUB2rZkU4sr7vn7EkMSEUdlcpiup3DT9U+JYoxCrJ4ntQC7nEYt36Krf3bXrbXy2T+ uGG8tCPkZ/GYb6W5hIQUl9KSl8turbEFevbh0G+F36XL9bD7ZYBBbQvyOooTHDPCpjcCMn6wG wxR0bd00C4O+jSm25UF5c2eu0joELQOK5wi1738vh2cjK9OZFvkYwDnL5tWPsFl4Ov3Ta33ow nUOkGf+CGuD/jRhS0EH8XyI1/MuAH+Ma4x/769f746b12wdDgdXkDEVBOi5PsJw4j/T/mQXiD jBRpEgRna3UtJwAcORKoCglo8oeBzTL5WUm3BA3dmdHhJgSpDijFbilRaVYj2TvTLEFStPWF4 O43oURSkRqt2BUOyJnElK/3e58ow1BEOZXPEwQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org llvm does does not understand -march=z9-109 and older target specifiers, so disable the respective Kconfig settings and the logic to make the boot code work on old systems when building with clang. Signed-off-by: Arnd Bergmann --- arch/s390/Kconfig | 6 ++++++ arch/s390/boot/Makefile | 2 ++ 2 files changed, 8 insertions(+) -- 2.20.0 diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 8cd860cba4d1..1a2eec61196d 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -240,6 +240,7 @@ choice config MARCH_Z900 bool "IBM zSeries model z800 and z900" + depends on !CC_IS_CLANG select HAVE_MARCH_Z900_FEATURES help Select this to enable optimizations for model z800/z900 (2064 and @@ -248,6 +249,7 @@ config MARCH_Z900 config MARCH_Z990 bool "IBM zSeries model z890 and z990" + depends on !CC_IS_CLANG select HAVE_MARCH_Z990_FEATURES help Select this to enable optimizations for model z890/z990 (2084 and @@ -256,6 +258,7 @@ config MARCH_Z990 config MARCH_Z9_109 bool "IBM System z9" + depends on !CC_IS_CLANG select HAVE_MARCH_Z9_109_FEATURES help Select this to enable optimizations for IBM System z9 (2094 and @@ -347,12 +350,15 @@ config TUNE_DEFAULT config TUNE_Z900 bool "IBM zSeries model z800 and z900" + depends on !CC_IS_CLANG config TUNE_Z990 bool "IBM zSeries model z890 and z990" + depends on !CC_IS_CLANG config TUNE_Z9_109 bool "IBM System z9" + depends on !CC_IS_CLANG config TUNE_Z10 bool "IBM System z10" diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile index c844eaf24ed7..953a74d04990 100644 --- a/arch/s390/boot/Makefile +++ b/arch/s390/boot/Makefile @@ -11,6 +11,7 @@ KASAN_SANITIZE := n KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR) KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR) +ifndef CONFIG_CC_IS_CLANG # # Use -march=z900 for als.c to be able to print an error # message if the kernel is started on a machine which is too old @@ -25,6 +26,7 @@ CFLAGS_als.o += -march=z900 CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH) CFLAGS_sclp_early_core.o += -march=z900 endif +endif CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char From patchwork Wed Apr 10 20:12:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 162042 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6620145jan; Wed, 10 Apr 2019 13:13:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHB0Kmhvv/XebXiMYTd/kHti1cPWe2QatbhCRFqA+xOJo6Flpv9cNhMOw2anRpbNlL7DFG X-Received: by 2002:a17:902:b181:: with SMTP id s1mr37854062plr.9.1554927231416; Wed, 10 Apr 2019 13:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554927231; cv=none; d=google.com; s=arc-20160816; b=wraY5FFQqQ944AJTML74+tkfHhIh3Oc81jAr5MC6Xa1ETRpOtzG9/3pr5VWaRIReXC m/qPftwOSLeuypER1nP1j51H7BmHM3OWOQQjdhBJcxQvUf6DC2B8ybkqnVIuwFZSh+bH ZtfnqVeFSs4bf04YTBEL+bkBGhErkUEqcvcQLxTkhjKJFffvC463egaTTPDQ+rRsRhRL wtwaIKoTl8GEuWjKFuvhihHrgvRtqnVOOjn5ZXiyWdzwFZUZvA9gX9Y2OtzJQ5ZA7YvO qcofBgeb01yqWLnhU1CGoqqAKiPfWnf3D36kZrTOkfePsMX9guY8XMLgHmEKY0Y/Bsx5 oKwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5g1DWVatnW4H0J2yTD/NSWN3K/rlJUgtqkzzvYpZHgg=; b=nEZeBliL7Wd8dv1vtOAo1+71yWOt/6FnV2EWS6L3ZvODxxYprwRRFXAIt2XMtGbbF7 9NLKup8NPQvlHNPU+Nw3FY3x2XYNWD3zvQaUH/UJwnCxUlYrlBKXI7YCw1niJZcm9oXO 6y+RRNDcxRI2T8ciWlKYaPSq4ZFj3/cIcc2f4B3syBcH958H8cbGYLe6/7U082UhYRQF EV5RgXALuIyxdGICUQKJgAyVvNNuyFnzA20WrSNYvsjmDCJMQKR854Jxtwf9Bm37bX0q AilIgu7WPNXD0agi/nBQUfdja0q4SJypqKOooHJ+9s8lFkHZwkwyT2aPE9j3vyCEaBQ0 1IVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si31822718pgp.391.2019.04.10.13.13.51; Wed, 10 Apr 2019 13:13:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbfDJUNt (ORCPT + 31 others); Wed, 10 Apr 2019 16:13:49 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:45625 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbfDJUNt (ORCPT ); Wed, 10 Apr 2019 16:13:49 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1N5VXu-1gpg003t0s-016zjP; Wed, 10 Apr 2019 22:13:31 +0200 From: Arnd Bergmann To: Martin Schwidefsky , Heiko Carstens Cc: clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , linux-s390@vger.kernel.org, Arnd Bergmann , Vasily Gorbik , Masahiro Yamada , Philipp Rudo , Hendrik Brueckner , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] s390: boot, purgatory: pass $(CLANG_FLAGS) where needed Date: Wed, 10 Apr 2019 22:12:41 +0200 Message-Id: <20190410201300.3528984-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190410201300.3528984-1-arnd@arndb.de> References: <20190410201300.3528984-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:4kHQTeoWEX/56QzZgzt6tTms3ph0CUQzW12FyBpIJ84Jni675FW mkF2HJNWcb3v4VnA4F4MbSMOq+NKxTPxXKT0vsTiAjes3gXvv+p8AQYf/Zj914inJsaBWow yREn8pFQ02wO0h47ZB1jQWXjQ4YpXpkJmiXvbdmO9MG44t7uPrGZy5XwomUCCXIAhfgw6dZ a1632lEmWnIptJ67ouu/g== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:7aGoQfQ823Y=:jfhcrSH+xbvajbrWaPWoEY pXJIfaeXHxA9yJGCDGLzJ+826OU8w2sM4h6Ak9A3o+aTZa+t1l+vlr++jLbADMBmeVxAK5W/k biFpWKa6RyBLarlfct8txKj+tdFQfFx2OI4iFDD1Os0bEEHsM8tBCZQijaDel7++B79zXt5Et jxlB8Kfn87+CbQR0KVe2kabP/RflSAhOBSNhlSXN1CuChkSaa4dyt256WSBhreINVwRWMhF05 J4fEhXDntkeNlNoNGUjtye9/IwBiIe3LkQzG2ZsfruiB2Q+lvQsiDaC478ETH1reFyFFBX2ZX x6mmWjThpacJxJmbqSiR6xXK8krFraKcJgZuCO2Zz/BE86X7r4YkZQnnhcvTN14X0YpBTz1Gg XmT+SwBtU6x2jEU75lA1TUvkBvit1Ahpimm/WgH37R99L/c6nj6BM3ED/cp3zgnx+3zQ6TXjd SAL8wy85c5o7vTl+9RdMYvkWeZqjOFIb6bTsGhpdzfHOsauBTH8M7pMK8UuRAqY+XoLQ7JN6D YW8JXdHoSx91sR+D40UodZ169kLNGYiOdFHm4AQmyfnGuSqwSiiMonavaaIwSBcD50b5h11tB 2cRUoh+bfcyCkKyM/gtr6UCnPBgnqAXgAe24YP9cNQHLbHvaXmaDEiN5ptg42A6QdXkB29AbP F+mmCBkbCNOU9JIF2pkX8WrExBYjtGl3sfT4JlAsHMZ7+Ml5tWedAjS4IyHvk+Ac2lg0fN+jm JqWdkW1OX/jkAI9tuANctyTMBn05n4PP1v9Q4g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/s390/Makefile | 5 +++-- arch/s390/purgatory/Makefile | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.20.0 diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 9c079a506325..443990791099 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -17,12 +17,13 @@ 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 +KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning,pointer-sign) KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-option,-ffreestanding) KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g) KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,)) 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))