Re: Problems with arm64 compat vdso
From: Vincenzo Frascino
Date: Tue Sep 24 2019 - 16:40:28 EST
Hi Nick,
thanks for reporting this.
On 9/24/19 7:06 PM, Nick Desaulniers wrote:
> Hi Vincenzo,
> We also are having issues building the cross vDSO with Clang:
> https://github.com/ClangBuiltLinux/linux/issues/595
>
The initial implementation of vdso32 does not have support for Clang. I was
planning to add it with a second patch set but it seems requiring more work.
> It seems that `LINUXINCLUDE` in arch/arm64/kernel/vdso32/Makefile is including
> arm64 headers in the arm part of the vdso32 build, which causes Clang to error
> on the arm64 inline asm constraints being used in arm64.
>
> I think if the issue Will described is fixed, it will be simpler for us to fix
> the rest to get it to build w/ Clang.
>
> https://github.com/ClangBuiltLinux/linux/issues/595#issuecomment-509874891
> is the basis of such a patch.
>
I agree with you this issue needs to be solved once and for all, but I feel that
the solution is not straight forward. Next week I will post a fix to the problem
Will raised and then will start investigating a more long term solution.
> Clang ships with all backends on by default, and uses a `-target <triple>` to
> cross compile; so the idea of passing two cross compiler binaries for a compat
> vDSO build doesn't really apply to Clang.
>
My idea was to derivate the triple for clang from the compat cross compiler name
removing the final dash.
I have in my Makefile something on the lines:
CLANG_TRIPLE ?= $(CONFIG_CROSS_COMPILE_COMPAT_VDSO:"%-"=%)
...
COMPATCC := $(CC) --target=$(notdir $CLANG_TRIPLE)
--
Regards,
Vincenzo