Re: [PATCH v3 1/5] arm64: vdso32: Introduce COMPAT_CC_IS_GCC

From: Catalin Marinas
Date: Tue Oct 01 2019 - 11:31:01 EST


On Tue, Oct 01, 2019 at 03:43:54PM +0100, Will Deacon wrote:
> > >>>> On Thu, Sep 26, 2019 at 10:43:38PM +0100, Vincenzo Frascino wrote:
> > >>>>> +config COMPATCC_IS_ARM_GCC
> > >>>>> + def_bool $(success,$(COMPATCC) --version | head -n 1 | grep -q "arm-.*-gcc")
[...]
> My point was that we don't attempt to sanitise the compiler passed via
> CROSS_COMPILE, so I don't think we should do anything special for COMPATCC
> either.

What I really want from kbuild with this patch is:

1. Not to warn me that I don't have a CROSS_COMPILE_COMPAT set

2. Not to give me a compilation error if the makefile made up a COMPATCC
that doesn't work

Since we dropped the Kconfig option for the compat gcc prefix (which I
didn't like anyway), COMPATCC is now initialised to
(CROSS_COMPILE_COMPAT)gcc. This means that it is valid compiler (and
it's an aarch64 compiler on my machine). The COMPATCC_IS_ARM_GCC
silently disables the compat vDSO for this case rather than giving me a
build error if we don't have such checks.

In the long run, I wouldn't mandate CROSS_COMPILE_COMPAT to always be
set for the compat vDSO since with clang we could use the same compiler
binary for both native and compat (with different flags). That's once we
cleaned up the headers.

So, I think the best option for the time being is to check that the
compat compiler is an "arm*-gcc", otherwise disable the compat vDSO.

--
Catalin