Statically linking C code into ECL

Faré fahree at
Tue Dec 27 00:51:30 UTC 2016

Unhappily, neither *user-cc-flags* nor *ld-flags* allows me to get the
desired result:
the former is not used by build-program, and the latter is only used
*after* passing the list of .a, too late for a -Wl,--whole-archive.
Moreover, on Darwin and/or with lld, I need to use -Wl,-force_load
before each individual .a instead, and the current interface won't
allow that.

I tried to link .o files directly, instead of .a files, but ran into a
different ECL issue regarding slot inheritance; see my other email
about that.

PS: Regarding using c:build-program instead of c::builder :program,
when was the change made? Do I need to care about supporting older
versions of ECL?

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics•
What is mind? No matter! What is matter? Never mind!
       — Bertrand Russell's Grand Mother, In Karl Popper, The Unended Quest

On Mon, Dec 26, 2016 at 11:06 AM, Daniel Kochmański
<daniel at> wrote:
> Faré writes:
>> Is there an official or encouraged way?
> No.
>>> builder (and all interfaces built on top of it) support ld-flags key
>>> argument. Additionally if you want to influence how ECL compiles files
>>> dynamically you may shadow *user-cc-flags* and *user-ld-flags*.
>> This won't work. *user-cc-flags* isn't used by build-program, AFAICT,
>> and user-ld-flags is only used at the end of the linking command,
>> which is too late for a --whole-archive (and a --no-whole-archive is
>> actually needed before the -ldl -lm etc. calls, whereas on Darwin, the
>> -force_load is needed in front of each individual .a).
> *user-cc-flags* and *user-ld-flags* are used in all operations involving
> C/C++ compiler. If it's too late, then what about (mentioned in the
> previous mail) :ld-flags ?

More information about the ecl-devel mailing list