From patchwork Mon Nov 5 02:48:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 150131 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2094143ljp; Sun, 4 Nov 2018 18:49:33 -0800 (PST) X-Google-Smtp-Source: AJdET5crFQ/ZfgFolUTjnPQzW1SyS13O6WFJzjBseAef7d5QIOKNe5R/nhf+XqoaofuNXpmCet4f X-Received: by 2002:a17:902:8a8e:: with SMTP id p14-v6mr4400840plo.133.1541386173584; Sun, 04 Nov 2018 18:49:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541386173; cv=none; d=google.com; s=arc-20160816; b=H5CFRGjKZMOfWWNY81uNJGy2dnivUsCJFdXu+9mXuPELoOS3dc7gRRa2LYizIOzLTM +I8p+8SMmAmp9cwykGX63hqsvY8qk+cDMti3rmaqAMHAEzjWTUd7+AEcnqfKN5R2hSPV z4WOYRdUME6Dn+b3Dt7ij4krAqWCASogmWYgdWRkkXRWM+dcnFMfZdHgWxsCGKmAu2Li 6ZUEL4ZCJ1YrM8y3QAxcD1ZWHZnCh+M2V9vtnnNFVW48hsynrWvmqweCqsP2pPJ7700I ywoh6JuegaEpYsen41jndsnJPPl/e95t7/LHEtJZNj1y9E1OwMq1gEVphR4GubRTiLTB Kakw== 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 ay8-v6si39861796plb.235.2018.11.04.18.49.33; Sun, 04 Nov 2018 18:49:33 -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 S1728280AbeKEMGy (ORCPT + 32 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(-) -- 2.7.4 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