Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6839601ybf; Fri, 6 Mar 2020 05:35:53 -0800 (PST) X-Google-Smtp-Source: ADFU+vtbEnGscJ4Hdxb9ySkQqInWcS7wyzqvouAd69Gujmb0nhnjeIioR7WN/fWh62d7GpaI0fxx X-Received: by 2002:a05:6808:618:: with SMTP id y24mr2504818oih.3.1583501753292; Fri, 06 Mar 2020 05:35:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583501753; cv=none; d=google.com; s=arc-20160816; b=KIvh0lVpd9z3kYaa4NSCKFuZfA/lygkb5IDDKT+ssE4UrhbJhq3AIM98DCbv5HQIJI bK9yWM2vVj8kKO7gOZbllGGhBNcS0SRg4Nn3RRmD4Rn7nSe+CfpIZovBCvIwOl15fxDN xI7qxpyQ1PrGORQCQ8yZRw/JeRL7RRXw0JjTG79VQBJnUVz7qUIQGL+cOc+8xMhYZvqW BIgPbZj6iHNuJthJXJ9efIwCzK4iK7DXvQLPJKyomSLwVlYjv7DCnMQvBvyk8HO+zlnF 8x02htccc4n1kw0mloySk+4tlqWFk3BU+hjg59hmf3azUid6z45APlCtxtJ2918BL3SR fOzA== 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=UWeE3rEh3mpdqtt6WBTDZh5KiWM5YPWG2cbq/WP2MBg=; b=tu6K3O1je7YIzyaVBiOgIGmlTkW66ehsvp/SBXLHPPjLKgTf5fR+moXEzaapaK4rl4 nSdoMuKJxbFUewo2e5oQwD4jBJ9MwSfSAhB480+fKuaySoGHwohoBB2XrdzSwc3JLTGs 0F9BmMMbqZdxxDrWn4bUfYjt0EWAoqqkmj7FRGsVftq4Q+vn4J+N1PiT0IkGVs36A360 uH9S3f0MVp4jvq3bnuDXGJL/n7+pHwwDpv6YSsNx11QIAPchFStyNy1LYvT3VmdkaDND r+i4N3Luzrjk2VthAjYhklp5tuIbMJ1h0AWG/wfLWvFei7lpYwCqj+wQNtnQUGsK6n91 EMGw== 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 q131si1266314oig.203.2020.03.06.05.35.40; Fri, 06 Mar 2020 05:35:53 -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; 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 S1727606AbgCFNd4 (ORCPT + 99 others); Fri, 6 Mar 2020 08:33:56 -0500 Received: from foss.arm.com ([217.140.110.172]:33924 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727581AbgCFNdy (ORCPT ); Fri, 6 Mar 2020 08:33:54 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 557BF1063; Fri, 6 Mar 2020 05:33:54 -0800 (PST) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 79F4A3F6CF; Fri, 6 Mar 2020 05:33:51 -0800 (PST) From: Vincenzo Frascino To: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, clang-built-linux@googlegroups.com, x86@kernel.org Cc: Vincenzo Frascino , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Paul Burton , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , Borislav Petkov , Stephen Boyd , Mark Salyzyn , Kees Cook , Peter Collingbourne , Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Nick Desaulniers , Will Deacon Subject: [PATCH v2 20/20] arm64: vdso32: Enable Clang Compilation Date: Fri, 6 Mar 2020 13:32:42 +0000 Message-Id: <20200306133242.26279-21-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306133242.26279-1-vincenzo.frascino@arm.com> References: <20200306133242.26279-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable Clang Compilation for the vdso32 library. Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Vincenzo Frascino --- arch/arm64/kernel/vdso32/Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index 04df57b43cb1..650cfc5757eb 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64/kernel/vdso32/Makefile @@ -10,7 +10,18 @@ include $(srctree)/lib/vdso/Makefile # Same as cc-*option, but using CC_COMPAT instead of CC ifeq ($(CONFIG_CC_IS_CLANG), y) -CC_COMPAT ?= $(CC) +COMPAT_GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE_COMPAT)elfedit)) +COMPAT_GCC_TOOLCHAIN := $(realpath $(COMPAT_GCC_TOOLCHAIN_DIR)/..) + +CLANG_CC_COMPAT := $(CC) +CLANG_CC_COMPAT += --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%)) +CLANG_CC_COMPAT += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR) +CLANG_CC_COMPAT += -no-integrated-as -Qunused-arguments +ifneq ($(COMPAT_GCC_TOOLCHAIN),) +CLANG_CC_COMPAT += --gcc-toolchain=$(COMPAT_GCC_TOOLCHAIN) +endif + +CC_COMPAT ?= $(CLANG_CC_COMPAT) else CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc endif -- 2.25.1