* Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") @ 2018-09-07 12:22 Christophe Leroy 2018-09-07 14:33 ` Christophe LEROY 0 siblings, 1 reply; 14+ messages in thread From: Christophe Leroy @ 2018-09-07 12:22 UTC (permalink / raw) To: Joe Perches, Kees Cook, Nick Desaulniers; +Cc: linux-kernel Since commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6"), sparse check fails as follows: [root@pc16082vm linux-powerpc]# make C=2 arch/powerpc/kernel/process.o CALL scripts/checksyscalls.sh CHECK scripts/mod/empty.c ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too old - please upgrade it. CHECK arch/powerpc/kernel/process.c ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too old - please upgrade it. I have sparse version 0.5.2 What can be done to fix that ? Christophe ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-07 12:22 Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") Christophe Leroy @ 2018-09-07 14:33 ` Christophe LEROY 2018-09-07 17:22 ` Nick Desaulniers 0 siblings, 1 reply; 14+ messages in thread From: Christophe LEROY @ 2018-09-07 14:33 UTC (permalink / raw) To: Joe Perches, Kees Cook, Nick Desaulniers; +Cc: linux-kernel, linux-sparse Cc linux-sparse@vger.kernel.org Le 07/09/2018 à 14:22, Christophe Leroy a écrit : > Since commit cafa0010cd51f ("Raise the minimum required gcc version to > 4.6"), sparse check fails as follows: > > [root@pc16082vm linux-powerpc]# make C=2 arch/powerpc/kernel/process.o > CALL scripts/checksyscalls.sh > CHECK scripts/mod/empty.c > ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too > old - please upgrade it. > CHECK arch/powerpc/kernel/process.c > ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too > old - please upgrade it. > > > I have sparse version 0.5.2 > > What can be done to fix that ? > > Christophe ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-07 14:33 ` Christophe LEROY @ 2018-09-07 17:22 ` Nick Desaulniers 2018-09-07 18:13 ` Luc Van Oostenryck 0 siblings, 1 reply; 14+ messages in thread From: Nick Desaulniers @ 2018-09-07 17:22 UTC (permalink / raw) To: christophe.leroy; +Cc: joe, Kees Cook, LKML, linux-sparse, sparse On Fri, Sep 7, 2018 at 7:34 AM Christophe LEROY <christophe.leroy@c-s.fr> wrote: > > Cc linux-sparse@vger.kernel.org > > Le 07/09/2018 à 14:22, Christophe Leroy a écrit : > > Since commit cafa0010cd51f ("Raise the minimum required gcc version to > > 4.6"), sparse check fails as follows: > > > > [root@pc16082vm linux-powerpc]# make C=2 arch/powerpc/kernel/process.o > > CALL scripts/checksyscalls.sh > > CHECK scripts/mod/empty.c > > ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too > > old - please upgrade it. > > CHECK arch/powerpc/kernel/process.c > > ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too > > old - please upgrade it. > > > > > > I have sparse version 0.5.2 > > > > What can be done to fix that ? > > > > Christophe Oof, sorry Christophe. Looks like that's the latest version of sparse: https://sparse.wiki.kernel.org/index.php/Main_Page#News I'm curious what sparse expands __GNUC__, __GNUC_MINOR__, and __GNUC_PATCHLEVEL__ to? Pre commit cafa0010cd51f, it MUST be expanding them to something, otherwise you'd have seen the error then, too. The previous check was GCC < 3.3, now it's GCC < 4.6. We could change the check to: -#if GCC_VERSION < 40600 +#if GCC_VERSION < 40600 && !defined(__CHECKER__) But it would be good to know what those sub macros that compose GCC_VERSION evaluate to in sparse; maybe they can be upgraded in Sparse unless they're matching __builtin_*() compatability? -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-07 17:22 ` Nick Desaulniers @ 2018-09-07 18:13 ` Luc Van Oostenryck 2018-09-07 18:19 ` Nick Desaulniers 0 siblings, 1 reply; 14+ messages in thread From: Luc Van Oostenryck @ 2018-09-07 18:13 UTC (permalink / raw) To: Nick Desaulniers Cc: christophe.leroy, joe, Kees Cook, LKML, linux-sparse, sparse On Fri, Sep 07, 2018 at 10:22:56AM -0700, Nick Desaulniers wrote: > On Fri, Sep 7, 2018 at 7:34 AM Christophe LEROY <christophe.leroy@c-s.fr> wrote: > > > > Cc linux-sparse@vger.kernel.org > > > > Le 07/09/2018 à 14:22, Christophe Leroy a écrit : > > > Since commit cafa0010cd51f ("Raise the minimum required gcc version to > > > 4.6"), sparse check fails as follows: > > > > > > [root@pc16082vm linux-powerpc]# make C=2 arch/powerpc/kernel/process.o > > > CALL scripts/checksyscalls.sh > > > CHECK scripts/mod/empty.c > > > ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too > > > old - please upgrade it. > > > CHECK arch/powerpc/kernel/process.c > > > ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too > > > old - please upgrade it. > > > > > > > > > I have sparse version 0.5.2 > > > > > > What can be done to fix that ? > > > > > > Christophe > > Oof, sorry Christophe. Looks like that's the latest version of sparse: > https://sparse.wiki.kernel.org/index.php/Main_Page#News > > I'm curious what sparse expands __GNUC__, __GNUC_MINOR__, and > __GNUC_PATCHLEVEL__ to? Pre commit cafa0010cd51f, it MUST be > expanding them to something, otherwise you'd have seen the error then, > too. The previous check was GCC < 3.3, now it's GCC < 4.6. 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. Also, it's worth to look at what is said in this email: https://lore.kernel.org/lkml/CA+55aFzYEnZR2GZLR-DwpONjMNYGYoDy+6AWLCVNayWiaZuqoA@mail.gmail.com/ -- Luc ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-07 18:13 ` Luc Van Oostenryck @ 2018-09-07 18:19 ` Nick Desaulniers 2018-09-07 18:37 ` Luc Van Oostenryck 2018-09-10 6:49 ` Christophe LEROY 0 siblings, 2 replies; 14+ messages in thread From: Nick Desaulniers @ 2018-09-07 18:19 UTC (permalink / raw) To: Luc Van Oostenryck Cc: christophe.leroy, joe, Kees Cook, LKML, linux-sparse, sparse On Fri, Sep 7, 2018 at 11:13 AM Luc Van Oostenryck <luc.vanoostenryck@gmail.com> wrote: > > On Fri, Sep 07, 2018 at 10:22:56AM -0700, Nick Desaulniers wrote: > > On Fri, Sep 7, 2018 at 7:34 AM Christophe LEROY <christophe.leroy@c-s.fr> wrote: > > > > > > Cc linux-sparse@vger.kernel.org > > > > > > Le 07/09/2018 à 14:22, Christophe Leroy a écrit : > > > > Since commit cafa0010cd51f ("Raise the minimum required gcc version to > > > > 4.6"), sparse check fails as follows: > > > > > > > > [root@pc16082vm linux-powerpc]# make C=2 arch/powerpc/kernel/process.o > > > > CALL scripts/checksyscalls.sh > > > > CHECK scripts/mod/empty.c > > > > ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too > > > > old - please upgrade it. > > > > CHECK arch/powerpc/kernel/process.c > > > > ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too > > > > old - please upgrade it. > > > > > > > > > > > > I have sparse version 0.5.2 > > > > > > > > What can be done to fix that ? > > > > > > > > Christophe > > > > Oof, sorry Christophe. Looks like that's the latest version of sparse: > > https://sparse.wiki.kernel.org/index.php/Main_Page#News > > > > I'm curious what sparse expands __GNUC__, __GNUC_MINOR__, and > > __GNUC_PATCHLEVEL__ to? Pre commit cafa0010cd51f, it MUST be > > expanding them to something, otherwise you'd have seen the error then, > > too. The previous check was GCC < 3.3, now it's GCC < 4.6. > > 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? > > Also, it's worth to look at what is said in this email: > https://lore.kernel.org/lkml/CA+55aFzYEnZR2GZLR-DwpONjMNYGYoDy+6AWLCVNayWiaZuqoA@mail.gmail.com/ > > > -- Luc -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-07 18:19 ` Nick Desaulniers @ 2018-09-07 18:37 ` Luc Van Oostenryck 2018-09-10 6:49 ` Christophe LEROY 1 sibling, 0 replies; 14+ messages in thread From: Luc Van Oostenryck @ 2018-09-07 18:37 UTC (permalink / raw) To: Nick Desaulniers Cc: christophe.leroy, joe, Kees Cook, LKML, linux-sparse, sparse On Fri, Sep 07, 2018 at 11:19:43AM -0700, Nick Desaulniers wrote: > 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? It looks so. > Does sparse use `cc`? By default sparse use gcc (this can be overriden by using CC=...). -- Luc ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-07 18:19 ` Nick Desaulniers 2018-09-07 18:37 ` Luc Van Oostenryck @ 2018-09-10 6:49 ` Christophe LEROY 2018-09-10 9:28 ` Luc Van Oostenryck 1 sibling, 1 reply; 14+ messages in thread From: Christophe LEROY @ 2018-09-10 6:49 UTC (permalink / raw) To: Nick Desaulniers, Luc Van Oostenryck Cc: joe, Kees Cook, LKML, linux-sparse, sparse Le 07/09/2018 à 20:19, Nick Desaulniers a écrit : > On Fri, Sep 7, 2018 at 11:13 AM Luc Van Oostenryck > <luc.vanoostenryck@gmail.com> wrote: >> >> On Fri, Sep 07, 2018 at 10:22:56AM -0700, Nick Desaulniers wrote: >>> On Fri, Sep 7, 2018 at 7:34 AM Christophe LEROY <christophe.leroy@c-s.fr> wrote: >>>> >>>> Cc linux-sparse@vger.kernel.org >>>> >>>> Le 07/09/2018 à 14:22, Christophe Leroy a écrit : >>>>> Since commit cafa0010cd51f ("Raise the minimum required gcc version to >>>>> 4.6"), sparse check fails as follows: >>>>> >>>>> [root@pc16082vm linux-powerpc]# make C=2 arch/powerpc/kernel/process.o >>>>> CALL scripts/checksyscalls.sh >>>>> CHECK scripts/mod/empty.c >>>>> ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too >>>>> old - please upgrade it. >>>>> CHECK arch/powerpc/kernel/process.c >>>>> ./include/linux/compiler-gcc.h:14:3: error: Sorry, your compiler is too >>>>> old - please upgrade it. >>>>> >>>>> >>>>> I have sparse version 0.5.2 >>>>> >>>>> What can be done to fix that ? >>>>> >>>>> Christophe >>> >>> Oof, sorry Christophe. Looks like that's the latest version of sparse: >>> https://sparse.wiki.kernel.org/index.php/Main_Page#News >>> >>> I'm curious what sparse expands __GNUC__, __GNUC_MINOR__, and >>> __GNUC_PATCHLEVEL__ to? Pre commit cafa0010cd51f, it MUST be >>> expanding them to something, otherwise you'd have seen the error then, >>> too. The previous check was GCC < 3.3, now it's GCC < 4.6. >> >> 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. Is there a way to get sparse in line with my cross compiler version and not with the local native version ? Christophe > >> >> Also, it's worth to look at what is said in this email: >> https://lore.kernel.org/lkml/CA+55aFzYEnZR2GZLR-DwpONjMNYGYoDy+6AWLCVNayWiaZuqoA@mail.gmail.com/ >> >> >> -- Luc > > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-10 6:49 ` Christophe LEROY @ 2018-09-10 9:28 ` Luc Van Oostenryck 2018-09-10 9:56 ` Christophe Leroy 0 siblings, 1 reply; 14+ messages in thread From: Luc Van Oostenryck @ 2018-09-10 9:28 UTC (permalink / raw) To: Christophe LEROY Cc: Nick Desaulniers, joe, Kees Cook, LKML, linux-sparse, sparse 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. -- Luc ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-10 9:28 ` Luc Van Oostenryck @ 2018-09-10 9:56 ` Christophe Leroy 2018-09-10 11:34 ` Luc Van Oostenryck 0 siblings, 1 reply; 14+ messages in thread From: Christophe Leroy @ 2018-09-10 9:56 UTC (permalink / raw) To: Luc Van Oostenryck Cc: Nick Desaulniers, joe, Kees Cook, LKML, linux-sparse, sparse, linuxppc-dev 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 > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-10 9:56 ` Christophe Leroy @ 2018-09-10 11:34 ` Luc Van Oostenryck 2018-09-10 13:19 ` Christophe Leroy 0 siblings, 1 reply; 14+ messages in thread From: Luc Van Oostenryck @ 2018-09-10 11:34 UTC (permalink / raw) To: Christophe Leroy Cc: Nick Desaulniers, joe, Kees Cook, LKML, linux-sparse, sparse, linuxppc-dev On Mon, Sep 10, 2018 at 09:56:33AM +0000, Christophe Leroy wrote: > > # 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 OK. Clearly nobody has ever used it so :( There is an infinite loop because cgcc use the env var CHECK to call sparse while kbuild use CHECK to call cgcc here. The following seems to work here. $ export REAL_CC=ppc-linux-gcc $ make CHECK="CHECK=sparse cgcc -target=ppc ... It's a bit kludgy, I admit. -- Luc ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-10 11:34 ` Luc Van Oostenryck @ 2018-09-10 13:19 ` Christophe Leroy 2018-09-10 13:56 ` Luc Van Oostenryck 0 siblings, 1 reply; 14+ messages in thread From: Christophe Leroy @ 2018-09-10 13:19 UTC (permalink / raw) To: Luc Van Oostenryck Cc: Nick Desaulniers, joe, Kees Cook, LKML, linux-sparse, sparse, linuxppc-dev On 09/10/2018 11:34 AM, Luc Van Oostenryck wrote: > On Mon, Sep 10, 2018 at 09:56:33AM +0000, Christophe Leroy wrote: >> >> # 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 > > OK. Clearly nobody has ever used it so :( > There is an infinite loop because cgcc use the env var CHECK > to call sparse while kbuild use CHECK to call cgcc here. > > The following seems to work here. > $ export REAL_CC=ppc-linux-gcc > $ make CHECK="CHECK=sparse cgcc -target=ppc ... Not yet ... [root@pc16082vm linux-powerpc]# export REAL_CC=ppc-linux-gcc [root@pc16082vm linux-powerpc]# make CHECK="CHECK=sparse cgcc -target=ppc -D_CALL_ELF=2 -D__GNUC__=5 -D__GNUC_MINOR__=4" C=2 arch/powerpc/kernel/process.o CALL scripts/checksyscalls.sh CHECK scripts/mod/empty.c <command-line>:0:0: warning: "__STDC__" redefined <built-in>: note: this is the location of the previous definition /opt/cldk-1.4.0/lib/gcc/ppc-linux/5.4.0/../../../../ppc-linux/lib/crt1.o:(.rodata+0x4): undefined reference to `main' collect2: error: ld returned 1 exit status make[2]: *** [scripts/mod/empty.o] Error 1 make[1]: *** [scripts/mod] Error 2 make: *** [scripts] Error 2 Christophe > > It's a bit kludgy, I admit. > > -- Luc > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-10 13:19 ` Christophe Leroy @ 2018-09-10 13:56 ` Luc Van Oostenryck 2018-09-10 14:05 ` Christophe LEROY 0 siblings, 1 reply; 14+ messages in thread From: Luc Van Oostenryck @ 2018-09-10 13:56 UTC (permalink / raw) To: Christophe Leroy Cc: Nick Desaulniers, joe, Kees Cook, LKML, linux-sparse, sparse, linuxppc-dev On Mon, Sep 10, 2018 at 01:19:07PM +0000, Christophe Leroy wrote: > > > On 09/10/2018 11:34 AM, Luc Van Oostenryck wrote: > > On Mon, Sep 10, 2018 at 09:56:33AM +0000, Christophe Leroy wrote: > > > > > > # 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 > > > > OK. Clearly nobody has ever used it so :( > > There is an infinite loop because cgcc use the env var CHECK > > to call sparse while kbuild use CHECK to call cgcc here. > > > > The following seems to work here. > > $ export REAL_CC=ppc-linux-gcc > > $ make CHECK="CHECK=sparse cgcc -target=ppc ... > > Not yet ... > > [root@pc16082vm linux-powerpc]# export REAL_CC=ppc-linux-gcc > [root@pc16082vm linux-powerpc]# make CHECK="CHECK=sparse cgcc > -target=ppc -D_CALL_ELF=2 -D__GNUC__=5 -D__GNUC_MINOR__=4" C=2 > arch/powerpc/kernel/process.o > CALL scripts/checksyscalls.sh > CHECK scripts/mod/empty.c > <command-line>:0:0: warning: "__STDC__" redefined > <built-in>: note: this is the location of the previous definition > /opt/cldk-1.4.0/lib/gcc/ppc-linux/5.4.0/../../../../ppc-linux/lib/crt1.o:(.rodata+0x4): > undefined reference to `main' > collect2: error: ld returned 1 exit status > make[2]: *** [scripts/mod/empty.o] Error 1 > make[1]: *** [scripts/mod] Error 2 > make: *** [scripts] Error 2 OK. Using cgcc creates more problems that it solves and this file scripts/mod/empty.c is weird. Dropping cgcc and simply giving the GCC version to sparse works for me here (the needed defines are given by arch/powerpc/Makefile) but for sure I don't have the same environment as you have: $ make CHECK="sparse -D__GNUC__=5 -D__GNUC_MINOR__=4" ... Bonne chance, -- Luc ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-10 13:56 ` Luc Van Oostenryck @ 2018-09-10 14:05 ` Christophe LEROY 2018-09-10 15:15 ` Luc Van Oostenryck 0 siblings, 1 reply; 14+ messages in thread From: Christophe LEROY @ 2018-09-10 14:05 UTC (permalink / raw) To: Luc Van Oostenryck Cc: Nick Desaulniers, joe, Kees Cook, LKML, linux-sparse, sparse, linuxppc-dev Le 10/09/2018 à 15:56, Luc Van Oostenryck a écrit : > On Mon, Sep 10, 2018 at 01:19:07PM +0000, Christophe Leroy wrote: >> >> >> On 09/10/2018 11:34 AM, Luc Van Oostenryck wrote: >>> On Mon, Sep 10, 2018 at 09:56:33AM +0000, Christophe Leroy wrote: >>>> >>>> # 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 >>> >>> OK. Clearly nobody has ever used it so :( >>> There is an infinite loop because cgcc use the env var CHECK >>> to call sparse while kbuild use CHECK to call cgcc here. >>> >>> The following seems to work here. >>> $ export REAL_CC=ppc-linux-gcc >>> $ make CHECK="CHECK=sparse cgcc -target=ppc ... >> >> Not yet ... >> >> [root@pc16082vm linux-powerpc]# export REAL_CC=ppc-linux-gcc >> [root@pc16082vm linux-powerpc]# make CHECK="CHECK=sparse cgcc >> -target=ppc -D_CALL_ELF=2 -D__GNUC__=5 -D__GNUC_MINOR__=4" C=2 >> arch/powerpc/kernel/process.o >> CALL scripts/checksyscalls.sh >> CHECK scripts/mod/empty.c >> <command-line>:0:0: warning: "__STDC__" redefined >> <built-in>: note: this is the location of the previous definition >> /opt/cldk-1.4.0/lib/gcc/ppc-linux/5.4.0/../../../../ppc-linux/lib/crt1.o:(.rodata+0x4): >> undefined reference to `main' >> collect2: error: ld returned 1 exit status >> make[2]: *** [scripts/mod/empty.o] Error 1 >> make[1]: *** [scripts/mod] Error 2 >> make: *** [scripts] Error 2 > > OK. Using cgcc creates more problems that it solves and this file > scripts/mod/empty.c is weird. > Dropping cgcc and simply giving the GCC version to sparse works for > me here (the needed defines are given by arch/powerpc/Makefile) but > for sure I don't have the same environment as you have: > $ make CHECK="sparse -D__GNUC__=5 -D__GNUC_MINOR__=4" ... This time it works, thanks for your help. Should we find a may to automate that in the Makefile when CROSS_COMPILE is defined ? > > Bonne chance, Merci Christophe ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") 2018-09-10 14:05 ` Christophe LEROY @ 2018-09-10 15:15 ` Luc Van Oostenryck 0 siblings, 0 replies; 14+ messages in thread From: Luc Van Oostenryck @ 2018-09-10 15:15 UTC (permalink / raw) To: Christophe LEROY Cc: Nick Desaulniers, joe, Kees Cook, LKML, linux-sparse, sparse, linuxppc-dev On Mon, Sep 10, 2018 at 04:05:34PM +0200, Christophe LEROY wrote: > > This time it works, thanks for your help. You're welcome. > Should we find a may to automate that in the Makefile when > CROSS_COMPILE is defined ? The situation here with an old gcc is really an oddity. I was instead thinking to update sparse so that it repports a GCC version of at least 4.6, maybe something even more recent. But maybe, yes, kbuild could pass GCC_VERSION to sparse so that both the compiler used and sparse will repport the same. I'll see. The problem is not tied to cross-compilation, though, just that sparse may be compiled with an older compiler. -- Luc ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2018-09-10 15:15 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-09-07 12:22 Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") Christophe Leroy 2018-09-07 14:33 ` Christophe LEROY 2018-09-07 17:22 ` Nick Desaulniers 2018-09-07 18:13 ` Luc Van Oostenryck 2018-09-07 18:19 ` Nick Desaulniers 2018-09-07 18:37 ` Luc Van Oostenryck 2018-09-10 6:49 ` Christophe LEROY 2018-09-10 9:28 ` Luc Van Oostenryck 2018-09-10 9:56 ` Christophe Leroy 2018-09-10 11:34 ` 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
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.