Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Nov 2011 12:30:29 -0800
From:      Stanislav Sedov <stas@FreeBSD.org>
To:        Monthadar Al Jaberi <monthadar@gmail.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: Cross compiling module
Message-ID:  <20111121123029.2f844bb7.stas@FreeBSD.org>
In-Reply-To: <CA%2BsBSoK0jYhZj=4kjdNp40yyWR7_dQHuv3DsXe6ihb%2Bd81WOWw@mail.gmail.com>
References:  <CA%2BsBSoK0jYhZj=4kjdNp40yyWR7_dQHuv3DsXe6ihb%2Bd81WOWw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 21 Nov 2011 14:28:56 +0100
Monthadar Al Jaberi <monthadar@gmail.com> mentioned:

> Hi!
> 
> Not sure if this is the right place :)
> 
> I have written a kernel module with the following Makefile:
> .PATH:	${.CURDIR}/src
> 
> # Declare Name of kernel module
> KMOD    = moduletest
> 
> # Enumerate Source files for kernel module
> SRCS    =  module.c
> 
> # Include kernel module makefile
> .include <bsd.kmod.mk>
> 
> then
> cd  /usr/src
> make TARGET=mips TARGET_ARCH=mipseb buildenv
> cd /root/mymodule
> make
> 
> but I get the following error:
> Warning: Object directory not changed from original /root/mymodule
> cc -O -pipe -G0 -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@
> -I@/contrib/altq -finline-limit=8000
>  --param inline-unit-growth=100 --param large-function-growth=1000
> -fno-common  -G0 -fno-pic -mno-abicalls
>  -mlong-calls  -msoft-float -ffreestanding -std=iso9899:1999 -Wall
> -Wredundant-decls -Wnested-externs -Wstrict-prototypes
>   -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
> -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
> -fdiagnostics-show-option -c /root/src/mymodule/src/module.c
> In file included from ./machine/bus.h:76,
>                  from /root/mymodule/module.c:57:
> ./machine/_bus.h:37:26: error: opt_cputype.h: No such file or directory
> *** Error code 1
> 
> Stop in /root/mymodule.

Hi!

I think you might need to pass the KERNCONF variable so it will find
the right kernel.

-- 
Stanislav Sedov
ST4096-RIPE

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111121123029.2f844bb7.stas>