GNU bug report logs -
#46725
[PATCH] gnu: guile-lib: Fix cross compilation.
Previous Next
Reported by: Christopher Baines <mail <at> cbaines.net>
Date: Tue, 23 Feb 2021 20:09:02 UTC
Severity: normal
Tags: patch
Done: Christopher Baines <mail <at> cbaines.net>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 46725 <at> debbugs.gnu.org (full text, mbox):
Hi,
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:
> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Hi!
>>
>> Christopher Baines <mail <at> cbaines.net> skribis:
>>
>>> These changes were sent upstream as
>>> https://lists.gnu.org/archive/html/guile-devel/2021-02/msg00004.html
>>>
>>> Without this change, the .go files are built for the host architecture, rather
>>> than the target. I noticed this when cross building the
>>> guix-build-coordinator (for which guile-lib is an input) to the Hurd.
>>>
>>> * gnu/packages/guile-xyz.scm (guile-lib)[arguments]: Add
>>> 'patch-for-cross-compilation phase.
>>> [native-inputs]: Add autoconf, automake and gettext.
>>> (guile2.0-lib): Adjust to use alist-replace.
>>> (guile2.2-lib): Adjust to use alist-replace.
>>
>> [...]
>>
>>> + (substitute* "configure.ac"
>>> + (("GUILE_FLAGS")
>>> + "GUILE_FLAGS
>>> +if test \"$cross_compiling\" != no; then
>>> + GUILE_TARGET=\"--target=$host_alias\"
>>> + AC_SUBST([GUILE_TARGET])
>>> +fi
>>
>> You could even set ‘GUILE_TARGET’ unconditionally.
>
> It seems a conditional is needed, because info
> '(autoconf)Canonicalizing' says:
>
> The variables ‘build_alias’, ‘host_alias’, and ‘target_alias’ are
> always exactly the arguments of ‘--build’, ‘--host’, and ‘--target’; in
> particular, they are left empty if the user did not use them, even if
> the corresponding ‘AC_CANONICAL’ macro was run.
>
> I.e. without the condition '--target=' could be passed to guild, which
> probably wouldn't work.
Ah true. In Guile-{Gcrypt,zlib,…}, ‘--target’ is passed conditionally.
Apologies for the confusion!
> So it seems that nowadays the build, host, and target would take default
> values as guessed by config.guess, and that the earlier section of the
> manual should be updated?
Dunno; but in hindsight, what Chris did seemed right.
Thanks,
Ludo’.
This bug report was last modified 4 years and 67 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.