Skip to contentSkip to conversation

2.6.5-mm4

DISCUSSION Marcus Hartig 5 participants 9 messages Apr 12, 2004 – Apr 13, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello,

patch: "kbuild-external-module-support" ?

brakes nicely my nVidia driver for installation at stage 2. Happy easter gift. No setting of KBUILD_EXTMOD or editing the install script helps, nice job.

Sorry to say this, but I do not believe, that we get more support, if the Linux kernel breaks with every version all good drivers, also closed-source, but the best, fastest and stable 3D drivers you can get at this time. I hope it goes not in the stable line so soon.

Marcus

#1 lore raw

On Monday 12 April 2004 21:19, Marcus Hartig wrote:

Hi Marcus,

Quoted 1 line

patch: "kbuild-external-module-support" ?

actually, this one: "move-__this_module-to-modpost.patch" started breaking nvidia, but strangely not for all people. For me it worked fine (prior to 2.6.5-mm4), but other people got "invalid module format" after compiling nvidia driver and tried to load it. P.S.: kbuild-external-module-support breaks VMware too :p

Quoted 7 lines

brakes nicely my nVidia driver for installation at stage 2. Happy easter gift. No setting of KBUILD_EXTMOD or editing the install script helps, nice job.
Sorry to say this, but I do not believe, that we get more support, if the Linux kernel breaks with every version all good drivers, also closed-source, but the best, fastest and stable 3D drivers you can get at this time. I hope it goes not in the stable line so soon.

I hope it will go into mainline after the glitches are fixed up. The problem is, Andrew and friends need proper bug reports to fix these kind of things up asap. If no one speaks up about a problem, everyone expect its working fine for all, so go for it into mainline.

ciao, Marc

#2 lore raw
Quoted 11 lines · Marc-Christian Petersen

On Monday 12 April 2004 21:19, Marcus Hartig wrote:

Hi Marcus,

Quoted 1 line

patch: "kbuild-external-module-support" ?

actually, this one: "move-__this_module-to-modpost.patch" started breaking nvidia, but strangely not for all people. For me it worked fine (prior to 2.6.5-mm4), but other people got "invalid module format" after compiling nvidia driver and tried to load it. P.S.: kbuild-external-module-support breaks VMware too :p

Could I please get more info. I do not plan to install wmware right now, so at least some minimal information allowing me to realise why it no longer works.
Please with pointers to the used WMWare version so I can check their Makefile etc.

Sam

#3 lore raw
In reply to Marcus Hartig
Quoted 7 lines · Marcus Hartig

Hello,

patch: "kbuild-external-module-support" ?

brakes nicely my nVidia driver for installation at stage 2. Happy easter gift. No setting of KBUILD_EXTMOD or editing the install script helps, nice job.

Please provide me with more info.
I gooled a bit after some NVIDIA src - but I stopped when I had to accept some NVIDIA stuff.

The purpose is to provide good support for external modules. If it breaks things I need to find out why - and see where to fix it.

I would not be suprised if NVIDIA (and wmware for that matter) takes some assumptions which it should not. But I need to find out why it break, and for that I need more information!

So please provide me with the following information:
1) Exact log when it goes wrong
2) Pointer to or copy of the relevant files

Sam

#4 lore raw
Quoted 15 lines · Sam Ravnborg
Quoted 7 lines · Marcus Hartig

Hello,

patch: "kbuild-external-module-support" ?

brakes nicely my nVidia driver for installation at stage 2. Happy easter gift. No setting of KBUILD_EXTMOD or editing the install script helps, nice job.

Please provide me with more info.
I gooled a bit after some NVIDIA src - but I stopped when I had to accept some NVIDIA stuff.

The purpose is to provide good support for external modules. If it breaks things I need to find out why - and see where to fix it.

Quoted 8 lines

I would not be suprised if NVIDIA (and wmware for that matter) takes some assumptions which it should not. But I need to find out why it break, and for that I need more information!

So please provide me with the following information:
1) Exact log when it goes wrong
2) Pointer to or copy of the relevant files

