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 q2LI2MTl021160 for ; Wed, 21 Mar 2012 19:02:22 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlgBAOQWak/RVdSukGdsb2JhbABEtwEIIgEBAQEJCQ0HFAQjgiICJgYBGwQaAxJuEQEFAVeHaASXU4JdCowTgnGFET+IdgEFC41Ugj9jBJVeAY5IPYQK X-IronPort-AV: E=Sophos;i="4.73,623,1325458800"; d="scan'208";a="137145979" Received: from mail-wi0-f174.google.com ([209.85.212.174]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Mar 2012 19:02:17 +0100 Received: by wibhr17 with SMTP id hr17so6040974wib.9 for ; Wed, 21 Mar 2012 11:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition; bh=AzhICVwYRY7sjQcAf7vza2hummqR0CB4rrE3TNb89FA=; b=tbfgDBNm62T39EDYk4kBGxZysBOgH4z2/ydrSnRftcsN3F7iLCte7tkYgH0VDU/F+R hJ6uJkteZl77k4vEjupfQFc6GadKko9rkOWjJSUMAathXKheclpt+/cZpt72jT6+wylW 0SQ4WIHhXjpc4kxOwzDMPLkKgnHvBZ80qrXBgSb3ZIkwbdFZyqV2s+fBF9omxrqwJk8H DO8ANlcaLko41kYyyK5qxWeWucZpl8ga6qadgbkdNEjHGeyEWE0YPc7JcZ8kvtZTt3mV MT/7+o4VCCA4CDVn/oGxXDfFsE063CEFlsgoZILl3IV/K3pjseByh9JLPTvBotVKIZLr dk2A== Received: by 10.216.135.102 with SMTP id t80mr2824385wei.59.1332352936606; Wed, 21 Mar 2012 11:02:16 -0700 (PDT) Received: from localhost (197.Red-79-159-35.staticIP.rima-tde.net. [79.159.35.197]) by mx.google.com with ESMTPS id ex2sm10173293wib.8.2012.03.21.11.02.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Mar 2012 11:02:15 -0700 (PDT) Date: Wed, 21 Mar 2012 19:02:13 +0100 From: Ricardo Catalinas =?iso-8859-1?Q?Jim=E9nez?= To: caml-list@inria.fr Message-ID: <20120321180213.GA1063@viper.local> Mail-Followup-To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Caml-list] ocamlmklib fails with code compiled with ocamlopt -c I found out the next issue when using the native compiler to generate a dynamic library from C: $ ocamlopt -c foo.c $ ocamlmklib -o foo foo.o /usr/bin/ld: fsync.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC fsync.o: could not read symbols: Bad value collect2: ld returned 1 exit status But `man ocamlopt' reads: -fPIC Generate position-independent machine code. This is the default. Anyway, I tried specifying manually `-fPIC' and it gave me the same error. But with `ocamlc -c' everything works as expected. Is this normal? Best regards -- Ricardo (http://r.untroubled.be/)