From patchwork Tue Nov 6 03:04:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 993498 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pvgr2RgYz9sDN for ; Tue, 6 Nov 2018 14:10:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="QdrDij41"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42pvgr0WwNzF38F for ; Tue, 6 Nov 2018 14:10:48 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="QdrDij41"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=socionext.com (client-ip=210.131.2.76; helo=conuserg-09.nifty.com; envelope-from=yamada.masahiro@socionext.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="QdrDij41"; dkim-atps=neutral Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42pvb21RFNzF35w for ; Tue, 6 Nov 2018 14:06:37 +1100 (AEDT) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id wA635Mp1025438; Tue, 6 Nov 2018 12:05:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com wA635Mp1025438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1541473523; bh=xfZW3fJh1acenYkJWuEJ06iyiSzfKWNTaLxqo0qkZZA=; h=From:To:Cc:Subject:Date:From; b=QdrDij41X6HF14h2xn51gHLqkxucMzmu7z6kQOrmVUdeft3zgXFbshmAhRJKIwDhw YQjuaJM3EdbPvTHVK7YpqGLF79F/qek1ThvCV09Hd3ZWVq56ET/8Xq7Giz27jzYOr3 gL4N4uAZCPnv4K5lDgxGxPfDP8uRAr1i3ry4qur5xioF4SFoNjHa1Vmvdhjo+nd2yo rEUWrYCeJt5ZE8tFrB0ZjASK+zOpQiN53sUdF295o8VAGUkShQU7Nz5Z1PmutHKyNn HuEJ/OyAhiy8izNKsQ2wJOCp94X+96OhDsKRRG3FOauA2ENxhhBy9f7fNFBMaobxRc OMZo6fETXkX4Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Subject: [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally Date: Tue, 6 Nov 2018 12:04:54 +0900 Message-Id: <1541473495-25262-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Marek , Nick Desaulniers , linux-kernel@vger.kernel.org, Stefan Agner , Masahiro Yamada , Matthias Kaehlcke , Joel Stanley , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" We are still a way off the Clang's integrated assembler support for the kernel. Hence, -no-integrated-as is mandatory to build the kernel with Clang. If you had an ancient version of Clang that does not recognize this option, you would not be able to compile the kernel anyway. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers --- Changes in v2: - New patch Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 93315eb..da11700 100644 --- a/Makefile +++ b/Makefile @@ -497,8 +497,8 @@ CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) endif KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) -KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) -KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) +KBUILD_CFLAGS += -no-integrated-as +KBUILD_AFLAGS += -no-integrated-as endif RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register From patchwork Tue Nov 6 03:04:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 993497 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pvdD4XhGz9s4s for ; Tue, 6 Nov 2018 14:08:32 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="bazDBYFf"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42pvdD2x2MzF36b for ; Tue, 6 Nov 2018 14:08:32 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="bazDBYFf"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=socionext.com (client-ip=210.131.2.76; helo=conuserg-09.nifty.com; envelope-from=yamada.masahiro@socionext.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="bazDBYFf"; dkim-atps=neutral Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42pvb16c6ZzF35n for ; Tue, 6 Nov 2018 14:06:37 +1100 (AEDT) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id wA635Mp2025438; Tue, 6 Nov 2018 12:05:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com wA635Mp2025438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1541473524; bh=1+BFxkaRJrjARU/GhxBmY3HEDiOtKleHWhuKBQ9VCEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bazDBYFf/fLxanBbDMmWZm0TVTNGgnIONdWRlQA2PS2kGPaamgVRgGYmeEfyqRYEb 6R1nNrYuVHJ6bVdGEBxyIp32WdqB5RyaT19n7QkMYpUCh0A2THp5iMvf6kjIA24sPm hUN7TSvYaoC0mFCIdXGGPgwoHIft96zYMa4KXQNgeDox2rXdwE8jDu/t8pzoS38P7p Mv1I9AGb17xpnMwI9jeZur+USMq9L1fxVOOWniR5SkE7WwY7oFHOzyTPGvg0dwRYfE yaZWT+SyH7nuaFSBLi0sqxSlJT4f75ZKAAlM9R+wwSDVjLAMmuPwCLmeBS/sNrx4bp wcWnVDLoaB2EQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Subject: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags Date: Tue, 6 Nov 2018 12:04:55 +0900 Message-Id: <1541473495-25262-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541473495-25262-1-git-send-email-yamada.masahiro@socionext.com> References: <1541473495-25262-1-git-send-email-yamada.masahiro@socionext.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Marek , Nick Desaulniers , linux-kernel@vger.kernel.org, Stefan Agner , Masahiro Yamada , Matthias Kaehlcke , Joel Stanley , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Collect basic Clang options such as --target, --prefix, --gcc-toolchain, -no-integrated-as into a single variable CLANG_FLAGS so that it can be easily reused in other parts of Makefile. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Acked-by: Greg Hackmann --- Changes in v2: - Use := flavor instead of = because $(CLANG_FLAGS) is expanded soon anyway Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index da11700..e173a73 100644 --- a/Makefile +++ b/Makefile @@ -487,18 +487,17 @@ endif ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) ifneq ($(CROSS_COMPILE),) -CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) +CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%)) GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD))) -CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR) +CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR) GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..) endif ifneq ($(GCC_TOOLCHAIN),) -CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) +CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN) endif -KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) -KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) -KBUILD_CFLAGS += -no-integrated-as -KBUILD_AFLAGS += -no-integrated-as +CLANG_FLAGS += -no-integrated-as +KBUILD_CFLAGS += $(CLANG_FLAGS) +KBUILD_AFLAGS += $(CLANG_FLAGS) endif RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register