From owner-freebsd-mips@FreeBSD.ORG Mon Nov 21 13:53:43 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 2E6821065673 for ; Mon, 21 Nov 2011 13:53:43 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id E899C8FC0A for ; Mon, 21 Nov 2011 13:53:42 +0000 (UTC) Received: by ggnk5 with SMTP id k5so6228806ggn.13 for ; Mon, 21 Nov 2011 05:53:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=f428tavL/VHmgMt0UzBr1p8zb1PkkNI79NE+u/z5/vY=; b=Lzk/8KpRF/HIJb1ff55Ro2X1ZEQOWDjxc+DhAUhVacMk89Q6QRS/z8Q0qZBN43Op/D 2SCjMsJgPdr4QyByYRD5EPRyfCF3BOelNOpFww/rWdF5Beoe8TcpdnYv3gnLo2zhZjKF 8jxjo02RBY/+IFVb9Z3PoShRuvDCGE/23mCcU= MIME-Version: 1.0 Received: by 10.50.185.232 with SMTP id ff8mr14527744igc.32.1321882136289; Mon, 21 Nov 2011 05:28:56 -0800 (PST) Received: by 10.50.100.132 with HTTP; Mon, 21 Nov 2011 05:28:56 -0800 (PST) Date: Mon, 21 Nov 2011 14:28:56 +0100 Message-ID: From: Monthadar Al Jaberi To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: 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 13:53:43 -0000 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. $ 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+=-I/usr/obj/mips.mipseb/usr/src/sys/RSPRO_NFS it works now, seems like I am missing something? br, -- Monthadar Al Jaberi