I maintain the qla2xxx driver and have been noticing some build problems also. I typically do most compiling and editing of the driver outside of the kernel tree, i.e. my make command usually takes on the form:

	-bash-2.05b# make -C /usr/src/linux-2.6.5-mm3 SUBDIRS=$PWD modules
	make: Entering directory `/usr/src/linux-2.6.5-mm3'
	*** Warning: Overriding SUBDIRS on the command line can cause
	***          inconsistencies
	make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/ql2300.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/ql2300_fw.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_os.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_init.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_mbx.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_iocb.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_isr.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_gs.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_dbg.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_sup.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_rscn.o
	  LD [M]  /root/Drivers/8.x/80000b12-pre14/qla2xxx.o
	  LD [M]  /root/Drivers/8.x/80000b12-pre14/qla2300.o
	  Building modules, stage 2.
	  MODPOST
	*** Warning: "fc_release_transport"
	[/root/Drivers/8.x/80000b12-pre14/qla2xxx.ko] undefined!
	*** Warning: "fc_attach_transport"
	[/root/Drivers/8.x/80000b12-pre14/qla2xxx.ko] undefined!
	  CC      /root/Drivers/8.x/80000b12-pre14/qla2300.mod.o
	  LD [M]  /root/Drivers/8.x/80000b12-pre14/qla2300.ko
	  CC      /root/Drivers/8.x/80000b12-pre14/qla2xxx.mod.o

With 2.6.5-mm4 a similar command fails with:

	-bash-2.05b# make -C /usr/src/linux-2.6.5-mm4 SUBDIRS=$PWD modules
	make: Entering directory `/usr/src/linux-2.6.5-mm4'
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/ql2300.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/ql2300_fw.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_os.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_init.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_mbx.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_iocb.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_isr.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_gs.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_dbg.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_sup.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_rscn.o
	  LD [M]  /root/Drivers/8.x/80000b12-pre14/qla2xxx.o
	/bin/sh: line 1:
	/root/Drivers/8.x/80000b12-pre14/.tmp_versions/qla2xxx.mod: No such
	file or directory
	  LD [M]  /root/Drivers/8.x/80000b12-pre14/qla2300.o
	/bin/sh: line 1:
	/root/Drivers/8.x/80000b12-pre14/.tmp_versions/qla2300.mod: No such
	file or directory
	  HOSTCC  /root/Drivers/8.x/80000b12-pre14/extras/qla_nvr
	  Building modules, stage 2.
	make: Leaving directory `/usr/src/linux-2.6.5-mm4'

I've even tried the 'M=...' syntax documented in the Makefile:

	-bash-2.05b# make -C /usr/src/linux-2.6.5-mm4 M=$PWD modules
	make: Entering directory `/usr/src/linux-2.6.5-mm4'
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/ql2300.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/ql2300_fw.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_os.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_init.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_mbx.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_iocb.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_isr.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_gs.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_dbg.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_sup.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_rscn.o
	  LD [M]  /root/Drivers/8.x/80000b12-pre14/qla2xxx.o
	/bin/sh: line 1:
	/root/Drivers/8.x/80000b12-pre14/.tmp_versions/qla2xxx.mod: No such
	file or directory
	  LD [M]  /root/Drivers/8.x/80000b12-pre14/qla2300.o
	/bin/sh: line 1:
	/root/Drivers/8.x/80000b12-pre14/.tmp_versions/qla2300.mod: No such
	file or directory
	  HOSTCC  /root/Drivers/8.x/80000b12-pre14/extras/qla_nvr
	  Building modules, stage 2.
	make: Leaving directory `/usr/src/linux-2.6.5-mm4'

So, what am I missing? I can provide other logs if needed, just tell me what you need.

Thanks,
Andrew Vasquez
QLogic Corporation

#5 lore raw
Quoted 11 lines · Andrew Vasquez

With 2.6.5-mm4 a similar command fails with:

	-bash-2.05b# make -C /usr/src/linux-2.6.5-mm4 SUBDIRS=$PWD modules
	make: Entering directory `/usr/src/linux-2.6.5-mm4'
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/ql2300.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/ql2300_fw.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_os.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_init.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_mbx.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_iocb.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_isr.o
Quoted 8 lines
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_gs.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_dbg.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_sup.o
	  CC [M]  /root/Drivers/8.x/80000b12-pre14/qla_rscn.o
	  LD [M]  /root/Drivers/8.x/80000b12-pre14/qla2xxx.o
	/bin/sh: line 1:
	/root/Drivers/8.x/80000b12-pre14/.tmp_versions/qla2xxx.mod: No such
	file or directory

