unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Static linking of Guile extensions
@ 2017-08-25 15:40 Maxim Cournoyer
  2017-08-29  3:33 ` Christopher Allan Webber
  2017-09-08 13:22 ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Maxim Cournoyer @ 2017-08-25 15:40 UTC (permalink / raw)
  To: guile-devel

Hi,

Today I tried investigating if was possible to build Guile so that even
its extension modules could be built in statically rather than
dynamically loaded. I didn't succeed; even when building Guile the way
its described by the %guile-static package in Guix (see (gnu packages
make-bootstrap)), I would still get the following message when attemting
activation of readline:

scheme@(guile-user)> (use-modules (ice-9 readline))
While compiling expression:
ERROR: In procedure dynamic-link: file: "libguilereadline-v-18", message: "file not found"

Interestingly a static library for readline seems to have been built:

/gnu/store/xxi8scxxx8g6i9h0lm57i5kc3xwcgj5r-guile-static-2.0.14/lib/libguilereadline-v-18.a

One use case would be to have readline support for a statically linked
Guile such as used for the GuixSD init ram disk; I'm currently attemting
to troubleshoot a problem at the init prompt (Guile) and it would be
great to have line editing support there!

Maxim



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Static linking of Guile extensions
  2017-08-25 15:40 Static linking of Guile extensions Maxim Cournoyer
@ 2017-08-29  3:33 ` Christopher Allan Webber
  2017-08-29 17:58   ` Maxim Cournoyer
  2017-09-08 13:22 ` Ludovic Courtès
  1 sibling, 1 reply; 4+ messages in thread
From: Christopher Allan Webber @ 2017-08-29  3:33 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: guile-devel

Maxim Cournoyer writes:

> Hi,
>
> Today I tried investigating if was possible to build Guile so that even
> its extension modules could be built in statically rather than
> dynamically loaded. I didn't succeed; even when building Guile the way
> its described by the %guile-static package in Guix (see (gnu packages
> make-bootstrap)), I would still get the following message when attemting
> activation of readline:
>
> scheme@(guile-user)> (use-modules (ice-9 readline))
> While compiling expression:
> ERROR: In procedure dynamic-link: file: "libguilereadline-v-18", message: "file not found"
>
> Interestingly a static library for readline seems to have been built:
>
> /gnu/store/xxi8scxxx8g6i9h0lm57i5kc3xwcgj5r-guile-static-2.0.14/lib/libguilereadline-v-18.a
>
> One use case would be to have readline support for a statically linked
> Guile such as used for the GuixSD init ram disk; I'm currently attemting
> to troubleshoot a problem at the init prompt (Guile) and it would be
> great to have line editing support there!
>
> Maxim

As an aside, you may want to look at 6.3 on Ian's update here:
https://lists.gnu.org/archive/html/guile-user/2017-08/msg00070.html

Maybe there can be some alignment on this work?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Static linking of Guile extensions
  2017-08-29  3:33 ` Christopher Allan Webber
@ 2017-08-29 17:58   ` Maxim Cournoyer
  0 siblings, 0 replies; 4+ messages in thread
From: Maxim Cournoyer @ 2017-08-29 17:58 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guile-devel

Christopher Allan Webber <cwebber@dustycloud.org> writes:

> Maxim Cournoyer writes:
>
>> Hi,
>>
>> Today I tried investigating if was possible to build Guile so that even
>> its extension modules could be built in statically rather than
>> dynamically loaded. I didn't succeed; even when building Guile the way
>> its described by the %guile-static package in Guix (see (gnu packages
>> make-bootstrap)), I would still get the following message when attemting
>> activation of readline:
>>
>> scheme@(guile-user)> (use-modules (ice-9 readline))
>> While compiling expression:
>> ERROR: In procedure dynamic-link: file: "libguilereadline-v-18", message: "file not found"
>>
>> Interestingly a static library for readline seems to have been built:
>>
>> /gnu/store/xxi8scxxx8g6i9h0lm57i5kc3xwcgj5r-guile-static-2.0.14/lib/libguilereadline-v-18.a
>>
>> One use case would be to have readline support for a statically linked
>> Guile such as used for the GuixSD init ram disk; I'm currently attemting
>> to troubleshoot a problem at the init prompt (Guile) and it would be
>> great to have line editing support there!
>>
>> Maxim
>
> As an aside, you may want to look at 6.3 on Ian's update here:
> https://lists.gnu.org/archive/html/guile-user/2017-08/msg00070.html
>
> Maybe there can be some alignment on this work?

Thanks for sharing this! After much interesting reading, it seems that
the issue of statically linking Guile modules together is a currently
missing feature of Guile. It's mentioned as part of some future
goals/tasks that Andy would like to happen in a future Guile [0].

I'll put an entry in my ever growing todo list, but I have many things
to work on before I get there.

Maxim

[0] https://wingolog.org/archives/2016/02/04/guile-compiler-tasks



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Static linking of Guile extensions
  2017-08-25 15:40 Static linking of Guile extensions Maxim Cournoyer
  2017-08-29  3:33 ` Christopher Allan Webber
@ 2017-09-08 13:22 ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2017-09-08 13:22 UTC (permalink / raw)
  To: guile-devel

Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> scheme@(guile-user)> (use-modules (ice-9 readline))
> While compiling expression:
> ERROR: In procedure dynamic-link: file: "libguilereadline-v-18", message: "file not found"

You could patch Guile to link guile-readline/*.lo into libguile-2.2.la
(which would make it GPLv3+)

In addition, you’d need to remove

  (load-extension …)

from (ice-9 readline), and instead export ‘scm_init_readline’ to Scheme
using SCM_DEFINE, and have (ice-9 readline) call it.

A bit of hack, but something along these lines should work.

Ludo’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-08 13:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25 15:40 Static linking of Guile extensions Maxim Cournoyer
2017-08-29  3:33 ` Christopher Allan Webber
2017-08-29 17:58   ` Maxim Cournoyer
2017-09-08 13:22 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).