Re: [PATCH 3/4] kbuild: link of vmlinux moved to a script

From: Michal Marek
Date: Thu May 10 2012 - 08:22:12 EST


On Wed, May 09, 2012 at 06:58:16PM -0400, Paul Gortmaker wrote:
> On Tue, May 8, 2012 at 12:51 PM, Sam Ravnborg <sam@xxxxxxxxxxxx> wrote:
> > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> > index 26c5b65..1f4c27b 100644
> > --- a/scripts/link-vmlinux.sh
> > +++ b/scripts/link-vmlinux.sh
> > @@ -78,8 +78,8 @@ kallsyms()
> >                kallsymopt=--all-symbols
> >        fi
> >
> > -       local aflags="${KBUILD_AFLAGS} ${NOSTDINC_FLAGS}                     \
> > -                     ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
> > +       local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL}               \
> > +                     ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
>
> All the linux-next builds for mips are failing, which I tracked down to this.
> Applying the above update doesn't help. What is happening is that MIPS
> gets KBUILD_CPPFLAGS double-quoted, and then you get:
>
> + mips-wrs-linux-gnu-nm -n .tmp_vmlinux1
> + scripts/kallsyms
> + mips-wrs-linux-gnu-gcc -D__ASSEMBLY__ <..snip..> -D__KERNEL__
> '-D"VMLINUX_LOAD_ADDRESS=0xffffffff81100000"' '-D"DATAOFFSET=0"' -c -o
> .tmp_kallsyms1.o -x assembler-with-cpp -
> <command-line>:0: error: macro names must be identifiers
> <command-line>:0: error: macro names must be identifiers
> make[1]: *** [vmlinux] Error 1
>
> Note the '-D"VMLINUX_LOAD_ADDRESS=0xffffffff81100000"' '-D"DATAOFFSET=0"'
> part -- that is what triggers the two above errors.

I think it should be as simple as the below patch. But I have no mips
machine to verify myself.

Michal