From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p8EFZqLU025372 for ; Wed, 14 Sep 2011 17:35:52 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4CAEnJcE7RVde2kWdsb2JhbABBmS+OMAgUAQEBAQkLCwcUBCKBUwEBAQECARICJgYBATgECws0EjQBBQEcO4dVAphUCo4XAY5rBYYOYKA9PYNw X-IronPort-AV: E=Sophos;i="4.68,380,1312149600"; d="scan'208";a="109070444" Received: from mail-ey0-f182.google.com ([209.85.215.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 14 Sep 2011 17:35:46 +0200 Received: by eyg7 with SMTP id 7so1243933eyg.27 for ; Wed, 14 Sep 2011 08:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=rAEQ05MdbYyWXOG2zZps31EtcY+F/WdJ7MMUeVsr+LA=; b=qUctJOI05Fj9OUiimL7h2YIWb+XCGZnJpGXeFIIyvCXEQlgpw+XURw7SIe/ugoZSEZ VJ3msHA1fNHhNhqzp2J6xYcFRHEt7WKMvDETWD/Kk7CrBQ/wIKSsr/IEe1j0yNVKKfyO KJ/C4XEpr0H6uaJcaF2VMaPCXpBwJnFH9AzzU= Received: by 10.223.9.209 with SMTP id m17mr5884fam.13.1316014546129; Wed, 14 Sep 2011 08:35:46 -0700 (PDT) Received: from coruscant.kosmos.all (ip-95-223-170-32.unitymediagroup.de. [95.223.170.32]) by mx.google.com with ESMTPS id c12sm3708850fad.14.2011.09.14.08.35.44 (version=SSLv3 cipher=OTHER); Wed, 14 Sep 2011 08:35:45 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1244.3) From: Benedikt Meurer In-Reply-To: <4E70C18F.3040304@lri.fr> Date: Wed, 14 Sep 2011 17:35:43 +0200 Message-Id: <6D0BDE28-ABD0-4EDC-B79B-4E557E8EF500@googlemail.com> References: <4E70C18F.3040304@lri.fr> To: caml-list@inria.fr X-Mailer: Apple Mail (2.1244.3) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p8EFZqLU025372 Subject: Re: [Caml-list] Link a .so/.dll dynamically On Sep 14, 2011, at 17:00 , Romain Bardou wrote: > My first problem is: I tried something similar for native code (using ocamlopt instead of ocamlc, .cmx instead of .cmo and .cmxa instead of .cma) but ocamlmklib fails with the following error: > /usr/bin/ld: wrapper.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC > wrapper.o: could not read symbols: Bad value > collect2: ld returned 1 exit status > I have absolutely no idea what this means, I'm really confused here and Google does not help. The error messages already includes the answer, you need to pass -fPIC to the C compiler when compiling wrapper.c, i.e. $ gcc -c -fPIC -o wrapper.o wrapper.c > Romain Bardou HTH, Benedikt