Re: make test failed

[email protected] (Peter T. Breuer)
Newsgroups gmane.linux.enbd.general
Message-ID <[email protected]>
In article <[email protected]> you wrote:
> > I should have showed what the make command that the Makefile ran was (in
> > and among the ellipsis ...).  It was:
> > 
> > 
> >      VPATH="/home/oboe/ptb/lang/c/nbd/nbd-2.4.32/kernel/linux-2.6.x"; \
> >      cp -a "$VPATH" "/tmp/linux-2.6.x" && \
> >            cd "/tmp/linux-2.6.x/drivers/block"; \
> >      make -C "/usr/local/src/linux-2.6.8.1-uml" \
> >            -f "$VPATH/Makefile" \
> >            SUBDIRS="/tmp/linux-2.6.x/drivers/block/enbd" \
> >            KBUILD_VERBOSE=1 \
> >            CONFIG_BLK_DEV_ENBD=m \
> >            CONFIG_BLK_DEV_ENBD_IOCTL=m \
> >            CFLAGS_KERNEL=-I"$VPATH/include" \
> >            CFLAGS_MODULE=-I"$VPATH/include" \
> >            MODVERDIR="/tmp/linux-2.6.x/.tmp_versions" \
> >            VERSION="2" \
> >            PATCHLEVEL="6" \
> >            SUBLEVEL="8" \
> >            EXTRAVERSION=".1-SMP" \
> >            modules
> > 
> > which generates the .ko files in /tmp.
> > 
> 
> after a few test, i finally can say it's exactly this part of Makefile makes
> gcc to generate the erroneous obj file and consequently the incorrect enbd*.ko
> which has pissed me off during the past a few days. 
> especially, the blame goes to the "CFLAGS_MODULE". in the kernel Makefile,

> the value of "CFLAGS_MODULE" is same as "MODFLAG" which is defined as 
> "-DMODULE" and should be passed to gcc when compiling modules.
> but your assignment here override the default value of "CFLAGS_MODULE". so
> when gcc compiles the source files, the "-DMODULE" flag is missing, and the 
> conditional compilations need the "MODULE" macro are ignored or mis-understood
> and that's why i got those faulty modules in the last a few days.
> 
> i think you might consider to use 'CFLAGS+=-I"$VPATH/include"', instead of 
> 'CFLAGS_MODULE'. i've verified. it works.

That's very interesting . I think that would be correct (-DMODULE is
asserted here anyway, but I can certainly see that += would be more
correct that =, and I agree with it!).

Thank you.

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.