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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 016EDBBA7 for ; Tue, 13 Dec 2005 23:14:37 +0100 (CET) Received: from mrout2.yahoo.com (mrout2.yahoo.com [216.145.54.172]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jBDMEa0L021491 for ; Tue, 13 Dec 2005 23:14:37 +0100 Received: from localhost.localdomain (raptors.corp.yahoo.com [207.126.231.163]) by mrout2.yahoo.com (8.13.4/8.13.4/y.out) with ESMTP id jBDMBnN1032601; Tue, 13 Dec 2005 14:11:49 -0800 (PST) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=received:from:to:subject:x-eric-conspiracy:date:message-id: user-agent:mime-version:content-type; b=wTpRPn3hYoC1uCFcTsds58Td/2K8+Zz+7+mgzGqbI2ShCm3MXc+zymsxJr3OBR5l Received: from raptors.corp.yahoo.com..ebourget.net (localhost.localdomain [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id 356EA20EF82; Tue, 13 Dec 2005 14:10:12 -0800 (PST) From: Erik Bourget To: caml-list@yquem.inria.fr Subject: Compiling a shared library on AMD64 X-Eric-Conspiracy: There Is No Conspiracy Date: Tue, 13 Dec 2005 14:10:11 -0800 Message-ID: <87oe3kodh8.fsf@raptors.corp.yahoo.com.> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde with ID 439F47CC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 3.09.0:01 -wall:01 -fpic:01 -wall:01 -fpic:01 pointers:01 ocamlopt:01 usr:01 lib:01 pcre:01 usr:01 lib:01 site-lib:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 I'm having trouble building a shared library using components from the ocaml standard library on my x86_64 box. I built ocaml 3.09.0 with: BYTECCCOMPOPTS=-fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC NATIVECCCOMPOPTS=-Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC NATIVECCPROFOPTS=-Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC SUPPORTS_SHARED_LIBRARIES=true BNG_ARCH=amd64 , but the standard library seems to still have some R_X86_64_32S relocations in it. I don't understand ELF very well so I'm kind of lost :) Can anyone give any pointers? - Erik Story in transcript: $ ocamlopt -ccopt "-fPIC -D_FILE_OFFSET_BITS=64 -D_REENTRANT" -fPIC -I /usr/lib/ocaml/site-packages/pcre -I /usr/local/lib/ocaml/site-lib/pcre -output-obj -fPIC -o camlcode.o unix.cmxa pcre.cmxa range_utils.cmx parser.cmx lexer.cmx memoize.cmx tinydns.cmx netmask.cmx admins.cmx netblocks.cmx evaluate.cmx range.cmx $ ld -shared --whole-archive -o librange.so camlcode.o librange.o /usr/local/lib/ocaml/libunix.a /usr/local/lib/ocaml/libasmrun.a /usr/local/lib/ocaml/site-lib/pcre/libpcre_stubs.a /usr/lib64/libm.a /usr/lib64/libpcre.a /usr/lib64/libdl.a ld: camlcode.o: relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC $ objdump -r camlcode.o | grep R_X86_64_32S 000000000000377d R_X86_64_32S .rodata 0000000000003be6 R_X86_64_32S .rodata+0x000000000000008 ... (20 more .rodata, but only .rodata, nothing else) erik:~/src/packages/ocaml/ocaml-3.09.0/stdlib$ objdump -r scanf.o | grep 64_32 00000000000021de R_X86_64_32S .rodata 0000000000002a53 R_X86_64_32S .rodata+0x00000000000003e0 ... ( more .rodata) The pcre.o used to build pcre.cmxa also has some rodata's in it.