* Build failure (with insane config)
@ 2008-04-28 3:34 Roland Dreier
2008-04-28 8:08 ` Ingo Molnar
2008-04-28 9:30 ` Adrian Bunk
0 siblings, 2 replies; 3+ messages in thread
From: Roland Dreier @ 2008-04-28 3:34 UTC (permalink / raw)
To: linux-kernel, tglx, mingo
For x86-64, arch/x86/lib/Makefile has:
lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
so in particular ip_compute_csum() (from csum-partial_64.c) gets put in
libs, so even though it is exported, it gets thrown away at link time if
there are no non-modular users.
However, if someone has an insane config with CONFIG_NET=n and
CONFIG_VIDEO_BT848=m, then ip_compute_csum() gets discarded but the
modular code in drivers/media/video/bt8xx/bttv-cards.c calls it and...
ERROR: "ip_compute_csum" [drivers/media/video/bt8xx/bttv.ko] undefined!
I guess one fix is just to put at least csum-partial_64.c in obj-y
instead; it does seem broken to have files with EXPORT_SYMBOL() be
lib-y, since it is really an invitation for this problem. Other ideas
would be for bttv to depend on or select CONFIG_NET.
[It's a long story why I noticed this problem, but maybe we want to fix
it to save people doing randconfig test builds or something like that.
Or maybe we don't really care, since the class of real systems with
video capture cards but no networking is probably quite small]
- R.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Build failure (with insane config)
2008-04-28 3:34 Build failure (with insane config) Roland Dreier
@ 2008-04-28 8:08 ` Ingo Molnar
2008-04-28 9:30 ` Adrian Bunk
1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2008-04-28 8:08 UTC (permalink / raw)
To: Roland Dreier; +Cc: linux-kernel, tglx, H. Peter Anvin
* Roland Dreier <rdreier@cisco.com> wrote:
> For x86-64, arch/x86/lib/Makefile has:
>
> lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
>
> so in particular ip_compute_csum() (from csum-partial_64.c) gets put in
> libs, so even though it is exported, it gets thrown away at link time if
> there are no non-modular users.
>
> However, if someone has an insane config with CONFIG_NET=n and
> CONFIG_VIDEO_BT848=m, then ip_compute_csum() gets discarded but the
> modular code in drivers/media/video/bt8xx/bttv-cards.c calls it and...
>
> ERROR: "ip_compute_csum" [drivers/media/video/bt8xx/bttv.ko] undefined!
>
> I guess one fix is just to put at least csum-partial_64.c in obj-y
> instead; it does seem broken to have files with EXPORT_SYMBOL() be
> lib-y, since it is really an invitation for this problem. Other ideas
> would be for bttv to depend on or select CONFIG_NET.
well, the TCP/IP checksumming functions are in lib portions on every
architecture i checked, and the exports are handled by the networking
code. And the symbol used is named ip_compute_csum(). So i think the
correct solution is to make CONFIG_VIDEO_BT848 depend on CONFIG_NET ...
especially on embedded there's an advantage in linking out unused core
kernel functions. But even if we did this change on x86, other
architectures might (correctly) complain about x86 going it alone. x86
gets the most use by far, so if we start introducing build assymetries
like this it will just mess up the build on other architectures.
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Build failure (with insane config)
2008-04-28 3:34 Build failure (with insane config) Roland Dreier
2008-04-28 8:08 ` Ingo Molnar
@ 2008-04-28 9:30 ` Adrian Bunk
1 sibling, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2008-04-28 9:30 UTC (permalink / raw)
To: Roland Dreier; +Cc: linux-kernel, tglx, mingo
On Sun, Apr 27, 2008 at 08:34:12PM -0700, Roland Dreier wrote:
> For x86-64, arch/x86/lib/Makefile has:
>
> lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
>
> so in particular ip_compute_csum() (from csum-partial_64.c) gets put in
> libs, so even though it is exported, it gets thrown away at link time if
> there are no non-modular users.
>
> However, if someone has an insane config with CONFIG_NET=n and
> CONFIG_VIDEO_BT848=m, then ip_compute_csum() gets discarded but the
> modular code in drivers/media/video/bt8xx/bttv-cards.c calls it and...
>
> ERROR: "ip_compute_csum" [drivers/media/video/bt8xx/bttv.ko] undefined!
>
> I guess one fix is just to put at least csum-partial_64.c in obj-y
> instead; it does seem broken to have files with EXPORT_SYMBOL() be
> lib-y, since it is really an invitation for this problem. Other ideas
> would be for bttv to depend on or select CONFIG_NET.
>...
This isn't the first time csum-partial_64.c is involved in such a kind
of breakage (and we constantly have this kind of bugs with various
exports from lib-y), and EXPORT_SYMBOL's in lib-y are simply wrong and
always bugs waiting to happen.
Axing lib-y is somewhere low priority on my TODO list.
> - R.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-28 9:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-28 3:34 Build failure (with insane config) Roland Dreier
2008-04-28 8:08 ` Ingo Molnar
2008-04-28 9:30 ` Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox