depmod: Unresolved symbols in .../hostap.o: memcmp

Peter S. Mazinger ps.m at gmx.net
Thu Jan 12 11:44:13 UTC 2006


On Wed, 11 Jan 2006, Eric Malkowski wrote:

> This smells an aweful lot like a problem I had when building the MADWIFI
> driver for my soekris net4826 boards.
> 
> With the soekris type kernel config (through i586 instructions only for
> the GEODE target), I needed to add a patch to the kernel to export just
> memcmp -- memcpy and memset are already exported.  Same problem you're
> having.  This was w/ kernel 2.4 -- perhaps the same thing happens w/ 2.6
> or perhaps you're also using 2.4
> 
> If it's of any help, here's the patch from an older buildroot I was using
> at the time:
> 
> [malk at miniserv kernel-patches]$ bzcat 101_export-memcmp-for-madwifi.bz2
> --- linux-2.4.28-pre4-bvwireless/arch/i386/kernel/i386_ksyms.c  2004-12-27
> 12:45:06.000000000 -0500
> +++ linux-patch/arch/i386/kernel/i386_ksyms.c   2004-12-27
> 12:47:26.000000000 -0500
> @@ -170,10 +170,13 @@
> 
>  #undef memcpy
>  #undef memset
> +#undef memcmp
>  extern void * memset(void *,int,__kernel_size_t);
>  extern void * memcpy(void *,const void *,__kernel_size_t);
> +extern int memcmp(const void *,const void *,__kernel_size_t);
>  EXPORT_SYMBOL_NOVERS(memcpy);
>  EXPORT_SYMBOL_NOVERS(memset);
> +EXPORT_SYMBOL_NOVERS(memcmp);
> 
>  #ifdef CONFIG_HAVE_DEC_LOCK
>  EXPORT_SYMBOL(atomic_dec_and_lock);
> [malk at miniserv kernel-patches]$ pwd
> /home/malk/buildroot/package/linux/kernel-patches
> 
> For the newer buildroot, you would want to create a patch against your
> kernel sources and drop the bzip'd patch under
> buildroot/target/device/Soekris/net4521/kernel-patches
> 
> An alternative would be to unpack the kernel source that ends up in the dl
> directory, modify arch/i386/kernel/i386_ksyms.c to add the 3 lines that
> export memcmp for you like my patch above, and re-tar and zip the kernel
> source and place it overtop the original in the DL dir and buildroot won't
> download it again overwriting the changes.
> 
> Then rm -rf build_i386/linux-2.x.x and re-make buildroot and it will just
> rebuild the kernel for you.
> 
> Then rm -rf build_i386/hostapd and it will rebuild the hostap kernel
> module against your new kernel and it can depmod on your build box (suse)
> against the symbols that go w/ your target kernel that has memcmp exported
> and the problem is solved.
> 
> Hope this helps -- I scratched my head for a few hours on that one w/
> MADWIFI.  I never determined the root cause for needing to export that
> symbol.  Looks like the hostapd kernel module can trigger the same
> behavior.

the problem occurs with other modules as well (even vanilla), not 
only hostap, gcc-3.4.x in conjunction w/ kernel-2.4 is the problem 
(gcc-3.3.x is ok)

Peter
> 
> Good luck,
> 
> -Eric Malkowski
> 
> 
> > Once again, I am looking for pointers for where to look for the source of
> > a
> > problem.
> >
> > I am compiling a buildroot environment for a Soekris net4521 target with
> > the
> > "Generic wireless access point" and "Generic firewall" options turned on.
> >
> > When I build this, it fails when running depmod.  I am at a loss to
> > understand why depmod would complain about not being able to find
> > 'memcmp()', when it seems as though it found 'memcpy()', 'memset()',
> > etc...
> > fine.  What's more confusing is that System.map lists both memcpy and
> > memcmp.
> >
> > Could I have a broken depmod on my build system (a SuSE 9.1 box)?
> >
> > Is there something obvious I'm missing?
> >
> > --wpd
> >
> >
> 
> 
> 

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list