From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 6BD1BBBAF for ; Mon, 15 Feb 2010 21:42:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmwHADZAeUvRVdizkGdsb2JhbACNf4M6ghOHQggVAQEBAQkJDAcTAyCuU4FMhBeIcgEBAwWEVgSDFA X-IronPort-AV: E=Sophos;i="4.49,479,1262559600"; d="scan'208";a="57070386" Received: from mail-px0-f179.google.com ([209.85.216.179]) by mail4-smtp-sop.national.inria.fr with ESMTP; 15 Feb 2010 21:42:37 +0100 Received: by pxi9 with SMTP id 9so3454175pxi.24 for ; Mon, 15 Feb 2010 12:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=+of0R+aP65zc+DuG+dSrfQQ1cRFC4tCpcBZ8PmV9oMo=; b=SGO31mMqDb15iqWDB4//k+dcwTtQ3kouw5WeVzjFlTAK3ewKMuZf2K2r2foA3vHCzB 4j2B/nZ++eYTOV+XLQD2r1w/TbWE4hlq+ujZxwqpUIgKmQGoi9sTziXlvxugYaUHPJFH YkN44L1WeGwYqYoa+S3EHLnz+PexX+Lrc/G0k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=v8qBcXjqTenDKNuN/8QOcVjlvwYzTvmozmh0XFPxzHYRIjXYNv4fqWwJ33K8ImS1Kj S7uVGWFkOnGekNLinc3KGM7Edpj8wOuc97w0VG6iXx1O2YlRdKn+TTMB0D6uTA8JnPf1 w05jl6gm2hJBH132ZPGSqE1uyh3MhsreVQOD0= MIME-Version: 1.0 Received: by 10.142.247.33 with SMTP id u33mr3697845wfh.219.1266266554789; Mon, 15 Feb 2010 12:42:34 -0800 (PST) Date: Mon, 15 Feb 2010 15:42:34 -0500 Message-ID: Subject: On Building 64-bit shared libraries From: Eric Hielscher To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; -fpic:01 apt-get:01 ocaml:01 dependencies:01 apt-get:01 ocaml:01 ocaml-:01 asmrun:01 makefile:01 -fpic:01 cflags:01 cflags:01 dpkg:01 ocamlopt:01 -output-obj:01 A while back I asked the list about building 64-bit shared libraries. My co-worker and I found a solution that seems to work. I'm not sure exactly where to insert -fPIC, so I do it in two places. The steps for getting it to work on an apt-enabled Linux for us are: 1) sudo apt-get remove ocaml 2)Get dependencies: sudo apt-get build-dep ocaml 3) Some misc. tools I think you need to build .deb files: sudo apt-get install devscripts 4) sudo apt-get source ocaml 5) cd ocaml-3.11.1 6) cd asmrun 7) edit Makefile, adding "-fPIC" to CFLAGS 8) CFLAGS_APPEND=-fPIC 9) cd .. 10) sudo dpkg-buildpackage -uc -us -b 11) cd .. 12) Install new ocaml: sudo dpkg -i *.deb 13) ocamlopt -output-obj -o a.o A.ml 14) ocamlopt -ccopt -fPIC -o B.o B.c 15) ocamlopt -ccopt -shared -ccopt -Wl,-Bsymbolic B.o A.cmx -o libC.so Now you have a shared library libC.so to which you can link your programs. Hope that helps someone, -- Eric Hielscher "Het zal me worst wezen." http://ehielscher.org