From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
joe@perches.com, Kees Cook <keescook@chromium.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-sparse@vger.kernel.org, sparse@chrisli.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6")
Date: Mon, 10 Sep 2018 09:56:33 +0000 [thread overview]
Message-ID: <061b3056-1a9a-af6b-de2a-49fea394320d@c-s.fr> (raw)
In-Reply-To: <20180910092835.v5nex5nzfgtl475m@ltop.local>
On 09/10/2018 09:28 AM, Luc Van Oostenryck wrote:
> On Mon, Sep 10, 2018 at 08:49:07AM +0200, Christophe LEROY wrote:
>> Le 07/09/2018 à 20:19, Nick Desaulniers a écrit :
>>> On Fri, Sep 7, 2018 at 11:13 AM Luc Van Oostenryck wrote:
>>>>
>>>> Sparse expand these macros to the same version than the compiler used
>>>> to compile GCC. I find a bit strange though to have sparse v0.5.2 but
>>>> using an old compiler.
>>>
>>> So Christophe must have a version of gcc < 4.6 installed somewhere?
>>> Does sparse use `cc`? If so, Christophe, does your `ls -l $(which cc)`
>>> point to an old version of gcc maybe?
>>
>> Indeed it looks like sparse expand these macros to the version of
>> the compiler it was compiled with.
>>
>> I'm building kernels for a powerpc platforms, with CROSS_COMPILE set
>> to ppc-linux- and ppc-linux-gcc being version 5.4
>>
>> However my build machine is a CentOS6 and the native gcc has version
>> 4.4.7, so sparse expands that version.
>
> OK, I see.
>
>> Is there a way to get sparse in line with my cross compiler version
>> and not with the local native version ?
>
> When cross-compiling, there is also things like the machine word-size
> and the endianness to take in account (they also default to the
> native compiler used to compile sparse itself) as well as a few
> defines (like __PPC64__). To be in line with your cross-compiler
> you can use to the wrapper 'cgcc' (installed with sparse) and call
> it, for example, like this:
> $ export REAL_CC=ppc-linux-gcc
> $ cgcc -target=ppcc64 -D_CALL_ELF=2 -D__GCC__=5 -D__GCC_MINOR__=4 ...
> or, since this is for the kernel:
> $ export REAL_CC=ppc-linux-gcc
> $ make CHECK='cgcc -target=ppcc64 ...
>
>
> I think this should solve it. Do not hesitate to report any
> difficulties you may encounter.
# export REAL_CC=ppc-linux-gcc
# make CHECK="cgcc -target=ppc -D_CALL_ELF=2 -D__GCC__=5
-D__GCC_MINOR__=4" C=2 arch/powerpc/kernel/process.o
scripts/kconfig/conf --syncconfig Kconfig
#
# configuration written to .config
#
UPD include/config/kernel.release
UPD include/generated/utsrelease.h
CC kernel/bounds.s
CC arch/powerpc/kernel/asm-offsets.s
CALL scripts/checksyscalls.sh
CHECK scripts/mod/empty.c
Can't exec "/bin/sh": Argument list too long at /usr/local/bin/cgcc line 86.
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
Christophe
>
> -- Luc
>
next parent reply other threads:[~2018-09-10 9:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <81a5fd11-366c-0897-4143-d8d041420a41@c-s.fr>
[not found] ` <1324e7d6-83f8-f40f-ad34-c46e4ad3139b@c-s.fr>
[not found] ` <CAKwvOdmuXydQsQyD2CUyoSkkDpF1e1CXg6v1SRv2q-bpYa9SQg@mail.gmail.com>
[not found] ` <20180907181337.peyfq7yvhahduvmq@ltop.local>
[not found] ` <CAKwvOdmXs+pWJGXu-zr-XSu7p-7hw=2m1vVQmVLwJcmGEFz0gg@mail.gmail.com>
[not found] ` <e6db84f1-ee8d-9377-5f1c-6a0e7972ba50@c-s.fr>
[not found] ` <20180910092835.v5nex5nzfgtl475m@ltop.local>
2018-09-10 9:56 ` Christophe Leroy [this message]
2018-09-10 11:34 ` Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") Luc Van Oostenryck
2018-09-10 13:19 ` Christophe Leroy
2018-09-10 13:56 ` Luc Van Oostenryck
2018-09-10 14:05 ` Christophe LEROY
2018-09-10 15:15 ` Luc Van Oostenryck
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=061b3056-1a9a-af6b-de2a-49fea394320d@c-s.fr \
--to=christophe.leroy@c-s.fr \
--cc=joe@perches.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=ndesaulniers@google.com \
--cc=sparse@chrisli.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