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 q2LIePBb022352 for ; Wed, 21 Mar 2012 19:40:25 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcCAGwgak9KfVIqjmdsb2JhbABEhUKxPwgiAQEBAQkLCQkSBiOCCQEBAQMBEgIPHQEBOAQLCwsPAgUhAgIPAQQNEwEFATUih2MFBJoyCopXboM/AY47BoEviD2Dc4IMgRaVY4sugxo9hAk X-IronPort-AV: E=Sophos;i="4.73,624,1325458800"; d="scan'208";a="137149470" Received: from mail-wg0-f42.google.com ([74.125.82.42]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Mar 2012 19:40:13 +0100 Received: by wgbds11 with SMTP id ds11so1898599wgb.3 for ; Wed, 21 Mar 2012 11:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=PYcbDo1V5T+xCL5eoGzkCc92fJU4tQxvZFMl4TX4IT4=; b=voT4KCzQqRI/w9t7VIsbJbyriyHlFwi1cZqDtNIxSHMEM6sWO32ekOOrdQfR7nF4Lq qdeI9S+UCbCyGkrPiGOjqJPVgBtHET3y0NWG4tgliF8aY7GUXTbwqiqvaPa0Qlz8GlaY 80ncJKAtzUzDiHlHGccorjPxuKNDQkURNfP+qfmtSeSf6frHSFmLHz3wpzUieF8cfaRy awCAnTp9K4fzpbWkhdbkDZ1lCIor/sOqyiooDIMS6GdF772mhAeUw5Up6G366I9O+vDT XbDy8sXjHajZ6YpFq4wCg1VvT2RhBETZY58xCwKG80VYkiOFBv97wMW5sXdwZQsybs8Z OJ1Q== Received: by 10.180.80.70 with SMTP id p6mr40265022wix.21.1332355213088; Wed, 21 Mar 2012 11:40:13 -0700 (PDT) Received: from spec-desktop.danmey.org (cpc1-cmbg12-0-0-cust201.5-4.cable.virginmedia.com. [86.9.116.202]) by mx.google.com with ESMTPS id n15sm6481172wiw.6.2012.03.21.11.40.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Mar 2012 11:40:12 -0700 (PDT) From: Wojciech Meyer To: caml-list@inria.fr References: <20120321180213.GA1063@viper.local> Date: Wed, 21 Mar 2012 18:40:25 +0000 In-Reply-To: <20120321180213.GA1063@viper.local> ("Ricardo Catalinas \=\?utf-8\?Q\?Jim\=C3\=A9nez\=22's\?\= message of "Wed, 21 Mar 2012 19:02:13 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q2LIePBb022352 Subject: Re: [Caml-list] ocamlmklib fails with code compiled with ocamlopt -c Ricardo Catalinas Jiménez writes: > 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? You have to use `-shared' command line option when compiling with ocamlopt. - Wojciech