Re: SMP kernels and linking

Keith Owens (kaos@ocs.com.au)
Tue, 26 Oct 1999 18:57:19 +1000


On Tue, 26 Oct 1999 04:27:38 -0400,
Lee Rhodes <LeeR@eicon.com> wrote:
>I have a driver/module that complains when I insmod it. There are some
>unresolved symbols. When I do a cat /proc/ksyms I can see the symbols are
>there but they have _Rsmp_xxxxxxxx appended to them. I'm working on a
>Caldera OpenLinux machine with kernel 2.2.10 (SMP support compiled in). I am
>using the -D__SMP__ define (along with 'regular' flags). I presume there is
>something wrong with the linking. I am building my module on its own (not in
>the Linux source tree).
>
>Can anyone drop any hints?

You *really* should use the kernel Makefile structure instead of using
your own Makefiles. You have built your module without kernel symbols
but the kernel was built with symbols, instant mismatch. You almost
guarantee this sort of problem when you roll your own Makefile. You
need to compile *exactly* the same way that the kernel was compiled so
why not hook your code into the kernel tree?

All you need to do is copy your code into the kernel tree as (say)
directory local, change the SUBDIRS line in the top level Makefile to
include local and use a Linux style Makefile in local (take a look at
net/ipv4/Makefile as an example). Then make modules will build your
module exactly the same way as the kernel and all the other modules
were built. local can even be a symlink to your own directory.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/