From owner-freebsd-questions@FreeBSD.ORG Thu Nov 27 16:05:40 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AC4E106564A for ; Thu, 27 Nov 2008 16:05:40 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail8.sea5.speakeasy.net (mail8.sea5.speakeasy.net [69.17.117.10]) by mx1.freebsd.org (Postfix) with ESMTP id 33F9A8FC16 for ; Thu, 27 Nov 2008 16:05:40 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 8243 invoked from network); 27 Nov 2008 16:05:39 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail8.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 27 Nov 2008 16:05:39 -0000 Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.6]) by be-well.ilk.org (Postfix) with ESMTP id 6C3A450822; Thu, 27 Nov 2008 11:05:36 -0500 (EST) Received: by lowell-desk.lan (Postfix, from userid 1147) id CDAC01D008; Thu, 27 Nov 2008 11:05:34 -0500 (EST) To: Xavier Otazu References: <20081121120023.D64301065720@hub.freebsd.org> <44ej0z4lo4.fsf@be-well.ilk.org> <20081125212213.6fd1dcc1@cvc131.uab.es> From: Lowell Gilbert Date: Thu, 27 Nov 2008 11:05:34 -0500 In-Reply-To: <20081125212213.6fd1dcc1@cvc131.uab.es> (Xavier Otazu's message of "Tue\, 25 Nov 2008 21\:22\:13 +0100") Message-ID: <44r64xkvch.fsf@lowell-desk.lan> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: stas@freebsd.org, freebsd-questions@freebsd.org Subject: Re: gcc cross-compiler for linux X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Nov 2008 16:05:40 -0000 Xavier Otazu writes: > Thanks a lot for this link. Now I see that I need to use the > cross-gcc compiler. I've never done it; I just looked it up. I'm sure there's more information in the archives of the mailing lists, and you can always try to consult the port maintainer. > I am using Matlab inside the linux emulator, and I nedd to create some > "mex" files from matlab. In order to create these mes files, matlab > needs access to a gcc compiler that produces linux elf files. I think I > cannot use the gentoo-stage3 port, because in order to use I would need > to chroot and it is not so easy from matlab. Also, when using this > compiler I should be able to acces to the "linux"-matlab header files, > but if I "chroot" to the gentoo port I won't be able to access them. They should be inside the compat/linux tree, and therefore accessible. > I tried to install the devel/cross-gcc port, but I get errors when > compiling it. Um, fix the errors? > I have some doubts about the wiki link you sent me: > > 1) What really means "null-mount the home directory"? I google-d some > info, but I didn't find good information. What really exactly means > "corresponding entries in the passwd and shadow files are required > then"? a) "man mount_nullfs" b) I would guess that /compat/linux/etc/{passwd,shadow} need to have entries to match your /etc/master.passwd. I can't check for sure > 2) What really means "All you have to do is to compile the ports and > add includes and libs from the linux system your target in your > development"? Do I have to include the linux headers during > devel/cross-gcc port building? Or do I have to include them when > cross-compiling my code? Logically, I would think that would apply to compiling *your* code. Anything that's need to build the port should be handled by the port itself. > What options do I have to use when building the linux gcc > cross-compiler? I use I don't know; all I can tell you is that you seem to be on the right path here. > make TGTARCH=i386 TGTABI=linux install clean > > Thanks a lot for your help > > Cheers > > Xavier > > On Tue, 25 Nov 2008 15:04:27 -0500 > Lowell Gilbert wrote: > >> Xavier Otazu writes: >> >> > I would like to compile a C++ code to be executed within the linux >> > emulator. >> >> http://wiki.freebsd.org/linux-xdev Good luck. -- Lowell Gilbert, embedded/networking software engineer, Boston area http://be-well.ilk.org/~lowell/