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 BF0A4BBAF for ; Thu, 3 Dec 2009 13:47:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUCAMdCF0tDz4HegWdsb2JhbACcDwEBFiS7UoQyBIFn X-IronPort-AV: E=Sophos;i="4.47,335,1257116400"; d="scan'208";a="51436756" Received: from fettunta.fettunta.org ([67.207.129.222]) by mail4-smtp-sop.national.inria.fr with ESMTP; 03 Dec 2009 13:47:28 +0100 Received: from usha.takhisis.invalid (unknown [10.17.0.10]) by fettunta.fettunta.org (Postfix) with ESMTPS id DDBEC184DE for ; Thu, 3 Dec 2009 12:47:25 +0000 (UTC) Received: by usha.takhisis.invalid (Postfix, from userid 1000) id 00E6C606A; Thu, 3 Dec 2009 13:47:23 +0100 (CET) Date: Thu, 3 Dec 2009 13:47:23 +0100 From: Stefano Zacchiroli To: caml-list@inria.fr Subject: Re: [Caml-list] Embedding the ocaml runtime in a shared library on amd64/x86_64 Message-ID: <20091203124723.GB10986@usha.takhisis.invalid> Mail-Followup-To: caml-list@inria.fr References: <200912021333.11599.joost@damad.be> <20091202165116.GA7786@annexia.org> <20091202223751.GA20553@usha.takhisis.invalid> <200912031157.00187.joost@damad.be> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200912031157.00187.joost@damad.be> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam: no; 0.00; zacchiroli:01 zack:01 ocaml:01 runtime:01 0100,:01 -fpic:01 gcc:01 ocaml:01 compiler:01 ocamlopt:01 libasmrun:01 libcamlrun:01 -fpic:01 cheers:01 zacchiroli:01 On Thu, Dec 03, 2009 at 11:56:59AM +0100, Joost Yervante Damad wrote: > Reading up on this, I don't think using -fPIC on amd64 has a performance > penalty since it has the %rip register. Also it appears that gcc by default > uses indirect addressing via %rip in the generated asm. I duly notice that OCaml is not only compiler on "modern processors". So, a solution that does not offer the non-fPIC solution might be more than appropriate on amd64 processors, but maybe not as much appropriate on other architectures (Debian, for instance, support about 10 other architectures in addition to amd64; even if we restrict to architecture having ocamlopt, there is more than plain amd64). Note: I haven't checked whether there is a difference on all such architectures for what concerns libasmrun, but there were difference for such archs for libcamlrun. Given the negligible cost (both in term of patch preparation and of solution complexity) of supporting the build of both kind of libraries, I don't see why we should simply switch to the -fPIC library, trashing the other. Thanks for your work on this! Cheers. -- Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime