From owner-freebsd-arm@FreeBSD.ORG Fri Sep 30 09:09:00 2011 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B719C106566C for ; Fri, 30 Sep 2011 09:09:00 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 445DA8FC0C for ; Fri, 30 Sep 2011 09:08:59 +0000 (UTC) Received: from [192.168.99.1] (helo=terran.dlink.ua) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1R9Z5I-0005az-Qd; Fri, 30 Sep 2011 12:08:46 +0300 Date: Fri, 30 Sep 2011 12:09:37 +0300 From: Aleksandr Rybalko To: John-Mark Gurney Message-Id: <20110930120937.fee3590e.ray@dlink.ua> In-Reply-To: <20110929232933.GC14645@funkthat.com> References: <1317195615589-4848235.post@n5.nabble.com> <20110928133448.65441459.ray@dlink.ua> <1317290169064-4852474.post@n5.nabble.com> <20110929131256.28cf6240.ray@dlink.ua> <20110929232933.GC14645@funkthat.com> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org, satish kondapalli Subject: Re: How to cross compile a kernel module? X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 09:09:00 -0000 On Thu, 29 Sep 2011 16:29:33 -0700 John-Mark Gurney wrote: >> Aleksandr Rybalko wrote this message on Thu, Sep 29, 2011 at 13:12 >> +0300: >> > On Thu, 29 Sep 2011 02:56:09 -0700 (PDT) >> > satish kondapalli wrote: >> > >> > >> Thanks Aleksandr, >> > >> After adding "MODULES_OVERRIDE" option in the kernel config, my >> > >> module got compiled. >> > >> >> > >> But every time while building my module, the entire kernel also >> > >> compiled. is there any better mechanism to just cross compile >> > >> the module with out building the entire Kernel. >> > >> > To avoid recompile all things - do make KERNFAST=configname kernel. >> > >> > Maybe someone also show better way to cross compile one module, >> > but I don't know. >> >> I haven't tested this in a long time, but if you do: >> make buildenv >> >> from the root of your tree, it should setup your path w/ all the >> necessary cross-tools in your path, etc... Then you can go into the >> module directory and do a make manually.. Yep, indeed, worked! SRC=/usr/src OBJ=/usr/obj cd ${SRC} make TARGET=arm TARGET_ARCH=armeb TARGET_CPU=xscale buildenv # There is check ${PATH} to have toolchain in that dirs if [ ! -x ${OBJ}/${TARGET}.${TARGET_ARCH}/${SRC}/tmp/usr/bin/cc ]; then make kernel-toolchain fi # Or just do make -DNO_CLEAN kernel-toolchain cd sys/modules/module/you/need make Thank you John-Mark! >> >> -- >> John-Mark Gurney Voice: +1 415 225 >> 5579 >> >> "All that I will do, has been done, All that I have, has not." -- Alexandr Rybalko aka Alex RAY