public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c
       [not found] ` <87bo6kfp32.fsf@rustcorp.com.au>
@ 2013-07-03  8:44   ` James Hogan
  2013-07-03  8:44     ` James Hogan
  2013-07-03  8:50     ` Geert Uytterhoeven
  0 siblings, 2 replies; 6+ messages in thread
From: James Hogan @ 2013-07-03  8:44 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, linux-arch, linux-kbuild

(cc'ing linux-arch and linux-kbuild)

On 03/07/13 01:45, Rusty Russell wrote:
> James Hogan <james.hogan@imgtec.com> writes:
>> Move all EXPORT_SYMBOLs in libs-y directories (arch/metag/{lib,tbx})
>> into metag_ksyms.c so that they don't get omitted by the static linker
>> if they're not used by any other statically linked code, which can
>> result in undefined symbols when building modules.
>>
>> For example a randconfig caused the following error:
>> ERROR: "csum_partial" [fs/reiserfs/reiserfs.ko] undefined!
>>
>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>> Cc: Rusty Russell <rusty@rustcorp.com.au>
>> ---
>> Unless there are any objections I'll apply this patch for v3.11. I'm
>> assuming *_ksyms.c is the way that this problem is normally worked
>> around.
> 
> Actually, normally those files are obj-y not lib-y.  See the top-level
> lib/.
> 
> Subtle, I know.

Hmm, subtle indeed, I hadn't noticed that.

grepping for EXPORT_SYMBOL(csum_partial) gives:

./arch/avr32/kernel/avr32_ksyms.c
./arch/sparc/lib/ksyms.c
./arch/sh/kernel/sh_ksyms_32.c
./arch/powerpc/kernel/ppc_ksyms.c
./arch/unicore32/kernel/ksyms.c
./arch/x86/um/ksyms.c
./arch/x86/kernel/x8664_ksyms_64.c
./arch/x86/kernel/i386_ksyms_32.c
./arch/cris/kernel/crisksyms.c
./arch/mips/kernel/mips_ksyms.c
./arch/xtensa/kernel/xtensa_ksyms.c
./arch/arm/kernel/armksyms.c

./arch/ia64/lib/checksum.c
./arch/alpha/lib/checksum.c
./arch/c6x/lib/checksum.c
./arch/mn10300/lib/checksum.c
./arch/cris/arch-v10/lib/old_checksum.c
./arch/h8300/lib/checksum.c
./arch/parisc/lib/checksum.c
./arch/m32r/lib/csum_partial_copy.c
./arch/m68k/lib/checksum.c
./arch/metag/lib/checksum.c
./arch/frv/lib/checksum.c

./lib/checksum.c

All of the above arches have *c*sum.o in lib-y. Should they all be
switched to obj-y or the remaining EXPORT_SYMBOLs moved to *ksyms.c if
this problem is noticed?

Thanks
James


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c
  2013-07-03  8:44   ` [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c James Hogan
@ 2013-07-03  8:44     ` James Hogan
  2013-07-03  8:50     ` Geert Uytterhoeven
  1 sibling, 0 replies; 6+ messages in thread
From: James Hogan @ 2013-07-03  8:44 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, linux-arch, linux-kbuild

(cc'ing linux-arch and linux-kbuild)

On 03/07/13 01:45, Rusty Russell wrote:
> James Hogan <james.hogan@imgtec.com> writes:
>> Move all EXPORT_SYMBOLs in libs-y directories (arch/metag/{lib,tbx})
>> into metag_ksyms.c so that they don't get omitted by the static linker
>> if they're not used by any other statically linked code, which can
>> result in undefined symbols when building modules.
>>
>> For example a randconfig caused the following error:
>> ERROR: "csum_partial" [fs/reiserfs/reiserfs.ko] undefined!
>>
>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>> Cc: Rusty Russell <rusty@rustcorp.com.au>
>> ---
>> Unless there are any objections I'll apply this patch for v3.11. I'm
>> assuming *_ksyms.c is the way that this problem is normally worked
>> around.
> 
> Actually, normally those files are obj-y not lib-y.  See the top-level
> lib/.
> 
> Subtle, I know.

Hmm, subtle indeed, I hadn't noticed that.

grepping for EXPORT_SYMBOL(csum_partial) gives:

./arch/avr32/kernel/avr32_ksyms.c
./arch/sparc/lib/ksyms.c
./arch/sh/kernel/sh_ksyms_32.c
./arch/powerpc/kernel/ppc_ksyms.c
./arch/unicore32/kernel/ksyms.c
./arch/x86/um/ksyms.c
./arch/x86/kernel/x8664_ksyms_64.c
./arch/x86/kernel/i386_ksyms_32.c
./arch/cris/kernel/crisksyms.c
./arch/mips/kernel/mips_ksyms.c
./arch/xtensa/kernel/xtensa_ksyms.c
./arch/arm/kernel/armksyms.c

./arch/ia64/lib/checksum.c
./arch/alpha/lib/checksum.c
./arch/c6x/lib/checksum.c
./arch/mn10300/lib/checksum.c
./arch/cris/arch-v10/lib/old_checksum.c
./arch/h8300/lib/checksum.c
./arch/parisc/lib/checksum.c
./arch/m32r/lib/csum_partial_copy.c
./arch/m68k/lib/checksum.c
./arch/metag/lib/checksum.c
./arch/frv/lib/checksum.c

./lib/checksum.c

All of the above arches have *c*sum.o in lib-y. Should they all be
switched to obj-y or the remaining EXPORT_SYMBOLs moved to *ksyms.c if
this problem is noticed?

Thanks
James


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c
  2013-07-03  8:44   ` [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c James Hogan
  2013-07-03  8:44     ` James Hogan
@ 2013-07-03  8:50     ` Geert Uytterhoeven
  2013-07-03  8:50       ` Geert Uytterhoeven
  2013-07-03  9:14       ` James Hogan
  1 sibling, 2 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2013-07-03  8:50 UTC (permalink / raw)
  To: James Hogan
  Cc: Rusty Russell, linux-kernel@vger.kernel.org, linux-arch,
	linux-kbuild

On Wed, Jul 3, 2013 at 10:44 AM, James Hogan <james.hogan@imgtec.com> wrote:
> (cc'ing linux-arch and linux-kbuild)
>
> On 03/07/13 01:45, Rusty Russell wrote:
>> James Hogan <james.hogan@imgtec.com> writes:
>>> Move all EXPORT_SYMBOLs in libs-y directories (arch/metag/{lib,tbx})
>>> into metag_ksyms.c so that they don't get omitted by the static linker
>>> if they're not used by any other statically linked code, which can
>>> result in undefined symbols when building modules.
>>>
>>> For example a randconfig caused the following error:
>>> ERROR: "csum_partial" [fs/reiserfs/reiserfs.ko] undefined!
>>>
>>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>>> Cc: Rusty Russell <rusty@rustcorp.com.au>
>>> ---
>>> Unless there are any objections I'll apply this patch for v3.11. I'm
>>> assuming *_ksyms.c is the way that this problem is normally worked
>>> around.
>>
>> Actually, normally those files are obj-y not lib-y.  See the top-level
>> lib/.
>>
>> Subtle, I know.
>
> Hmm, subtle indeed, I hadn't noticed that.
>
> grepping for EXPORT_SYMBOL(csum_partial) gives:
>
> ./arch/avr32/kernel/avr32_ksyms.c
> ./arch/sparc/lib/ksyms.c
> ./arch/sh/kernel/sh_ksyms_32.c
> ./arch/powerpc/kernel/ppc_ksyms.c
> ./arch/unicore32/kernel/ksyms.c
> ./arch/x86/um/ksyms.c
> ./arch/x86/kernel/x8664_ksyms_64.c
> ./arch/x86/kernel/i386_ksyms_32.c
> ./arch/cris/kernel/crisksyms.c
> ./arch/mips/kernel/mips_ksyms.c
> ./arch/xtensa/kernel/xtensa_ksyms.c
> ./arch/arm/kernel/armksyms.c
>
> ./arch/ia64/lib/checksum.c
> ./arch/alpha/lib/checksum.c
> ./arch/c6x/lib/checksum.c
> ./arch/mn10300/lib/checksum.c
> ./arch/cris/arch-v10/lib/old_checksum.c
> ./arch/h8300/lib/checksum.c
> ./arch/parisc/lib/checksum.c
> ./arch/m32r/lib/csum_partial_copy.c
> ./arch/m68k/lib/checksum.c
> ./arch/metag/lib/checksum.c
> ./arch/frv/lib/checksum.c
>
> ./lib/checksum.c
>
> All of the above arches have *c*sum.o in lib-y. Should they all be
> switched to obj-y or the remaining EXPORT_SYMBOLs moved to *ksyms.c if
> this problem is noticed?

There are more, cfr. https://lkml.org/lkml/2013/5/29/76 ("[PATCH/RFC] sh: Always
link in helper functions extracted from libgcc"), which no one replied to.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c
  2013-07-03  8:50     ` Geert Uytterhoeven
@ 2013-07-03  8:50       ` Geert Uytterhoeven
  2013-07-03  9:14       ` James Hogan
  1 sibling, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2013-07-03  8:50 UTC (permalink / raw)
  To: James Hogan
  Cc: Rusty Russell, linux-kernel@vger.kernel.org, linux-arch,
	linux-kbuild

On Wed, Jul 3, 2013 at 10:44 AM, James Hogan <james.hogan@imgtec.com> wrote:
> (cc'ing linux-arch and linux-kbuild)
>
> On 03/07/13 01:45, Rusty Russell wrote:
>> James Hogan <james.hogan@imgtec.com> writes:
>>> Move all EXPORT_SYMBOLs in libs-y directories (arch/metag/{lib,tbx})
>>> into metag_ksyms.c so that they don't get omitted by the static linker
>>> if they're not used by any other statically linked code, which can
>>> result in undefined symbols when building modules.
>>>
>>> For example a randconfig caused the following error:
>>> ERROR: "csum_partial" [fs/reiserfs/reiserfs.ko] undefined!
>>>
>>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>>> Cc: Rusty Russell <rusty@rustcorp.com.au>
>>> ---
>>> Unless there are any objections I'll apply this patch for v3.11. I'm
>>> assuming *_ksyms.c is the way that this problem is normally worked
>>> around.
>>
>> Actually, normally those files are obj-y not lib-y.  See the top-level
>> lib/.
>>
>> Subtle, I know.
>
> Hmm, subtle indeed, I hadn't noticed that.
>
> grepping for EXPORT_SYMBOL(csum_partial) gives:
>
> ./arch/avr32/kernel/avr32_ksyms.c
> ./arch/sparc/lib/ksyms.c
> ./arch/sh/kernel/sh_ksyms_32.c
> ./arch/powerpc/kernel/ppc_ksyms.c
> ./arch/unicore32/kernel/ksyms.c
> ./arch/x86/um/ksyms.c
> ./arch/x86/kernel/x8664_ksyms_64.c
> ./arch/x86/kernel/i386_ksyms_32.c
> ./arch/cris/kernel/crisksyms.c
> ./arch/mips/kernel/mips_ksyms.c
> ./arch/xtensa/kernel/xtensa_ksyms.c
> ./arch/arm/kernel/armksyms.c
>
> ./arch/ia64/lib/checksum.c
> ./arch/alpha/lib/checksum.c
> ./arch/c6x/lib/checksum.c
> ./arch/mn10300/lib/checksum.c
> ./arch/cris/arch-v10/lib/old_checksum.c
> ./arch/h8300/lib/checksum.c
> ./arch/parisc/lib/checksum.c
> ./arch/m32r/lib/csum_partial_copy.c
> ./arch/m68k/lib/checksum.c
> ./arch/metag/lib/checksum.c
> ./arch/frv/lib/checksum.c
>
> ./lib/checksum.c
>
> All of the above arches have *c*sum.o in lib-y. Should they all be
> switched to obj-y or the remaining EXPORT_SYMBOLs moved to *ksyms.c if
> this problem is noticed?

There are more, cfr. https://lkml.org/lkml/2013/5/29/76 ("[PATCH/RFC] sh: Always
link in helper functions extracted from libgcc"), which no one replied to.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c
  2013-07-03  8:50     ` Geert Uytterhoeven
  2013-07-03  8:50       ` Geert Uytterhoeven
@ 2013-07-03  9:14       ` James Hogan
  2013-07-03  9:14         ` James Hogan
  1 sibling, 1 reply; 6+ messages in thread
From: James Hogan @ 2013-07-03  9:14 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rusty Russell, linux-kernel@vger.kernel.org, linux-arch,
	linux-kbuild

On 03/07/13 09:50, Geert Uytterhoeven wrote:
> On Wed, Jul 3, 2013 at 10:44 AM, James Hogan <james.hogan@imgtec.com> wrote:
>> (cc'ing linux-arch and linux-kbuild)
>>
>> On 03/07/13 01:45, Rusty Russell wrote:
>>> James Hogan <james.hogan@imgtec.com> writes:
>>>> Move all EXPORT_SYMBOLs in libs-y directories (arch/metag/{lib,tbx})
>>>> into metag_ksyms.c so that they don't get omitted by the static linker
>>>> if they're not used by any other statically linked code, which can
>>>> result in undefined symbols when building modules.
>>>>
>>>> For example a randconfig caused the following error:
>>>> ERROR: "csum_partial" [fs/reiserfs/reiserfs.ko] undefined!
>>>>
>>>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>>>> Cc: Rusty Russell <rusty@rustcorp.com.au>
>>>> ---
>>>> Unless there are any objections I'll apply this patch for v3.11. I'm
>>>> assuming *_ksyms.c is the way that this problem is normally worked
>>>> around.
>>>
>>> Actually, normally those files are obj-y not lib-y.  See the top-level
>>> lib/.
>>>
>>> Subtle, I know.
>>
>> Hmm, subtle indeed, I hadn't noticed that.
>>
>> grepping for EXPORT_SYMBOL(csum_partial) gives:
>>
>> ./arch/avr32/kernel/avr32_ksyms.c
>> ./arch/sparc/lib/ksyms.c
>> ./arch/sh/kernel/sh_ksyms_32.c
>> ./arch/powerpc/kernel/ppc_ksyms.c
>> ./arch/unicore32/kernel/ksyms.c
>> ./arch/x86/um/ksyms.c
>> ./arch/x86/kernel/x8664_ksyms_64.c
>> ./arch/x86/kernel/i386_ksyms_32.c
>> ./arch/cris/kernel/crisksyms.c
>> ./arch/mips/kernel/mips_ksyms.c
>> ./arch/xtensa/kernel/xtensa_ksyms.c
>> ./arch/arm/kernel/armksyms.c
>>
>> ./arch/ia64/lib/checksum.c
>> ./arch/alpha/lib/checksum.c
>> ./arch/c6x/lib/checksum.c
>> ./arch/mn10300/lib/checksum.c
>> ./arch/cris/arch-v10/lib/old_checksum.c
>> ./arch/h8300/lib/checksum.c
>> ./arch/parisc/lib/checksum.c
>> ./arch/m32r/lib/csum_partial_copy.c
>> ./arch/m68k/lib/checksum.c
>> ./arch/metag/lib/checksum.c
>> ./arch/frv/lib/checksum.c
>>
>> ./lib/checksum.c
>>
>> All of the above arches have *c*sum.o in lib-y. Should they all be
>> switched to obj-y or the remaining EXPORT_SYMBOLs moved to *ksyms.c if
>> this problem is noticed?
> 
> There are more, cfr. https://lkml.org/lkml/2013/5/29/76 ("[PATCH/RFC] sh: Always
> link in helper functions extracted from libgcc"), which no one replied to.

Moving the EXPORT_SYMBOL into */ksyms.c would seem to make the
inclusion/exclusion of unused lib-y objects automatic:
With CONFIG_MODULES=y the EXPORT_SYMBOL in *ksyms.c would ensure it is
included.
With CONFIG_MODULES=n the EXPORT_SYMBOL would be preprocessed out and it
could be unused and excluded.

(although it is of course uglier to separate it from the definition).

Cheers
James


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c
  2013-07-03  9:14       ` James Hogan
@ 2013-07-03  9:14         ` James Hogan
  0 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2013-07-03  9:14 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rusty Russell, linux-kernel@vger.kernel.org, linux-arch,
	linux-kbuild

On 03/07/13 09:50, Geert Uytterhoeven wrote:
> On Wed, Jul 3, 2013 at 10:44 AM, James Hogan <james.hogan@imgtec.com> wrote:
>> (cc'ing linux-arch and linux-kbuild)
>>
>> On 03/07/13 01:45, Rusty Russell wrote:
>>> James Hogan <james.hogan@imgtec.com> writes:
>>>> Move all EXPORT_SYMBOLs in libs-y directories (arch/metag/{lib,tbx})
>>>> into metag_ksyms.c so that they don't get omitted by the static linker
>>>> if they're not used by any other statically linked code, which can
>>>> result in undefined symbols when building modules.
>>>>
>>>> For example a randconfig caused the following error:
>>>> ERROR: "csum_partial" [fs/reiserfs/reiserfs.ko] undefined!
>>>>
>>>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>>>> Cc: Rusty Russell <rusty@rustcorp.com.au>
>>>> ---
>>>> Unless there are any objections I'll apply this patch for v3.11. I'm
>>>> assuming *_ksyms.c is the way that this problem is normally worked
>>>> around.
>>>
>>> Actually, normally those files are obj-y not lib-y.  See the top-level
>>> lib/.
>>>
>>> Subtle, I know.
>>
>> Hmm, subtle indeed, I hadn't noticed that.
>>
>> grepping for EXPORT_SYMBOL(csum_partial) gives:
>>
>> ./arch/avr32/kernel/avr32_ksyms.c
>> ./arch/sparc/lib/ksyms.c
>> ./arch/sh/kernel/sh_ksyms_32.c
>> ./arch/powerpc/kernel/ppc_ksyms.c
>> ./arch/unicore32/kernel/ksyms.c
>> ./arch/x86/um/ksyms.c
>> ./arch/x86/kernel/x8664_ksyms_64.c
>> ./arch/x86/kernel/i386_ksyms_32.c
>> ./arch/cris/kernel/crisksyms.c
>> ./arch/mips/kernel/mips_ksyms.c
>> ./arch/xtensa/kernel/xtensa_ksyms.c
>> ./arch/arm/kernel/armksyms.c
>>
>> ./arch/ia64/lib/checksum.c
>> ./arch/alpha/lib/checksum.c
>> ./arch/c6x/lib/checksum.c
>> ./arch/mn10300/lib/checksum.c
>> ./arch/cris/arch-v10/lib/old_checksum.c
>> ./arch/h8300/lib/checksum.c
>> ./arch/parisc/lib/checksum.c
>> ./arch/m32r/lib/csum_partial_copy.c
>> ./arch/m68k/lib/checksum.c
>> ./arch/metag/lib/checksum.c
>> ./arch/frv/lib/checksum.c
>>
>> ./lib/checksum.c
>>
>> All of the above arches have *c*sum.o in lib-y. Should they all be
>> switched to obj-y or the remaining EXPORT_SYMBOLs moved to *ksyms.c if
>> this problem is noticed?
> 
> There are more, cfr. https://lkml.org/lkml/2013/5/29/76 ("[PATCH/RFC] sh: Always
> link in helper functions extracted from libgcc"), which no one replied to.

Moving the EXPORT_SYMBOL into */ksyms.c would seem to make the
inclusion/exclusion of unused lib-y objects automatic:
With CONFIG_MODULES=y the EXPORT_SYMBOL in *ksyms.c would ensure it is
included.
With CONFIG_MODULES=n the EXPORT_SYMBOL would be preprocessed out and it
could be unused and excluded.

(although it is of course uglier to separate it from the definition).

Cheers
James


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-03  9:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1372774074-18553-1-git-send-email-james.hogan@imgtec.com>
     [not found] ` <87bo6kfp32.fsf@rustcorp.com.au>
2013-07-03  8:44   ` [PATCH] metag: move EXPORT_SYMBOLs in libs to metag_ksyms.c James Hogan
2013-07-03  8:44     ` James Hogan
2013-07-03  8:50     ` Geert Uytterhoeven
2013-07-03  8:50       ` Geert Uytterhoeven
2013-07-03  9:14       ` James Hogan
2013-07-03  9:14         ` James Hogan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox