From owner-freebsd-mips@FreeBSD.ORG Mon Nov 21 20:31:20 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 18E681065673 for ; Mon, 21 Nov 2011 20:31:20 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id C22BB8FC0A for ; Mon, 21 Nov 2011 20:31:19 +0000 (UTC) Received: from orion.SpringDaemons.com (207.47.0.2.static.nextweb.net [207.47.0.2]) by mx0.deglitch.com (Postfix) with ESMTPA id 533108FC3A; Tue, 22 Nov 2011 00:31:18 +0400 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id EA32062DE; Mon, 21 Nov 2011 12:30:29 -0800 (PST) Date: Mon, 21 Nov 2011 12:30:29 -0800 From: Stanislav Sedov To: Monthadar Al Jaberi Message-Id: <20111121123029.2f844bb7.stas@FreeBSD.org> In-Reply-To: References: Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 20:31:20 -0000 On Mon, 21 Nov 2011 14:28:56 +0100 Monthadar Al Jaberi 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 > > 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