Date: Mon, 12 Apr 2004 11:22:13 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Eric De la Cruz Lugo <eric@iteso.mx> Cc: freebsd-questions@freebsd.org Subject: Re: Porting software to FreeBSD 5.2.1 Message-ID: <20040412102213.GA7692@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <1081751327.407a371fa817f@iteso.mx> References: <1081751327.407a371fa817f@iteso.mx>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040412102213.GA7692>