The external module support failed to create the directory:
$PWD/.tmp_version

It was no deleted during make clean either - thats why it slipped through. Here is a patch to fix it.

Sam

Makefile +13 -7
@@ -787,12 +787,6 @@ endef
 # make mrproper  Delete the current configuration, and all generated files
 # make distclean Remove editor backup files, patch leftover files and the like
 
-quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   $(wildcard $(rm-dirs)))
-      cmd_rmdirs = rm -rf $(rm-dirs)
-
-quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
-      cmd_rmfiles = rm -f $(rm-files)
-
 # Directories & files removed with 'make clean'
 CLEAN_DIRS  += $(MODVERDIR)
 CLEAN_FILES +=	vmlinux System.map kernel.spec \
@@ -951,9 +945,12 @@ else # KBUILD_EXTMOD
 
 # We are always building modules
 KBUILD_MODULES := 1
+.PHONY: crmodverdir
+crmodverdir: FORCE
+	$(Q)mkdir -p $(MODVERDIR)
 
 .PHONY: $(KBUILD_EXTMOD)
-$(KBUILD_EXTMOD): FORCE
+$(KBUILD_EXTMOD): crmodverdir FORCE
 	$(Q)$(MAKE) $(build)=$@
 
 .PHONY: modules
@@ -971,7 +968,9 @@ clean-dirs := _clean_$(KBUILD_EXTMOD)
 $(clean-dirs):
 	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 
+clean:	rm-dirs := $(MODVERDIR)
 clean: $(clean-dirs)
+	$(call cmd,rmdirs)
 	@find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \
 	 	\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
 		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
@@ -1058,6 +1057,13 @@ endif #ifeq ($(mixed-targets),1)
 # FIXME Should go into a make.lib or something 
 # ===========================================================================
 
+quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   $(wildcard $(rm-dirs)))
+      cmd_rmdirs = rm -rf $(rm-dirs)
+
+quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
+      cmd_rmfiles = rm -f $(rm-files)
+
+
 a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \
 	  $(NOSTDINC_FLAGS) $(CPPFLAGS) \
 	  $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
#6 lore raw
In reply to Sam Ravnborg
Quoted 3 lines · Sam Ravnborg

I would not be suprised if NVIDIA (and wmware for that matter) takes some assumptions which it should not. But I need to find out why it break, and for that I need more information!

Yes. I had cut off the whole nVidia install tree. The GLX driver are working, but only the kernel module is in /usr/src/nv eg. I change to this dir and type "make install" then the Makefile.kbuild for 2.6 tries to build it against an 2.6 kernel. Goes with all included -mm3 and others here.

LD [M] /usr/src/nv/nvidia.o
/bin/sh: line 1: /usr/src/nv/.tmp_versions/nvidia.mod: No such file or directory Building modules, stage 2. make[1]: Leaving directory `/usr/src/linux-2.6.5-mm4'
nvidia.ko failed to build!
make: *** [module] Error 1

strace gives not more.
Also when I set KBUILD_EXTMOD=/usr/src/nv or to new

KBUILD_PARAMS := -C $(KERNEL_SOURCES) M=$(PWD)

in the Makefile of the nVidia source, I get this error above. Hmm.

Marcus

#7 lore raw
Quoted 17 lines · On 2004-04-12 15:48:46 -0500 Marcus Hartig <[email protected]> wrote:
Quoted 3 lines · Sam Ravnborg

I would not be suprised if NVIDIA (and wmware for that matter) takes some assumptions which it should not. But I need to find out why it break, and for that I need more information!

Yes. I had cut off the whole nVidia install tree. The GLX driver are working, but only the kernel module is in /usr/src/nv eg. I change to this dir and type "make install" then the Makefile.kbuild for 2.6 tries to build it against an 2.6 kernel. Goes with all included -mm3 and others here.

LD [M] /usr/src/nv/nvidia.o
/bin/sh: line 1: /usr/src/nv/.tmp_versions/nvidia.mod: No such file or directory Building modules, stage 2. make[1]: Leaving directory `/usr/src/linux-2.6.5-mm4'
nvidia.ko failed to build!
make: *** [module] Error 1

