2003-05-22 13:41:28

by Mads Christensen

[permalink] [raw]
Subject: Error during compile of 2.5.69-mm8

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.o
init/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!
--
===================================================
| Mads F. Christensen || |
| Email: || [email protected] |
| Webdesign Development || http://www.krycek.org |
===================================================


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2003-05-22 15:16:29

by Mads Christensen

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

Hey!

Well you can fix it by either compiling apm as a module or not compiling
apm at all =)

Best Regards
Mads Christensen

On tor, 2003-05-22 at 15:54, Mads Christensen wrote:
> 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.o
> init/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!
--
===================================================
| Mads F. Christensen || |
| Email: || [email protected] |
| Webdesign Development || http://www.krycek.org |
===================================================


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2003-05-22 22:54:12

by David Miller

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

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.

2003-05-22 22:57:33

by Thomas Schlichter

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

Hi!

On May 22, Mads Christensen wrote:
> 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... ;-)

> 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...

> On tor, 2003-05-22 at 15:54, Mads Christensen wrote:
> > 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.o
> > init/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!


Attachments:
(No filename) (0.00 B)
signed data
(No filename) (189.00 B)
signature
Download all attachments

2003-05-22 23:15:13

by Thomas Schlichter

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

Hi,

On May 23, David S. Miller wrote:
> 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.

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)...

> 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...

> 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


Attachments:
(No filename) (993.00 B)
signed data
(No filename) (189.00 B)
signature
Download all attachments

2003-05-22 23:18:03

by David Miller

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 01:28:06 +0200

On May 23, David S. Miller wrote:
> 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.

2003-05-22 23:34:08

by Thomas Schlichter

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

On May 23, David S. Miller wrote:
> From: Thomas Schlichter <[email protected]>
> Date: Fri, 23 May 2003 01:28:06 +0200
>
> On May 23, David S. Miller wrote:
> > 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.

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


Attachments:
(No filename) (1.10 kB)
signed data
(No filename) (189.00 B)
signature
Download all attachments

2003-05-22 23:37:32

by David Miller

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

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.

2003-05-23 00:00:51

by Thomas Schlichter

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

On May 23, David S. Miller wrote:
> 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.

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!

> So when I deleted ->owner from struct netdevice, SET_MODULE_OWNER
> became a nop.

For netdevice you are right!

> 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


Attachments:
(No filename) (1.28 kB)
signed data
(No filename) (189.00 B)
signature
Download all attachments

2003-05-23 00:11:52

by David Miller

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

From: Thomas Schlichter <[email protected]>
Date: Fri, 23 May 2003 02:13:34 +0200

> 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.

2003-05-23 00:54:03

by Thomas Schlichter

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

On May 23, David S. Miller wrote:
> From: Thomas Schlichter <[email protected]>
> Date: Fri, 23 May 2003 02:13:34 +0200
>
> > 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...

> 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.

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... ;-)

> 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


Attachments:
(No filename) (0.00 B)
signed data
(No filename) (189.00 B)
signature
Download all attachments

2003-05-23 01:05:37

by David Miller

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

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.

2003-05-24 14:24:09

by Thomas Schlichter

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

On Friday, 23 May 2003 06:32, David S. Miller wrote:
> From: Thomas Schlichter <[email protected]>
> Date: Fri, 23 May 2003 05:38:38 +0200
>
> OK, done...
>
> I already did it myself and sent the changes to Linus, he should pick
> them up by tomorrow.

Well it seems you missed one file that my patch would have cought. So here is
a seperate diff to fix drivers/usb/media/pwc-if.c, too.

I also attached a patch that fixes the SET_MODULE_OWNER thing for net/ipv4/ by
using static initializers instead of performing the assignment at runtime.
This should be no problem here, as SET_MODULE_OWNER was called from static
init functions once. I also made 'esp4_init' static to be safe. This function
is not called from anywhere else in the whole kernel tree. (That's whar grep
says)

Both patches should cleanly apply to current bk.
For me it compiles and runs without any problems...

Best regards
Thomas Schlichter


Attachments:
(No filename) (0.00 B)
signed data
(No filename) (189.00 B)
signature
Download all attachments

2003-05-26 02:05:40

by David Miller

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

From: Thomas Schlichter <[email protected]>
Date: Sat, 24 May 2003 16:36:59 +0200

I also attached a patch that fixes the SET_MODULE_OWNER thing for
net/ipv4/ by using static initializers

I can't apply these patches, there are errors. You remove
the esp4_type->owner setting, but don't put the static initializer
in there.

I suppose you do test the changes you make in your patches, right?
What was the test you made to make sure the esp4_type module ownership
was set correctly? :-)

2003-05-26 06:22:52

by Thomas Schlichter

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

Am Montag, 26. Mai 2003 04:18 schrieb David S. Miller:
> From: Thomas Schlichter <[email protected]>
> Date: Sat, 24 May 2003 16:36:59 +0200
>
> I also attached a patch that fixes the SET_MODULE_OWNER thing for
> net/ipv4/ by using static initializers
>
> I can't apply these patches, there are errors. You remove
> the esp4_type->owner setting, but don't put the static initializer
> in there.

I created the patches against -mm8 with the SET_MODULE_OWNER lines modified by
hand to match your patched version, so the patches apply here cleanly...

> I suppose you do test the changes you make in your patches, right?
> What was the test you made to make sure the esp4_type module ownership
> was set correctly? :-)

Well, I looked into the code...
In version 1.26 of the file net/ipv4/esp.c rusty already added the static
initializer into the struct.

Best regards
Thomas Schlichter

2003-05-26 06:51:24

by David Miller

[permalink] [raw]
Subject: Re: Error during compile of 2.5.69-mm8

From: Thomas Schlichter <[email protected]>
Date: Mon, 26 May 2003 08:35:53 +0200

In version 1.26 of the file net/ipv4/esp.c rusty already added the static
initializer into the struct.

My error, sorry I hadn't noticed that.

Could you please resend the patches to me? I've misplaced the
original copy.