From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p0OLr6JG032075 for ; Mon, 24 Jan 2011 22:53:06 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AssBAE6DPU1RZ90wkWdsb2JhbACEFKBYFQEBAgkLCgcRAyGqdgqQQYElgzhzBA X-IronPort-AV: E=Sophos;i="4.60,371,1291590000"; d="scan'208";a="87835145" Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Jan 2011 22:53:04 +0100 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20110124215303.ZTRK19887.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Mon, 24 Jan 2011 21:53:03 +0000 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20110124215303.NCFF20122.aamtaout01-winn.ispmail.ntl.com@romulus.metastack.com>; Mon, 24 Jan 2011 21:53:03 +0000 Received: from Tenor ([172.16.0.11]) (authenticated bits=0) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id p0OLqtle005511 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 24 Jan 2011 21:52:57 GMT From: "David Allsopp" To: =?windows-1251?B?J8zo6u7r4CDR8vC64eru4ic=?= Cc: "'OCaml List'" References: <2ECBF6AC-5DB2-4C79-B6A0-BA9886A2687D@mykola.org> In-Reply-To: <2ECBF6AC-5DB2-4C79-B6A0-BA9886A2687D@mykola.org> Date: Mon, 24 Jan 2011 21:48:48 -0000 Organization: MetaStack Solutions Ltd. Message-ID: <000e01cbbc10$7d00bc90$770235b0$@metastack.com> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHLu+X20VEMLKrdckGnZSeHwDMgSpPgp6Ng Content-Language: en-gb X-Scanned-By: MIMEDefang 2.65 on 81.102.132.77 X-Cloudmark-Analysis: v=1.1 cv=R50lirqlHffDPPkwUlkuVa99MrvKdVWo//yz83qex8g= c=1 sm=0 a=Dyoqhi_TatcA:10 a=lxhFCJHoAuEA:10 a=h5_Tp38J_ScA:10 a=Cfj4BQAnxiAA:10 a=jdhuuv2VRznmfxr26UYA:9 a=CFT0wWogCcPVbcEl8mgA:7 a=O6E0yV_FPFemOkJYHaXDm0-8-sUA:4 a=Ft8UYL4EG9YA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p0OLr6JG032075 Subject: RE: [Caml-list] Forcing gcc/ocamlopt to link against specific versions of libc.so and libm.so Ìèêîëà Ñòðºáêîâ wrote: > Hi, David > > On 24 ñ³÷. 2011, at 17:00, David Allsopp wrote: > > > I'm working with OCaml 3.12.0 on FreeBSD 8.1 and need to produce native > binaries which are compatible with FreeBSD 6.4. I have therefore installed > the compat6x package. FreeBSD 8.1 has /lib/libm.so.5 and /lib/libc.so.7 > and the compat6x package gives me /usr/local/lib/compat/libm.so.4 and > /usr/local/lib/compat/libc.so.6 as they're what shipped in FreeBSD 6.x > > > > My question therefore is twofold: > > > > 1. What do I have to pass to gcc to tell it to use the older libm.so.4 > and libc.so.6? > > Look at the -nostartfiles, -nodefaultlibs and -nostdlib. Those options > should allow you to pass exact libraries to linker. Thanks for the confidence boost - I had looked at these switches but was guessing/hoping that there was some other way of specifying versions of .so files. I hacked OCaml's configure script to redefine mathlib='/usr/local/lib/compat/libm.so.4' (there doesn't seem to be a way to replace the default -lm via the command line to configure - but as it's an easy patch, perhaps I'll open a feature request with the patch) and configured OCaml with ./configure -lib '-nodefaultlibs /usr/local/lib/compat/libc.so.6' and OCaml seems to be working correctly (and ldd shows the resulting executables are linked against the older versions). David