🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fa.caml
Article #140

Re: [Caml-list] static C library of wrappers: compilation issues

#140
From: Alain Frisch
Date: Thu, 26 Apr 2012 12:23
27 lines
3568 bytes
On 04/26/2012 12:08 PM, Xavier ALLAMIGEON wrote:
> What do you mean exactly? I imagine that test.o needs some functions of
> the libhello_world.a. But I don't see why libasmrun would need some
> other functions of libhello_world...

Well, this is the case. libasmrun contains the runtime system for OCaml 
code (compiled with ocamlopt) and, as you can see in the error message 
from the linker, it depends on symbols provided by the OCaml program. 
For instance, the garbage collector (in libasmrum) needs to find special 
symbols, to locate some data structures (in libhello_world.a) created by 
the compiler.

> What about the following alternative where libasmrun is directly
> appended to the .a file?
> cp "`ocamlc -where`"/libasmrun.a libhello_world.a
> ar rcs libhello_world.a ml_code.obj.o c_code.o
> gcc -o test -L. -L"`ocamlc -where`" test.c -lhello_world -lm -ldl

This looks fine to me.

-- Alain

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Technical Details
Message-ID: <fa.2qkECvaSgOSJxnChx8/msqdsnUw@ifi.uio.no>
Path: arc1-ca.pugleaf.net!r9ni100567pbh.0!nntp.google.com!news1.google.com!goblin2!goblin1!goblin.stu.neva.ru!uio.no!nntp.uio.no!.POSTED!not-for-mail
References: <fa.XlnNJXrM7cjr64FYE99G2A+nhk4@ifi.uio.no> <fa.x1meoX1izKZMvjRMs57ceIS84Ic@ifi.uio.no> <fa.ioT/YTrmrBD22KvNJHup1lSU0qY@ifi.uio.no>

Show Full Headers
Complete Article Headers
X-Google-Thread: ff861,9e13cd36b5c96a87
X-Google-NewGroupId: yes
X-Google-Attributes: gidc0fe4b917e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.68.236.170 with SMTP id uv10mr5872993pbc.4.1335443010166;
        Thu, 26 Apr 2012 05:23:30 -0700 (PDT)
Path: arc1-ca.pugleaf.net!r9ni100567pbh.0!nntp.google.com!news1.google.com!goblin2!goblin1!goblin.stu.neva.ru!uio.no!nntp.uio.no!.POSTED!not-for-mail
From: Alain Frisch <alain@frisch.fr>
Newsgroups: fa.caml
Subject: Re: [Caml-list] static C library of wrappers: compilation issues
Date: Thu, 26 Apr 2012 12:23:29 UTC
Organization: Internet mailing list
Lines: 28
Message-ID: <fa.2qkECvaSgOSJxnChx8/msqdsnUw@ifi.uio.no>
References: <fa.XlnNJXrM7cjr64FYE99G2A+nhk4@ifi.uio.no> <fa.x1meoX1izKZMvjRMs57ceIS84Ic@ifi.uio.no> <fa.ioT/YTrmrBD22KvNJHup1lSU0qY@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
Mime-Version: 1.0
X-Trace: readme.uio.no 1335443009 20039 129.240.7.9 (26 Apr 2012 12:23:29 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Thu, 26 Apr 2012 12:23:29 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1
Cc: caml-list@inria.fr
To: Xavier ALLAMIGEON <xavier.allamigeon@inria.fr>
X-IronPort-AV: E=Sophos;i="4.75,486,1330902000"; 
   d="scan'208";a="155746910"
X-Authentication-Warning: walapai.inria.fr: sympa set sender to caml-list-owner@inria.fr using -f
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApoBAA09mU/B/BfXkWdsb2JhbABEgx2rEINAAQEBAQkLCwcUAySCCQEBBAE4QQULCxgJJQ8CRgYNAQcBAYgECbsKkGUElX2FdI02
X-IronPort-AV: E=Sophos;i="4.75,486,1330902000"; 
   d="scan'208";a="141705505"
In-Reply-To: <4F991E88.5060402@inria.fr>
X-Sequence: 3970
List-Id: <caml-list.inria.fr>
List-Archive: <https://sympa-roc.inria.fr/wws/arc/caml-list>
List-Help: <mailto:sympa@inria.fr?subject=help>
List-Owner: <mailto:caml-list-request@inria.fr>
List-Post: <mailto:caml-list@inria.fr>
List-Subscribe: <mailto:sympa@inria.fr?subject=subscribe%20caml-list>
List-Unsubscribe: <mailto:sympa@inria.fr?subject=unsubscribe%20caml-list>
Original-Date: Thu, 26 Apr 2012 14:23:07 +0200
Original-Message-Id: <4F993E2B.70700@frisch.fr>
Original-References: <4F99003B.9070001@inria.fr> <4F990869.5050105@etorok.net> <4F991E88.5060402@inria.fr>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit