Error during compile of 2.5.69-mm8
Subsystems (3)
Hello
Got this while i tried to compile the fucker!
gcc -Wp,-MD,init/.version.o.d -D__KERNEL__ -Iinclude -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc
-iwithprefix include -DKBUILD_BASENAME=version
-DKBUILD_MODNAME=version -c -o init/.tmp_version.o init/version.c scripts/fixdep init/.version.o.d init/version.o 'gcc -Wp,-MD,init/.version.o.d -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc
-iwithprefix include -DKBUILD_BASENAME=version
-DKBUILD_MODNAME=version -c -o init/.tmp_version.o init/version.c' > init/.version.o.tmp; rm -f init/.version.o.d; mv -f init/.version.o.tmp init/.version.o.cmd
ld -m elf_i386 -r -o init/built-in.o init/main.o init/version.oinit/mounts.o init/initramfs.o
ld -m elf_i386 -T arch/i386/vmlinux.lds.s
arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/built-in.o
--start-group usr/built-in.o arch/i386/kernel/built-in.o arch/i386/mm/built-in.o arch/i386/mach-default/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o lib/lib.a arch/i386/lib/lib.a drivers/built-in.o sound/built-in.o arch/i386/pci/built-in.o net/built-in.o --end-group -o vmlinux arch/i386/kernel/built-in.o(.init.text+0x5521): In function `apm_init':
: undefined reference to `SET_MODULE_OWNER'
make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.69-mm8'
make: *** [stamp-build] Error 2
Thanks in advance!
Signature · 5 lines
=================================================== | Mads F. Christensen || | | Email: || [email protected] | | Webdesign Development || www.krycek.org | ===================================================
Hey!
Well you can fix it by either compiling apm as a module or not compiling apm at all =)
Best Regards
Mads Christensen
Quoted 37 lines · Mads Christensen
Hello
Got this while i tried to compile the fucker!
gcc -Wp,-MD,init/.version.o.d -D__KERNEL__ -Iinclude -Wall
(quoted diff) +0
-5-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc -iwithprefix include -DKBUILD_BASENAME=version -DKBUILD_MODNAME=version -c -o init/.tmp_version.o init/version.c
scripts/fixdepinit/.version.o.dinit/version.o'gcc(quoted diff) +0
-6-Wp,-MD,init/.version.o.d -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc -iwithprefix include -DKBUILD_BASENAME=version -DKBUILD_MODNAME=version -c -o init/.tmp_version.o init/version.c' >
init/.version.o.tmp; rm -finit/.version.o.d; mv -finit/.version.o.tmpinit/.version.o.cmd
ld -melf_i386-r -oinit/built-in.oinit/main.oinit/version.oinit/mounts.oinit/initramfs.old -m elf_i386 -T arch/i386/vmlinux.lds.s
arch/i386/kernel/head.oarch/i386/kernel/init_task.oinit/built-in.o
--start-groupusr/built-in.oarch/i386/kernel/built-in.oarch/i386/mm/built-in.oarch/i386/mach-default/built-in.okernel/built-in.omm/built-in.ofs/built-in.oipc/built-in.osecurity/built-in.ocrypto/built-in.olib/lib.aarch/i386/lib/lib.adrivers/built-in.osound/built-in.oarch/i386/pci/built-in.onet/built-in.o--end-group -o vmlinux arch/i386/kernel/built-in.o(.init.text+0x5521): In function `apm_init':
: undefined reference to `SET_MODULE_OWNER'
make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.69-mm8'
make: *** [stamp-build] Error 2Thanks in advance!
Signature · 5 lines
=================================================== | Mads F. Christensen || | | Email: || [email protected] | | Webdesign Development || www.krycek.org | ===================================================
Hi!
Quoted 4 lines · Mads Christensen
Hey!
Well you can fix it by either compiling apm as a module or not compiling apm at all =)
Well, I Don't think this really is a fix, it's just a workaround for a problen introduced with [email protected].
With that the definition of SET_MODULE_OWNER was removed from the file include/linux/module.h and an empty one was added to the file include/linux/netdevice.h.
This was done because the 'owner' field was removed from the 'struct net_device'. This broke all other places where SET_MODULE_OWNER was also used...
I made the attached patch against 2.5.69-mm8 that adds the original definition back to include/linux/module.h and removes all the places where it must not be called anymore due to the missing owner field...
I hope this was the real intention of the ChangeSet mentioned above, and I did not miss any false occurrence. (The most SET_MODULE_OWNER calls are now in the isdn subtree)
For me it compiles and works fine... ;-)
Quoted 2 lines
Best Regards
Mads Christensen
Best regards, too...
Thomas Schlichter
P.S.: Sorry that I had to GZIP the patch, but else it would have been too large...
Quoted 40 lines · Mads Christensen
Quoted 39 lines
Hello
Got this while i tried to compile the fucker!
gcc -Wp,-MD,init/.version.o.d -D__KERNEL__ -Iinclude -Wall
(quoted diff) +0
-5-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc -iwithprefix include -DKBUILD_BASENAME=version -DKBUILD_MODNAME=version -c -o init/.tmp_version.o init/version.c
scripts/fixdepinit/.version.o.dinit/version.o'gcc(quoted diff) +0
-6-Wp,-MD,init/.version.o.d -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc -iwithprefix include -DKBUILD_BASENAME=version -DKBUILD_MODNAME=version -c -o init/.tmp_version.o init/version.c' >
init/.version.o.tmp; rm -finit/.version.o.d; mv -finit/.version.o.tmpinit/.version.o.cmd
ld -melf_i386-r -oinit/built-in.oinit/main.oinit/version.oinit/mounts.oinit/initramfs.old -m elf_i386 -T arch/i386/vmlinux.lds.s
arch/i386/kernel/head.oarch/i386/kernel/init_task.oinit/built-in.o
--start-groupusr/built-in.oarch/i386/kernel/built-in.oarch/i386/mm/built-in.oarch/i386/mach-default/built-in.okernel/built-in.omm/built-in.ofs/built-in.oipc/built-in.osecurity/built-in.ocrypto/built-in.olib/lib.aarch/i386/lib/lib.adrivers/built-in.osound/built-in.oarch/i386/pci/built-in.onet/built-in.o--end-group -o vmlinuxarch/i386/kernel/built-in.o(.init.text+0x5521): In function `apm_init':
: undefined reference to `SET_MODULE_OWNER'make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.69-mm8'
make: *** [stamp-build] Error 2Thanks in advance!
A message that is not in the archive (sent off-list or not yet received): [email protected]
From: Andrew Morton <[email protected]>
Date: Thu, 22 May 2003 16:02:18 -0700
Looks like David converted this macro into a no-op, then moved it into netdevice.h.
Problem is, some non-network drivers were using it too.
They shouldn't, it's backwards compatability crap for net drivers only. Use explicit ->owner references elsewhere.
Maybe we should put it back the way it was and go edit all the netdrivers?
Absolutely not.
Yoshfuji posted a patch on linux-kernel to fix this already.
Hi,
Quoted 10 lines · David S. Miller
From: Andrew Morton <[email protected]>
Date: Thu, 22 May 2003 16:02:18 -0700Looks like David converted this macro into a no-op, then moved it into
netdevice.h.Problem is, some non-network drivers were using it too.
They shouldn't, it's backwards compatability crap for net drivers only. Use explicit ->owner references elsewhere.
Well, as mentioned in my other mail there ARE many occurrences of SET_MODULE_OWNER, for example in the ISDN subtree (just give 'grep' a try)...
Quoted 4 lines
Maybe we should put it back the way it was and go edit all the
netdrivers?Absolutely not.
Oops, that's what the patch in my other mail does...
Quoted 1 line
Yoshfuji posted a patch on linux-kernel to fix this already.
Sorry, I must have missed this patch - that would have made my work obsolete - but I'd like to see how that supports all the other SET_MODULE_OWNER calls from all the other places...
Best regards
Thomas Schlichter
From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 01:28:06 +0200
Quoted 1 line · David S. Miller
Yoshfuji posted a patch on linux-kernel to fix this already.
Sorry, I must have missed this patch - that would have made my work obsolete -
but I'd like to see how that supports all the other SET_MODULE_OWNER calls from all the other places...
They also should be converted to explicit ->owner references.
Quoted 4 lines · David S. Miller
From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 01:28:06 +0200On May 23, David S. Miller wrote:
Quoted 8 lines
Quoted 1 line
Yoshfuji posted a patch on linux-kernel to fix this already.
Sorry, I must have missed this patch - that would have made my work obsolete -
but I'd like to see how that supports all the otherSET_MODULE_OWNERcalls from all the other places...They also should be converted to explicit ->owner references.
Well, I don't think so...
I don't like it if there is a possibility doing it with an initializer, but in other cases it may increase readability, too...
There was a discussion about SET_MODULE_OWNER here on the list, once. You can find it here:
http://marc.theaimsgroup.com/?t=104969843600002&r=1&w=2
At the end Rusty made a small patch that never made it into the mainline tree (even if I think it should have...) His mail with the patch can be found at:
http://marc.theaimsgroup.com/?l=linux-kernel&m=105065084724249&w=2
(I like the analogy to a mainframe ;-)
Best regards
Thomas Schlichter
From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 01:47:00 +0200
There was a discussion about SET_MODULE_OWNER here on the list, once. You can find it here:
I know about it and in fact Rusty is the one that told me to do what I did with SET_MODULE_OWNER.
FACT: SET_MODULE_OWNER() tracks how to set the module reference
for a struct netdevice.
It always lived in netdevice.h and always served exactly this purpose. So when I deleted ->owner from struct netdevice, SET_MODULE_OWNER became a nop.
Therefore, it was a complete error for anyone else to start using this macro for other structures.
Quoted 6 lines · David S. Miller
From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 01:47:00 +0200There was a discussion about
SET_MODULE_OWNERhere on the list, once. You can find it here:
Quoted 7 lines
I know about it and in fact Rusty is the one that told me to do what I did with
SET_MODULE_OWNER.FACT:
SET_MODULE_OWNER()tracks how to set the module reference
for a struct netdevice.It always lived in
netdevice.hand always served exactly this purpose.
As far as I can see it lived in modules.h... (Even in 2.4.10 if the sources here on my disk don't lie)
So nothing (not even the name) indicated its membership to netdevice for a very long time!
Quoted 2 lines
So when I deleted ->owner from struct netdevice,
SET_MODULE_OWNERbecame a nop.
For netdevice you are right!
Quoted 2 lines
Therefore, it was a complete error for anyone else to start using this macro for other structures.
So nobody should better use THIS_MODULE?! Well it currently is defined in module.h, but perhaps it was first defined in isdn.h and may be removed by its maintainer when he thinks he does not need it anymore...
For ME and many other driver developers SET_MODULE_OWNER does not belong to netdevice, it belongs to the module infrastructure!
Best regards
Thomas Schlichter
From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 02:13:34 +0200
Quoted 2 lines
Therefore, it was a complete error for anyone else to start using this macro for other structures.
So nobody should better use THIS_MODULE?!
No, it is exactly what they should use.
They should avoid using SET_MODULE_OWNER.
For ME and many other driver developers SET_MODULE_OWNER does not belong to netdevice, it belongs to the module infrastructure!
Then by changing SET_MODULE_OWNER you will break source backwards compatability for every single network device driver out there, something I was explicitly trying to avoid.
SET_MODULE_OWNER() is a bogus interface because it is typeless.
Therefore I suggest that you create macros specific to your individual structures, and use these to achieve 2.4.x/2.5.x build compatability in setting the ->owner field of such structs.
Quoted 11 lines · David S. Miller
From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 02:13:34 +0200Quoted 2 lines
Therefore, it was a complete error for anyone else to start using this macro for other structures.
So nobody should better use
THIS_MODULE?!No, it is exactly what they should use.
They should avoid using
SET_MODULE_OWNER.
This is clear to me, of course, it should have been just a very extreme example...
Quoted 6 lines
For ME and many other driver developers
SET_MODULE_OWNERdoes not belong
to netdevice, it belongs to the module infrastructure!Then by changing
SET_MODULE_OWNERyou will break source backwards compatability for every single network device driver out there, something I was explicitly trying to avoid.
OK, now I see clearer...
What you did broke everything but netdevices and what I did broke nothing but netdevices... So I attached a very small patch that will help braking nothing... ;-)
Quoted 5 lines
SET_MODULE_OWNER()is a bogus interface because it is typeless.Therefore I suggest that you create macros specific to your individual structures, and use these to achieve 2.4.x/2.5.x build compatability in setting the ->owner field of such structs.
That is a good idea, but how should we get rid off this when it is used over and over??
Best regards
Thomas Schlichter
include/linux/module.h renamed from include/linux/module.h.orig +4 -0
@@ -438,6 +438,10 @@#define symbol_request (x) try_then_request_module(symbol_get(x), "symbol:" #x) +#ifndef SET_MODULE_OWNER +#define SET_MODULE_OWNER (dev) ((dev)->owner = THIS_MODULE) +#endif +/* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ struct obsolete_modparm {
include/linux/netdevice.h renamed from include/linux/netdevice.h.orig +1 -0
@@ -451,6 +451,7 @@struct kobject stats_kobj; }; +#undef SET_MODULE_OWNER#define SET_MODULE_OWNER (dev) do { } while (0)/* Set the sysfs physical device reference for the network logical device * if set prior to registration will cause a symlink during initialization.
From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 03:06:45 +0200
So I attached a very small patch that will help braking nothing... ;-)
No it breaks everything, module.h is always included before netdevice.h.
This isn't how to solve this problem, I showed you how it can be done by definiting type-specific macros.