모듈빌드시 에러가 발생합니다.
안녕하세요.
모듈빌드시 아래와 같은 에러가 발생하는데요.
해결 방법을 아시는 분이 계시면 지도 부탁드립니다.
[root@localhost test]# make
make -C /home/hongyabi/sti_kernel/Speed_Kernel SUBDIRS=/home/hongyabi/test modules
make[1]: Entering directory `/home/hongyabi/sti_kernel/Speed_Kernel'
CC [M] /home/hongyabi/test/hello.o
cc1: error: unrecognized command line option "-msoft-float"
make[2]: *** [/home/hongyabi/test/hello.o] Error 1
make[1]: *** [_module_/home/hongyabi/test] Error 2
make[1]: Leaving directory `/home/hongyabi/sti_kernel/Speed_Kernel'
make: *** [default] Error 2
[root@localhost test]#
모듈빌드에 사용된 hello.c 파일은 다음과 같고.
[root@localhost test]# cat hello.c
int hellow_init(void)
{
printk("<1>Hello, world\n");
return 0;
}
void hellow_exit(void)
{
printk("<1>Goodbye cruel Worled\n");
}
module_init(hellow_init);
module_exit(hellow_exit);
[root@localhost test]#
모듈빌드에 사용된 makefile은 다음과 같습니다.
[root@localhost test]# cat Makefile
obj-m := hello.o
KDIR := /home/hongyabi/sti_kernel/Speed_Kernel
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -rf *.ko
rm -rf *.mod.*
rm -rf .*.cmd
rm -rf *.o
[root@localhost test]#
리눅스 PC는 레드햇 9.0을 사용하고 있는 STM이라는 tool-chain을 이용하여 cross-build로 모듈을 빌드하려고 하였습니다.
원인이 무엇일까요?
고수님들의 의견 부탁드립니다.
$(MAKE) -C $(KDIR)
로 고치고
처럼 해서 결과를 보세요. 컴파일러가 잘못 지정되어 있겠지요.
이런거 어떻게 아느냐고요 ?
하면 보실 수 있습니다.
/home/hongyabi/sti_kernel/Speed_Kernel
디렉토리에서 make zImage 를 했을 때 성공해야만 합니다.
ARCH, CROSS_COMPILE 을 따로 지정하는 방법이 없는 것은 아니지만,
기초가 부실하면 나중에 같은 문제로 또 삽질하십니다.
...두고 볼 수가 없어서 댓글을 달긴했지만... 솔직히 지금 이 순간에도 취소하고 싶은 마음이 굴뚝같습니다.
다른 데 갈 필요도 없이 바로 여기 KLDP 에서 검색 ... 부탁드립니다.
OTL
댓글 달기