chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Having trouble statically compiling code


From: stugol
Subject: Re: [Chicken-users] Having trouble statically compiling code
Date: Thu, 1 Sep 2016 02:03:26 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Hi Peter,

We're close, but not quite there yet:

Error: (require) cannot load extension: setup-api

           Call history:

           intarweb.scm:577: irregex
           intarweb.scm:612: list
           intarweb.scm:612: make-parameter
           intarweb.scm:630: make-parameter
           intarweb.scm:718: list
           intarweb.scm:718: make-parameter
           intarweb.scm:743: list
           intarweb.scm:743: list
           intarweb.scm:790: make-parameter
           intarweb.scm:885: list
           intarweb.scm:885: make-parameter
           intarweb.scm:911: irregex
           intarweb.scm:934: irregex
           intarweb.scm:967: list
           intarweb.scm:967: make-parameter
           setup-helper.scm:12: ##sys#require                    <--

I tried artificially adding 'setup-api' as a dependency to 'intarweb', but it's not a real package and so can't be linked.

Again, I'm including a copy of the project as it currently stands.

Cheers,
    Stuart.



On 26/08/2016 20:41, Peter Bex wrote:
On Mon, Aug 22, 2016 at 10:33:11PM +0100, stugol wrote:
   Hi Peter,

   I've fixed the needs issue, and ensured that -uses is specified
   correctly, and now I'm getting "multiple definition" errors:

     /tmp/temp728b.18061/defstruct/../defstruct.c:68: multiple definition
     of `C_defstruct_toplevel'
     defstruct.o:/tmp/temp728b.18061/defstruct/../defstruct.c:68: first
     defined here

     (etc)

   I assume this is somehow happening because multiple .scm files are
   being statically linked with the same .o file - like if two eggs have a
   dependency on a third, the third .o file will be linked twice. But it
   can't have it both ways!
Hi again Stuart,

I've findally gotten around to look into this again (sorry about that),
and it looks like the problem is simply in the final linking step: you
link all the .o files together.  But instead of linking each .o file once,
you link them for every occurrance in the dependency tree.

Simply deduplicate "object-files" in "compile-file" and you'll be fine.

Cheers,
Peter

Attachment: project.zip
Description: Zip archive


reply via email to

[Prev in Thread] Current Thread [Next in Thread]