From owner-freebsd-mips@FreeBSD.ORG Mon Nov 21 16:54:56 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 4F75F1065674 for ; Mon, 21 Nov 2011 16:54:56 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1B68F8FC14 for ; Mon, 21 Nov 2011 16:54:55 +0000 (UTC) Received: by iakl21 with SMTP id l21so10966377iak.13 for ; Mon, 21 Nov 2011 08:54:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=c+jNfatH0i32dbKeytAVZQr53KivolFZz2PLgAdy/d8=; b=sz4NyDJw2EvKcwF8HBpe5FV3dtxZxElLnRVdgP9NPN4CqYK7ryx1jp9K9HEWxoq+tm iLpfWNbSnWZJ54ISAKZ6nON1T64/nl/LhGymMuYbXPPPk0/oOXmtMD3I1FohSFhrfAuy dVceXQjMONQ1oK/gVcQDGyLF/47CmALKMu5vU= MIME-Version: 1.0 Received: by 10.42.147.72 with SMTP id m8mr15043975icv.56.1321894495333; Mon, 21 Nov 2011 08:54:55 -0800 (PST) Received: by 10.50.100.132 with HTTP; Mon, 21 Nov 2011 08:54:55 -0800 (PST) In-Reply-To: References: Date: Mon, 21 Nov 2011 17:54:55 +0100 Message-ID: From: Monthadar Al Jaberi To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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:54:56 -0000 On Mon, Nov 21, 2011 at 5:42 PM, Warner Losh 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 >> >> 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