From owner-freebsd-emulation Tue Feb 22 12:21:23 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from goliath.siemens.de (goliath.siemens.de [194.138.37.131]) by hub.freebsd.org (Postfix) with ESMTP id 04EDA37B730 for ; Tue, 22 Feb 2000 12:21:08 -0800 (PST) (envelope-from andre.albsmeier@mchp.siemens.de) X-Envelope-Sender-Is: andre.albsmeier@mchp.siemens.de (at relayer goliath.siemens.de) Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by goliath.siemens.de (8.9.3/8.9.3) with ESMTP id VAA24328 for ; Tue, 22 Feb 2000 21:21:00 +0100 (MET) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7]) by mail2.siemens.de (8.9.3/8.9.3) with ESMTP id VAA13444 for ; Tue, 22 Feb 2000 21:21:00 +0100 (MET) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.9.3/8.9.3) id VAA32172 for ; Tue, 22 Feb 2000 21:21:00 +0100 (CET) Date: Tue, 22 Feb 2000 21:20:57 +0100 From: Andre Albsmeier To: Marcel Moolenaar Cc: Andre Albsmeier , freebsd-emulation@FreeBSD.ORG Subject: Re: How to link a Linux program under FreeBSD ? Message-ID: <20000222212057.A46560@internal> References: <20000221214203.A72944@internal> <38B2D26B.8E280F5C@cup.hp.com> <20000222193545.A45196@internal> <38B2DE7C.FEFE45@cup.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <38B2DE7C.FEFE45@cup.hp.com>; from marcel@cup.hp.com on Tue, Feb 22, 2000 at 07:07:40PM +0000 Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, 22-Feb-2000 at 19:07:40 +0000, Marcel Moolenaar wrote: > Andre Albsmeier wrote: > > > > > Rule of thumb: From within a Linux shell you always pick up the linux > > > binaries and not the FreeBSD native ones. > > > > Yes, thanks for the hint. I have also been told that I can > > put /compat/linux/bin and /compat/linux/usr/bin first in my PATH. > > I tried it and it works as well. > > Beware! Having /compat/linux... first in your path can cause breakages > in your native environment. It basicly causes unwanted mixing of FreeBSD > and Linux binaries. The same applies to setting LD_LIBRARY_PATH to solve > shared library problems. Keep both environments seperate as much as > possible and don't depend on inter-environmental environment variables > :-) OK, I should have been more precise here: I have a script that calls the Absoft Fortran compiler. When compiling is done, the script calls cc -o ... I set PATH only in this script to /compat/linux/bin and /compat/linux/usr/bin, not in my working environment :-) > > > I assume that this works also for the libs and the crt1 stuff. > > No, the linux binaries happen to pick up the linux libraries first most > of the time. There are situations where a FreeBSD library is found first > (see below)... > > > I think, the only problem arises if, e.g. I specify some > > lib that doesn't exist under /compat/linux but under FreeBSD. > > In this case I assume that the FreeBSD lib is being used. > > Correct. Sometimes the search order used by ld(1) causes this as well. > In that case the Linux library can exist while the FreeBSD version is > used anyway... I see, thanks for the info. The best would be to have somekind of intelligent chroot when linux bins are running. The problem lies in implementing "intelligent" :-) Thanks again, -Andre > > -- > Marcel Moolenaar > mail: marcel@cup.hp.com / marcel@FreeBSD.org > tel: (408) 447-4222 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message