I still have not been able to get this to work (according the kernel documentation, the Makefile is correct, so I have no idea why it does not), so I have been trying to compile it without the Makefile. This is what I have got so far:
Code:
$ make -C /usr/src/linux M=/home/matthew/src/c/modules/omap-owire-dev modules
omap-owire.o is created, along with .omap_owire.o.cmd and .tmp_versions/omap_owire.mod.
Code:
$ cd /usr/src/linux
$ ./scripts/mod/modpost -i Module.symvers vmlinux /home/matthew/src/c/modules/omap-owire-dev/omap_owire.o
omap_owire.mod.c is now created.
Code:
$ arm-linux-gcc -Wp,-MD,/home/matthew/src/c/modules/omap-owire-dev/omap_owire.mod.d -nostdinc \
-isystem/usr/local/arm/4.0.1/bin/../lib/gcc/arm-linux/4.0.1/include -D__KERNEL__ -Iinclude -DMODULE -c -o \
/home/matthew/src/c/modules/omap-owire-dev/omap_owire.mod.o /home/matthew/src/c/modules/omap-owire-dev/omap_owire.mod.c
I now also have omap_owire.mod.o and omap_owire.mod.d. From here, it should be simple to finish (or so I thought).
Code:
$ arm-linux-gcc -r -o omap_owire.ko omap_owire.o omap_owire.mod.o
/usr/local/arm/4.0.1/bin/../lib/gcc/arm-linux/4.0.1/../../../../arm-linux/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
If I look in lib/, I can see libgcc_s.so -> libgcc_s.so.1, and if I try to compile anything else and explicitly add -lgcc_s to the arguments, it all works fine. I have tried all sorts of things (eg -Ldirectory), but cannot seem to get rid of this last error. I also cannot explain why I have the original problem, but that is another issue. Any suggestions for either problem would be greatly appreciated!