Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1868326ybh; Fri, 13 Mar 2020 08:47:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtrS98PXbls8SmreSWZLaZaz3FBhbkHwo8xMdiupcns4vXLeBvqOssj0quv5AKhYm/gACAj X-Received: by 2002:a9d:554a:: with SMTP id h10mr11067751oti.344.1584114456487; Fri, 13 Mar 2020 08:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584114456; cv=none; d=google.com; s=arc-20160816; b=Wv8E2z7D29DlwMGjwrfN7y9MCHo3OdMgjwA49P3ZD9gteOlNZl1a6LMsnfjDv6hXKI 1EAlwEG8y7tEG2jgbOt/3aqHjL7YrpxdJN+FMLzk01iiN+V8QmFVsepFGVKAYewcta8p QaNwZkZkxYliU5CLTfsKEOYNeS4Vsh2cj+CB3lJ6jqrh5HpjxyW7RTJoYmPoh9ewFxyW NtELClqF7RsVyYwMgs4zhJyNbushzu1rpyUvevbf49guCNygWrv+x12MGOXEo6BDMaMH Ez05PmLTU2u12yjGmK7smkP+2kStkNqRDF56GDc+MNHFnac6GRCRb79fJNDcCqUk29lP bW4w== 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=b7bhnkzbC+17OMzkqH/Ovke5K4m++EdAZbGrKRQ1p/4=; b=v56wqslafDul1zO45aXNCbnNJFLnK7sdXv9Jfvp4l1yc2u7b2H7Go60HtYAYn7ffLJ uoZBEkesDMDrcrfqxTwX8KF5sZf9oFjdE03mE72seUCtsiV3p+Kru6AqKcVTNCL5nK/P UackY5A9lg8LtaxyzLn7Mq0xVj0glx7rn6b7JfXRX8qhW4lOeJFth7zuavdM8t7/Ahmc 6iM/EEzCPsX2YONrU53FImIoeEmyd+povtgUDFJMX3oPyKSAIzCieiYOvQ0WhVUiEG5H d6i0ioSDpIyoh/jjmRxOvmCcRb+66J5ZQQUHvu8Jdtx9JVBnNsq+tjYJgcSRMpZaJejk oIyQ== 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 q197si2684233oic.262.2020.03.13.08.47.24; Fri, 13 Mar 2020 08:47:36 -0700 (PDT) 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 S1727507AbgCMPpf (ORCPT + 99 others); Fri, 13 Mar 2020 11:45:35 -0400 Received: from foss.arm.com ([217.140.110.172]:59164 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbgCMPpa (ORCPT ); Fri, 13 Mar 2020 11:45:30 -0400 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 ABF8CFEC; Fri, 13 Mar 2020 08:45:29 -0700 (PDT) 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 8127B3F67D; Fri, 13 Mar 2020 08:45:26 -0700 (PDT) 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 , Marc Zyngier , Mark Rutland , Will Deacon , Nathan Chancellor Subject: [PATCH v3 26/26] arm64: vdso32: Enable Clang Compilation Date: Fri, 13 Mar 2020 15:43:45 +0000 Message-Id: <20200313154345.56760-27-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200313154345.56760-1-vincenzo.frascino@arm.com> References: <20200313154345.56760-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 Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor # build Signed-off-by: Vincenzo Frascino --- arch/arm64/kernel/vdso32/Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index 04df57b43cb1..3964738ebbde 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) +COMPAT_GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE_COMPAT)elfedit)) +COMPAT_GCC_TOOLCHAIN := $(realpath $(COMPAT_GCC_TOOLCHAIN_DIR)/..) + +CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%)) +CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR) +CC_COMPAT_CLANG_FLAGS += -no-integrated-as -Qunused-arguments +ifneq ($(COMPAT_GCC_TOOLCHAIN),) +CC_COMPAT_CLANG_FLAGS += --gcc-toolchain=$(COMPAT_GCC_TOOLCHAIN) +endif + CC_COMPAT ?= $(CC) +CC_COMPAT += $(CC_COMPAT_CLANG_FLAGS) else CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc endif -- 2.25.1