From owner-freebsd-mips@FreeBSD.ORG Mon Nov 21 16:48:24 2011 Return-Path: Delivered-To: freebsd-mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA3BC1065672 for ; Mon, 21 Nov 2011 16:48:24 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2328FC18 for ; Mon, 21 Nov 2011 16:48:24 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pALGgdpt060079 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 21 Nov 2011 09:42:41 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Mon, 21 Nov 2011 09:42:33 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Monthadar Al Jaberi X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 21 Nov 2011 09:42:42 -0700 (MST) Cc: freebsd-mips@FreeBSD.org Subject: Re: Cross compiling module X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 16:48:25 -0000 On Nov 21, 2011, at 6:28 AM, Monthadar Al Jaberi wrote: > Hi! >=20 > Not sure if this is the right place :) >=20 > I have written a kernel module with the following Makefile: > .PATH: ${.CURDIR}/src >=20 > # Declare Name of kernel module > KMOD =3D moduletest >=20 > # Enumerate Source files for kernel module > SRCS =3D module.c >=20 > # Include kernel module makefile > .include >=20 > then > cd /usr/src > make TARGET=3Dmips TARGET_ARCH=3Dmipseb buildenv I usually do make buildenv (puts you into a subshell) cd /root/mymodule make > cd /root/mymodule > make >=20 > but I get the following error: I'm surprised you got the mips compiler. What's your environment look = like? What's @ pointing to? Warner > 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=3D8000 > --param inline-unit-growth=3D100 --param large-function-growth=3D1000 > -fno-common -G0 -fno-pic -mno-abicalls > -mlong-calls -msoft-float -ffreestanding -std=3Diso9899: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 >=20 > Stop in /root/mymodule. >=20 >=20 > $ which cc > /usr/obj/mips.mipseb/usr/src/tmp/usr/bin/cc >=20 > $find /usr -name "opt_cputype.h" > ... > /usr/obj/mips.mipseb/usr/src/sys/RSPRO_NFS/opt_cputype.h >=20 > if I add: > CFLAGS+=3D-I/usr/obj/mips.mipseb/usr/src/sys/RSPRO_NFS >=20 > it works now, seems like I am missing something? >=20 > br, >=20 > --=20 > 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 >=20