English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Embedding the ocaml runtime in a shared library on amd64/x86_64
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-12-03 (12:47)
From: Stefano Zacchiroli <zack@u...>
Subject: Re: [Caml-list] Embedding the ocaml runtime in a shared library on amd64/x86_64
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!

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