|
From: | stugol |
Subject: | [Chicken-users] Having trouble statically compiling code |
Date: | Sun, 21 Aug 2016 01:13:40 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Hi everyone, I have the need to statically compile
my code into a single executable with no dependencies. To this
end, I have written a program in Chicken, which will enumerate
all dependencies - that is, eggs and other source files -
of a Chicken code file and statically compile them into
an executable. The lookup-table egg was a pain, and I
had to hard-code a workaround, but the other eggs seem to work. I have attached a copy of my project.
To use it, simply unzip to a suitable directory and run it as
follows:
Having compiled all eggs into object files, it then runs the command:
This complains about multiple
definitions of C_blob_2dutils_toplevel, which I assume is because I am compiling
blob-hexadecimal.scm
and blob-set-int.scm
separately into object files. Perhaps I should not be doing that.
But that's a minor issue. If I remove one of the object files
from the final compile stage, it then compiles. You can replicate
this yourself by interrogating the generated logfile.log for the /tmp/xxxxx directory, going there, then issuing the
revised csc
call. However, when I run the resultant
executable, I get an error about a missing intarweb extension. Which is strange, because if
you look carefully at the command line above, you can see I'm
both linking with its object file and referencing it
with a uses declaration. What am I doing wrong, please? Incidentally, is there any way to
instruct csc to use
musl instead
of libc? I'm told
that this would eliminate any dependency on a specific version
of libc on the
target machine. I gather the musl project is a bit lacking in header files,
however. Cheers, |
project.zip
Description: Zip archive
[Prev in Thread] | Current Thread | [Next in Thread] |