Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1296098pxb; Wed, 20 Oct 2021 02:09:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP1P120OpJ5raSVNxfhyKq4sYIyyZXFob4U3bELwNHfEoZ7n8Lm7GxzSBO7gkpP4KTNXPz X-Received: by 2002:a63:258:: with SMTP id 85mr32613482pgc.11.1634720956784; Wed, 20 Oct 2021 02:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634720956; cv=none; d=google.com; s=arc-20160816; b=i/jkbc7srLvSaMV/hM4j7gZ/TIJaDC28KEwxqJo7XUfz3Ay/7pc2KYYOblHBQ/m6WD myaL21Ozh77zOdQw0BKfDHMhyGMSmeiKo+9XVNoyXv5sWm4AFX7p+twqFJk+8rVxCCHZ //LnqkeFYRMJMyjbr8Dj1FaJKf5a8F+MYiESVWqkyKr1nILONt3zt+TShWaWXNYscbMy clFmJB4aMXb95MaTf9odQ74DXsITI7j2IpEUHVJ7Yy6SJV4/zX5YaCGCQbf3lPwdtz/E Y/lY2kAlYEKnEj2TIM9mt+quWo05dleYNAorHUjWA9/lFEazN68zb5e3h5/v5p2wPPBT tfGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=IlZ1tjeTtThrnX3oX9lNtNQIr1/DnyK0aBqUaA3SCY0=; b=vxu/Ulcl1ZpHiOViutSPKy3j9HoDYAENrHvz7T+QsfzcmbRZSsv1nhkGm9ghv2PMOU 6aYmf+hCCU6VeAG/uT5S7WYu6T4XSfazhss/Gq/eZjK8Kh+p9nXWc3vGwkBETWBmg1ri McE5EOPyQwE7dgC4xhbWAtmQfuRZA8/CCxgld16Dh6S2M/y5KQohojv+ftbzQuAx0H2G UvzomQcIucYjCBUprQ/iaDPe7OAkMhBWEVg64GH35BnTEuxtWoHzvI6def8wMC097AkT KWjk4wX3kuKvxR7EDZSYyel3NLH2hlwKEUTxNhluCOfNplw9CvqTA6IZhlUnZHTfOheJ FygA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 192si1926882pgb.613.2021.10.20.02.09.03; Wed, 20 Oct 2021 02:09:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229686AbhJTJKJ (ORCPT + 99 others); Wed, 20 Oct 2021 05:10:09 -0400 Received: from foss.arm.com ([217.140.110.172]:57806 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbhJTJKI (ORCPT ); Wed, 20 Oct 2021 05:10:08 -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 117F2ED1; Wed, 20 Oct 2021 02:07:54 -0700 (PDT) Received: from [10.57.74.74] (unknown [10.57.74.74]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B83A23F70D; Wed, 20 Oct 2021 02:07:51 -0700 (PDT) Subject: Re: [PATCH v2 4/4] arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd To: Nick Desaulniers , Catalin Marinas , Will Deacon Cc: llvm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nathan Chancellor References: <20211019223646.1146945-1-ndesaulniers@google.com> <20211019223646.1146945-5-ndesaulniers@google.com> From: Vincenzo Frascino Message-ID: <94eccd0b-ea36-25af-8140-fa6209a0b222@arm.com> Date: Wed, 20 Oct 2021 11:08:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20211019223646.1146945-5-ndesaulniers@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/20/21 12:36 AM, Nick Desaulniers wrote: > Similar to > commit 231ad7f409f1 ("Makefile: infer --target from ARCH for CC=clang") > There really is no point in setting --target based on > $CROSS_COMPILE_COMPAT for clang when the integrated assembler is being > used, since > commit ef94340583ee ("arm64: vdso32: drop -no-integrated-as flag"). > > Allows COMPAT_VDSO to be selected without setting $CROSS_COMPILE_COMPAT > when using clang and lld together. > > Before: > $ ARCH=arm64 CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make -j72 LLVM=1 defconfig > $ grep CONFIG_COMPAT_VDSO .config > CONFIG_COMPAT_VDSO=y > $ ARCH=arm64 make -j72 LLVM=1 defconfig > $ grep CONFIG_COMPAT_VDSO .config > $ > > After: > $ ARCH=arm64 CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make -j72 LLVM=1 defconfig > $ grep CONFIG_COMPAT_VDSO .config > CONFIG_COMPAT_VDSO=y > $ ARCH=arm64 make -j72 LLVM=1 defconfig > $ grep CONFIG_COMPAT_VDSO .config > CONFIG_COMPAT_VDSO=y > > Reviewed-by: Nathan Chancellor > Suggested-by: Nathan Chancellor > Tested-by: Nathan Chancellor > Signed-off-by: Nick Desaulniers Reviewed-by: Vincenzo Frascino > --- > Changes v1 -> v2: > * Cite ef94340583ee as per Nathan. > * Add parens to Kconfig expression as per Nathan. > * Pick up Nathan's RB, TB, and SB tags. > > arch/arm64/Kconfig | 3 ++- > arch/arm64/kernel/vdso32/Makefile | 17 +++++------------ > 2 files changed, 7 insertions(+), 13 deletions(-) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 5c7ae4c3954b..f0f2c95aa4c8 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -1264,7 +1264,8 @@ config KUSER_HELPERS > > config COMPAT_VDSO > bool "Enable vDSO for 32-bit applications" > - depends on !CPU_BIG_ENDIAN && "$(CROSS_COMPILE_COMPAT)" != "" > + depends on !CPU_BIG_ENDIAN > + depends on (CC_IS_CLANG && LD_IS_LLD) || "$(CROSS_COMPILE_COMPAT)" != "" > select GENERIC_COMPAT_VDSO > default y > help > diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile > index e478cebb9891..c8fec493a450 100644 > --- a/arch/arm64/kernel/vdso32/Makefile > +++ b/arch/arm64/kernel/vdso32/Makefile > @@ -10,18 +10,15 @@ include $(srctree)/lib/vdso/Makefile > > # Same as cc-*option, but using CC_COMPAT instead of CC > ifeq ($(CONFIG_CC_IS_CLANG), y) > -CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%)) > - > CC_COMPAT ?= $(CC) > -CC_COMPAT += $(CC_COMPAT_CLANG_FLAGS) > - > -ifneq ($(LLVM),) > -LD_COMPAT ?= $(LD) > +CC_COMPAT += --target=arm-linux-gnueabi > else > -LD_COMPAT ?= $(CROSS_COMPILE_COMPAT)ld > +CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc > endif > + > +ifeq ($(CONFIG_LD_IS_LLD), y) > +LD_COMPAT ?= $(LD) > else > -CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc > LD_COMPAT ?= $(CROSS_COMPILE_COMPAT)ld > endif > > @@ -45,10 +42,6 @@ VDSO_CPPFLAGS += $(LINUXINCLUDE) > # Common C and assembly flags > # From top-level Makefile > VDSO_CAFLAGS := $(VDSO_CPPFLAGS) > -ifneq ($(shell $(CC_COMPAT) --version 2>&1 | head -n 1 | grep clang),) > -VDSO_CAFLAGS += --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%)) > -endif > - > VDSO_CAFLAGS += $(call cc32-option,-fno-PIE) > ifdef CONFIG_DEBUG_INFO > VDSO_CAFLAGS += -g > -- Regards, Vincenzo