Re: [PATCH] selftests: vDSO: Do not rely on $ARCH for vdso_test_getrandom && vdso_test_chacha

Jason A. Donenfeld
2024-09-01T18:03:01Z

On Sun, Sep 01, 2024 at 08:00:30PM +0200, Christophe Leroy wrote:
> Hi Jason,
>
> Le 01/09/2024 à 15:22, Jason A. Donenfeld a écrit :
> > Hi Christophe,
> >
> > Hmm, I'm not so sure I like this very much. I think it's important for
> > these tests to fail when an arch tries to hook up the function to the
> > vDSO, but it's still not exported for some reason. This also regresses
> > the ARCH=x86_64 vs ARCH=x86 thing, which SRCARCH fixes.
> >
> > What about, instead, something like below, replacing the other commit?
>
> I need to look at it in more details and perfom a test, but after first
> look I can't figure out how it would work.
>
> When I build selftests,
>
> to build 32 bits selftests I do:
>
> make ARCH=powerpc CROSS_COMPILE=ppc-linux-
>
> to build a 64 bits BE selftests I do:
>
> make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-
>
> to build a 64 bits LE selftests I do:
>
> make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-
>
>
> I addition, in case someone does the build on a native platform directly,
>
> On 32 bits, uname -m returns 'ppc'
> On 64 bits, uname -m returns 'ppc64'
> On 64 bits little endian, uname -m returns 'ppc64le'
>
> How would this fit in the logic where IIUC you just remove '_64' from
> 'x86_64' to get 'x86'

Huh? That's not what tools/scripts/Makefile.arch does.