caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David Allsopp" <dra-news@metastack.com>
To: "'Микола Стрєбков'" <nick@mykola.org>
Cc: "'OCaml List'" <caml-list@inria.fr>
Subject: RE: [Caml-list] Forcing gcc/ocamlopt to link against specific versions of libc.so and libm.so
Date: Mon, 24 Jan 2011 21:48:48 -0000	[thread overview]
Message-ID: <000e01cbbc10$7d00bc90$770235b0$@metastack.com> (raw)
In-Reply-To: <2ECBF6AC-5DB2-4C79-B6A0-BA9886A2687D@mykola.org>

Микола Стрєбков 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



      reply	other threads:[~2011-01-24 21:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 15:00 David Allsopp
2011-01-24 16:48 ` Микола Стрєбков
2011-01-24 21:48   ` David Allsopp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000e01cbbc10$7d00bc90$770235b0$@metastack.com' \
    --to=dra-news@metastack.com \
    --cc=caml-list@inria.fr \
    --cc=nick@mykola.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).