From owner-freebsd-questions@FreeBSD.ORG Mon Apr 12 03:22:24 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 597DA16A4CE for ; Mon, 12 Apr 2004 03:22:24 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A1DE43D41 for ; Mon, 12 Apr 2004 03:22:22 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i3CAMDg5045788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Apr 2004 11:22:13 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i3CAMDfW045787; Mon, 12 Apr 2004 11:22:13 +0100 (BST) (envelope-from matthew) Date: Mon, 12 Apr 2004 11:22:13 +0100 From: Matthew Seaman To: Eric De la Cruz Lugo Message-ID: <20040412102213.GA7692@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Eric De la Cruz Lugo , freebsd-questions@freebsd.org References: <1081751327.407a371fa817f@iteso.mx> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <1081751327.407a371fa817f@iteso.mx> User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk X-Virus-Scanned: clamd / ClamAV version devel-20040407, clamav-milter version 0.70g cc: freebsd-questions@freebsd.org Subject: Re: Porting software to FreeBSD 5.2.1 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2004 10:22:24 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 12, 2004 at 01:28:47AM -0500, Eric De la Cruz Lugo wrote: > You probably know that libc is the library that includes all the standard= C=20 > commands (such as printf, read, open, etc.and so on) as well as system ca= lls.=20 > Up until 1997, the only library available was the GNU libc v1, which sinc= e the=20 > move to ELF binary format was given major number 5 (/lib/libc.so.5). In 1= 997,=20 > the Free Software Foundation developed GNU libc v2, with the intention of= =20 > being cleaner, more portable, and more standard (POSIX compliant). Under= =20 > Linux, this version got major number 6, hence it's called libc6. These tw= o=20 > libraries are incompatible - if a program is compiled with one libc's hea= ders=20 > and stubs, it can't be used with the other.=20 > =20 > =20 > any one knows how i can use the libc6 in the linux compat directory? i ha= ve=20 > checked on my sistem and in fact i have it! =20 > =20 > /usr/compat/linux/lib/libc.so.6=20 Well, Linux is not FreeBSD. And vice-versa. You're trying to compile this code as FreeBSD native, so you don't want to use the libraries under /usr/compat/linux at all -- those are there for the benefit of Linux binaries run under emulation. The libc version number in FreeBSD is the same as the major version number of the OS, so your FreeBSD 5.2.1 system has: /usr/lib/libc.so.5 -- single threaded libc /usr/lib/libc_r.so.5 -- reentrant (for multiply threaded) libc Now, the problem you're running into is that certain similar function calls etc. have an API similar enough that you can get the code to compile, but that differ in subtle but significant ways in operation. This can lead to core dumps and other effects as you've seen. Unfortunately there is no simple way to resove that sort of problem. You need to run the problem code under the debugger, work out why it is blowing up and produce patches to the source code that fix the problem. It helps if you have an intimate knowledge of the FreeBSD libc and preferably the Linux/GNU libc and where the incompatabilities are likely to occur. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAem3VdtESqEQa7a0RAu+CAJ4zpxni9zIcRbRCOUUwJUddrwd/LgCcCGol imJmk1ir9m6Tm1A+S1FkX1I= =ya/W -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--