Re: [PATCH] compiler-gcc: get back Clang build
From: Dominique Martinet
Date: Wed Aug 22 2018 - 00:17:09 EST
Nick Desaulniers wrote on Tue, Aug 21, 2018:
> On Tue, Aug 21, 2018 at 9:45 AM Joe Perches <joe@xxxxxxxxxxx> wrote:
> > > Tested with gcc-7 and clang-8.
> >
> > clang-8? Isn't the latest officlal clang 6.0.1 ?
> [...]
> > So if something other than 6.0.x is required,
> > then some additional check should probably be
> > added to compiler-clang.h as well.
>
> Sure, but that doesn't need to go in Mashiro's patch today. That can
> wait for a proper separation between compiler headers where we can
> then implement improved version checks.
I can confirm that the patch here works for me with clang 6.0.1 as far
as bpf programs are concerned (and gcc 8.1.1 for the kernel build itself
on x86 while I was at it); so at least there is nothing on the
compiler*.h headers that put off clang 6.0.1
(also replying to other subthread)
>From Joe Perches @ 2018-08-21 17:22 UTC:
> The question remains, if clang can't compile
> v4.17, why does it immediately matter for v4.19?
I haven't had any problem with clang and 4.17 as far as building bpf
programs is concerned, because the CC_HAVE_ASM_GOTO check is done in
makefiles that aren't used in the bpf case and not in compiler-gcc.h
or another header.
So I guess the "immediately matters for v4.19" depends on how much you
would care about bcc-compiled BPF programs.
> Why wouldn't overriding the clang __GNUC_<foo>
> #defines in compiler-gcc.h work acceptably with
> adding whatever is necessary to compiler-clang.h?
I think that could work, but at the point making a separate
compiler-common.h and not including compiler-gcc.h for clang sounds
better to me... More importantly here, either solution sound complex
enough to require more than a few days and proper testing for all archs
etc when compared to the partial revert we have here.
--
Dominique Martinet