Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Nov 2011 17:54:55 +0100
From:      Monthadar Al Jaberi <monthadar@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: Cross compiling module
Message-ID:  <CA%2BsBSo%2Bcs=CpowX2gtZTcFbNxLsrkO3wMVFK6JDNoHJu%2BhO6qw@mail.gmail.com>
In-Reply-To: <F3365D29-47B7-4DDD-8CE8-DD7758785249@bsdimp.com>
References:  <CA%2BsBSoK0jYhZj=4kjdNp40yyWR7_dQHuv3DsXe6ihb%2Bd81WOWw@mail.gmail.com> <F3365D29-47B7-4DDD-8CE8-DD7758785249@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 21, 2011 at 5:42 PM, Warner Losh <imp@bsdimp.com> wrote:
>
> On Nov 21, 2011, at 6:28 AM, Monthadar Al Jaberi wrote:
>
>> Hi!
>>
>> Not sure if this is the right place :)
>>
>> I have written a kernel module with the following Makefile:
>> .PATH: =A0 =A0 =A0 =A0${.CURDIR}/src
>>
>> # Declare Name of kernel module
>> KMOD =A0 =A0=3D moduletest
>>
>> # Enumerate Source files for kernel module
>> SRCS =A0 =A0=3D =A0module.c
>>
>> # Include kernel module makefile
>> .include <bsd.kmod.mk>
>>
>> then
>> cd =A0/usr/src
>> make TARGET=3Dmips TARGET_ARCH=3Dmipseb buildenv
>
> I usually do
>
> make buildenv
> (puts you into a subshell)
> cd /root/mymodule
> make
>

I am sorry if I am wrong, but am I not doing the same thing as you? I
am also inside a subshell.

>> cd /root/mymodule
>> make
>>
>> but I get the following error:
>
> I'm surprised you got the mips compiler. =A0What's your environment look =
like? =A0What's @ pointing to?

@ -> /usr/src/sys
machine -> /usr/src/sys/mips/include

>
> Warner
>
>> Warning: Object directory not changed from original /root/mymodule
>> cc -O -pipe -G0 -Werror -D_KERNEL -DKLD_MODULE -nostdinc =A0 -I. -I@
>> -I@/contrib/altq -finline-limit=3D8000
>> --param inline-unit-growth=3D100 --param large-function-growth=3D1000
>> -fno-common =A0-G0 -fno-pic -mno-abicalls
>> -mlong-calls =A0-msoft-float -ffreestanding -std=3Diso9899:1999 -Wall
>> -Wredundant-decls -Wnested-externs -Wstrict-prototypes
>> =A0-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual =A0-Wundef
>> -Wno-pointer-sign -fformat-extensions =A0-Wmissing-include-dirs
>> -fdiagnostics-show-option -c /root/src/mymodule/src/module.c
>> In file included from ./machine/bus.h:76,
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 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.
>>
>>
>> $ which cc
>> /usr/obj/mips.mipseb/usr/src/tmp/usr/bin/cc
>>
>> $find /usr -name "opt_cputype.h"
>> ...
>> /usr/obj/mips.mipseb/usr/src/sys/RSPRO_NFS/opt_cputype.h
>>
>> if I add:
>> CFLAGS+=3D-I/usr/obj/mips.mipseb/usr/src/sys/RSPRO_NFS
>>
>> it works now, seems like I am missing something?
>>
>> br,
>>
>> --
>> Monthadar Al Jaberi
>> _______________________________________________
>> freebsd-mips@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-mips
>> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"
>>
>>
>
>



--=20
Monthadar Al Jaberi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BsBSo%2Bcs=CpowX2gtZTcFbNxLsrkO3wMVFK6JDNoHJu%2BhO6qw>