Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp56615imu; Sun, 4 Nov 2018 18:50:12 -0800 (PST) X-Google-Smtp-Source: AJdET5dHB+KSZiYDdtksG45/9CgiujSSPdo9KDmesOZQ3fiqrTgJOy5pDCW5xnwj0wkfkQJRqnzi X-Received: by 2002:a62:3384:: with SMTP id z126-v6mr20697679pfz.112.1541386211995; Sun, 04 Nov 2018 18:50:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541386211; cv=none; d=google.com; s=arc-20160816; b=EIBlwxHFoSZD/UZZids2FTpcYM2hH7IsL5Ugvxkk63fQFF3Z/lqa/CCOOWrm72mo99 RtUt6gR7FDaJRxYNujHb8wwBUImuTPkYn/lUwZUejweSU/o+sh9HKZEtVbFFLFo52Ghn EknkoZQ+EmXVkwqlHbUuIx81+z9QBGR7rdEb+Ps3Gox9VY65j54n8sGM/UKD+7jnGQzN fvzn3HDd7HpNFlAYxLBe3cbQIfuf34D1UGsbXzuLxKrXW0kIC8a9GD+n6rRl0GPuDpoy fQVnEFOJtzEbeMGf5Sq0HKYhfu6WCXi1U7mgfT1IU6eDawjAX8yHmhOEOUZ8L7YuFzur qfmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=ZNPtY1nokON8YRdoIZP15e0YeCWOC3ApGvYS4fHPVfc=; b=kY9/Qlrj+y0Zq34wHs9V4puSAQEAfsPHB6PdrDX6Nkhd0SwtV28Z9KYl3D02hlHxSa roHjZ9kQMqqesnFLu8V+pzw/YcCeSv4N+sQwEVnkWy9o0P2O+tqcEQmMikTgM5JbwRoj VZfIeRVEkEpFYQwyNP7M815DPQk7TskH8GT49SeiEmXsAQFkuryIDtnoudI8RmwwB1CK lEvYuGzY4eEUR7ywBSb+VNjyyGCiXdV9dQa75Gj0Zm/cQrFtMMNvrNoqrJScMtAwBTVN miwbVCzas1hAKWODrvm7QnDJq2W2rWRCY38wC8VNYAvBVHwCo94mAu/lhtXuCfbXnzzI 1eHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QGH7Kwim; 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 134-v6si42634342pfu.273.2018.11.04.18.49.53; Sun, 04 Nov 2018 18:50:11 -0800 (PST) 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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QGH7Kwim; 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 S1727795AbeKEMGy (ORCPT + 99 others); Mon, 5 Nov 2018 07:06:54 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:41736 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbeKEMGy (ORCPT ); Mon, 5 Nov 2018 07:06:54 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id wA52mU1V012868; Mon, 5 Nov 2018 11:48:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com wA52mU1V012868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1541386111; bh=ZNPtY1nokON8YRdoIZP15e0YeCWOC3ApGvYS4fHPVfc=; h=From:To:Cc:Subject:Date:From; b=QGH7KwimQO1PS9YhHzH7SndjlRYV7Iy10BdUWfP3FFNI8QioXzZHgB/TxDzisx98+ lJQO5g72bsEKj7w4X51Qgd2Py2B+Y39pF0L7Zb/3QO6T6pzERz1fVI8JW1yYVq20FK UP5zuMyqLKrhZjDhkbcAjWlkCUVIPktVLGOpYsH+2+SgJU0n3IUkxcFbSTRdr3juQI 3b0F6/OMqtTHj7o2XD9dZh0vkGbzY1PAIIqyW1nTdjGHr8zmWcb6VhQIYLXXqaXftS oqlKmHjuS0SQ7u/ueSsiPUtXDGcH6qjT1kEf/cnApt+FI5puyPZ5vhAPu5IKrE6ByW TCnN9/yIxQwUQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Kees Cook , Nick Desaulniers , Stefan Agner , Matthias Kaehlcke , Chris Fries , Joel Stanley , Daniel Axtens , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: consolidate Clang compiler flags Date: Mon, 5 Nov 2018 11:48:19 +0900 Message-Id: <1541386099-13118-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add basic options for Clang such as --target, --prefix, --gcc-toolchain, -no-integrated-as to a single variable CLANG_FLAGS. Signed-off-by: Masahiro Yamada --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 93315eb..58c838a 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 += $(call cc-option, -no-integrated-as) -KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) +CLANG_FLAGS += $(call cc-option, -no-integrated-as) +KBUILD_CFLAGS += $(CLANG_FLAGS) +KBUILD_AFLAGS += $(CLANG_FLAGS) endif RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register -- 2.7.4