strace gives not more.
Also when I set KBUILD_EXTMOD=/usr/src/nv or to new

Quoted 6 lines

KBUILD_PARAMS := -C $(KERNEL_SOURCES) M=$(PWD)

in the Makefile of the nVidia source, I get this error above. Hmm.

Marcus
-

I had these problems building nvidia driver and vmware drivers today after I upgraded to mm4 (with love-sources patchset as well). I traced them down to a single change in the kernel Makefile which, after I reversed it, allowed the modules to successfully build (and my -mm4 kernel is happily tainted with them right now).

-export MODVERDIR := .tmp_versions
+export MODVERDIR := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/).tmp_versions
+ .tmp_kallsyms* .tmp_version .tmp_vmlinux*

Likely the problem _is_ nvidia and vmware coders making assumptions that they should not. In any case, I'm glad to see others are noticing this problem and it will probably be fixed soon.

This is the sort of error I was getting with nvidia (done manually for clarity):

21:45:09 <@root|/usr/src/linux> SUBDIRS=/usr/src/archives/nvidia/NVIDIA-Linux-x86-1.0-5336-pkg1/usr/src/nv/ make modules < bunch of text... compiling, etc... >
LD [M]
/usr/src/archives/nvidia/NVIDIA-Linux-x86-1.0-5336-pkg1/usr/src/nv//nvidia.o
/bin/sh: line 1: /usr/src/archives/nvidia/NVIDIA-Linux-x86-1.0-5336-pkg1/usr/src/nv//.tmp_versions/nvidia.mod: No such file or directory

Similar error with vmware (and I don't feel like going through the work of reproducing it atm XD)

Cheers,

Mike

#8 lore raw
In reply to Marcus Hartig
Quoted 7 lines · Marcus Hartig

LD [M] /usr/src/nv/nvidia.o
/bin/sh: line 1: /usr/src/nv/.tmp_versions/nvidia.mod: No such file or directory Building modules, stage 2.
make[1]: Leaving directory `/usr/src/linux-2.6.5-mm4' nvidia.ko failed to build!
make: *** [module] Error 1

Thanks for the report.

kbuild fails to create the .tmp_version directory in the directory where the module is being built.
The reason to create it there is to avoid trying to write in a RO kernel src directory. And also to avoid cluttering up the .tmp_versions directory for the kernel if you build more than one module.

Sam

Patch to fix it:

Makefile +13 -7
@@ -787,12 +787,6 @@ endef
 # make mrproper  Delete the current configuration, and all generated files
 # make distclean Remove editor backup files, patch leftover files and the like
 
-quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   $(wildcard $(rm-dirs)))
-      cmd_rmdirs = rm -rf $(rm-dirs)
-
-quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
-      cmd_rmfiles = rm -f $(rm-files)
-
 # Directories & files removed with 'make clean'
 CLEAN_DIRS  += $(MODVERDIR)
 CLEAN_FILES +=	vmlinux System.map kernel.spec \
@@ -951,9 +945,12 @@ else # KBUILD_EXTMOD
 
 # We are always building modules
 KBUILD_MODULES := 1
+.PHONY: crmodverdir
+crmodverdir: FORCE
+	$(Q)mkdir -p $(MODVERDIR)
 
 .PHONY: $(KBUILD_EXTMOD)
-$(KBUILD_EXTMOD): FORCE
+$(KBUILD_EXTMOD): crmodverdir FORCE
 	$(Q)$(MAKE) $(build)=$@
 
 .PHONY: modules
@@ -971,7 +968,9 @@ clean-dirs := _clean_$(KBUILD_EXTMOD)
 $(clean-dirs):
 	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 
+clean:	rm-dirs := $(MODVERDIR)
 clean: $(clean-dirs)
+	$(call cmd,rmdirs)
 	@find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \
 	 	\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
 		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
@@ -1058,6 +1057,13 @@ endif #ifeq ($(mixed-targets),1)
 # FIXME Should go into a make.lib or something 
 # ===========================================================================
 
+quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   $(wildcard $(rm-dirs)))
+      cmd_rmdirs = rm -rf $(rm-dirs)
+
+quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
+      cmd_rmfiles = rm -f $(rm-files)
+
+
 a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \
 	  $(NOSTDINC_FLAGS) $(CPPFLAGS) \
 	  $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)