Hi all!
I started to write test kernel module, but when compiling I get error:
Once I added to the make.conf line:
building finished, but when trying to load module, I get error:
Help me please understand what I'm doing wrong.
Source for module attached. Thanks
View attachment fclst.c
I started to write test kernel module, but when compiling I get error:
Code:
# make
"/sys/conf/kmod.mk", line 116: Malformed conditional (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang")
"/sys/conf/kmod.mk", line 120: if-less endif
"/sys/conf/kern.mk", line 18: Malformed conditional (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang")
"/sys/conf/kern.mk", line 32: if-less endif "/sys/conf/kern.mk", line 102: Malformed conditional (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang")
"/sys/conf/kern.mk", line 108: if-less endif
make: fatal errors encountered -- cannot continue
Once I added to the make.conf line:
Code:
MK_CLANG_IS_CC=no
building finished, but when trying to load module, I get error:
Code:
# kldload ./fclst.ko
kldload: can't load ./fclst.ko: Exec format error
Help me please understand what I'm doing wrong.
Code:
# uname -a
FreeBSD vagner-wrk.bsdway.ru 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Sun Jul 29 18:34:18 MSK 2012 root@vagner-wrk.bsdway.ru:/usr/obj/usr/src/sys/GENERIC amd64
Code:
# file -s ./fclst.ko
./fclst.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (FreeBSD), not stripped
Code:
# grep -v ^# /etc/make.conf
WITH_NEW_XORG=true
WITH_KMS=true
PERL_VERSION=5.14.2
MK_CLANG_IS_CC=no
Code:
# grep -v ^# Makefile | grep -v ^$
KMOD = fclst
SRCS = fclst.c
KO = ${KMOD}.ko
.include <bsd.kmod.mk>
Source for module attached. Thanks
View attachment fclst.c