Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp318663imu; Mon, 5 Nov 2018 01:10:13 -0800 (PST) X-Google-Smtp-Source: AJdET5cOEi+GI1mRP37G+VpIikARaeGbomS93euu+o8360pY18mTPe7hZpRIiVDyEIevwM9lYqOf X-Received: by 2002:a63:3c44:: with SMTP id i4mr19242082pgn.286.1541409013650; Mon, 05 Nov 2018 01:10:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541409013; cv=none; d=google.com; s=arc-20160816; b=qT01BV5VgXE1cTAbTXP0f6YcePADxRKscjzEEMJDXR58bujL6kRH/v+LLtScYrjmqf BcR9/tDk1knVpz9MgNthb7LskYwfHIqu2fJzqYULwWFta75UTF7SblhIqXP4+eLVCI0K 9u7G39GGia7bPMOTc1JSgnatEXGbyieohq5wHRuzUbquuUqDoZLrVTuK73yLdpwZqpHB GC6qoyG+5GcdnUByQzM7wSEApOpG/eUP3TyhspqxWaNERkkRoLflZMh194c9nU3SOecJ vwamHKUub4zeYlOeMBECozang5ASIZMfQQBs2J66r4uvBPHAEQS/3utdySXIWQ4Wd9vH ovTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=Qe+KkULrxlCZcJNfNGvzFG1C9YdiRj2CoJUjuqrmeXE=; b=KkY9coRWf7JhRrvSQrJ3wUP5uycMO3957JuWKu5md+VwXRb/v4njNBCJZ0faHkBwPo R30g3OsV3FvO8FY0UV/xmv6X0PwR83fwsL7xUwOjFbxK8YqXck0zdbafh81jtBS35uda xW1ucBew4pDExnGiIR2+gU48E3Qo0JKFKSu4jAsd/T8ePL8E1wvzdP6JqkbzI2seMTcV Wqk4ESdiXDqarfv7OaQeFRCulmZXPdsnGP8+eed4kYAo43SeibFbTYItsNYjeHq+FeBB Vjw5V7m/SjA84FT+VaokwsMl4zXpj2XARqHuuvefXPn5aD6EhfkU/O63QmFrUxLx7vOB bmag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=VsHHEIsL; 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 n7-v6si41341761plp.43.2018.11.05.01.09.59; Mon, 05 Nov 2018 01:10:13 -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=@agner.ch header.s=dkim header.b=VsHHEIsL; 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 S1728562AbeKES1z (ORCPT + 99 others); Mon, 5 Nov 2018 13:27:55 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:57292 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbeKES1y (ORCPT ); Mon, 5 Nov 2018 13:27:54 -0500 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 34C415C0A09; Mon, 5 Nov 2018 10:09:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1541408951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qe+KkULrxlCZcJNfNGvzFG1C9YdiRj2CoJUjuqrmeXE=; b=VsHHEIsLCOBYmNd57ZgUllDzjPWnwrH2EgZIBqGCyj6d3E0c9orPnw77jy1w2rhbrBTEI1 ArBN7Qg4LvmNa9WBCXvfTqnJB51Aaim+5b4UurbDxbyP3K8/mI+AiKi6Hcl6X9o56gvhly pF602Ho/6oG2g+avHtHLNhcStcF6eWw= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 05 Nov 2018 10:09:11 +0100 From: Stefan Agner To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Kees Cook , Nick Desaulniers , Matthias Kaehlcke , Chris Fries , Joel Stanley , Daniel Axtens , Michal Marek , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kbuild: consolidate Clang compiler flags In-Reply-To: <1541386099-13118-1-git-send-email-yamada.masahiro@socionext.com> References: <1541386099-13118-1-git-send-email-yamada.masahiro@socionext.com> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.11.2018 03:48, Masahiro Yamada wrote: > 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) So this will expand later now, is this ok? -- Stefan > 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