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: Peter Bex
Subject: Re: [Chicken-users] Having trouble statically compiling code
Date: Fri, 26 Aug 2016 21:41:53 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

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: signature.asc
Description: Digital signature


reply via email to

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