linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Vincenzo Frascino <vincenzo.frascino@arm.com>
Subject: Re: [PATCH 3/3] arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd
Date: Mon, 18 Oct 2021 15:58:48 -0700	[thread overview]
Message-ID: <YW38KOA8ct12F7IG@archlinux-ax161> (raw)
In-Reply-To: <20211012234606.91717-4-ndesaulniers@google.com>

On Tue, Oct 12, 2021 at 04:46:06PM -0700, 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.

It might be nice to mention commit ef94340583ee ("arm64: vdso32: drop
-no-integrated-as flag") here, as that is what flipped on the integrated
assembler for this Makefile (and it cannot be turned off).

> 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
> 
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Modulo these two nits, this works for me too.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  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..7b28dad2fb80 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)" != ""

It works fine as is but it might be nice to add parentheses around the
new condition for ease of understanding.

>  	select GENERIC_COMPAT_VDSO
>  	default y
>  	help
> diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> index d24b12318f4c..376261d3791f 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
>  
> @@ -44,10 +41,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
> -- 
> 2.33.0.882.g93a45727a2-goog
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2021-10-18 23:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 23:46 [PATCH 0/3] compat vdso cleanups Nick Desaulniers
2021-10-12 23:46 ` [PATCH 1/3] arm64: vdso32: drop the test for dmb ishld Nick Desaulniers
2021-10-13  7:55   ` Arnd Bergmann
2021-10-13 17:24   ` Christian Biesinger
2021-10-12 23:46 ` [PATCH 2/3] arm64: vdso32: lazily invoke COMPAT_CC Nick Desaulniers
2021-10-13  3:02   ` Masahiro Yamada
2021-10-14 20:59     ` Nick Desaulniers
2021-10-16 14:19       ` Masahiro Yamada
2021-10-18 20:34         ` Nick Desaulniers
2021-10-12 23:46 ` [PATCH 3/3] arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd Nick Desaulniers
2021-10-18 22:58   ` Nathan Chancellor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YW38KOA8ct12F7IG@archlinux-ax161 \
    --to=nathan@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=ndesaulniers@google.com \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).