unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: Carl Dong <contact@carldong.me>
Cc: "36346@debbugs.gnu.org" <36346@debbugs.gnu.org>
Subject: [bug#36346] [PATCH] gnu: Allow building toolchain with non-default libc.
Date: Mon, 08 Jul 2019 17:34:20 +0200	[thread overview]
Message-ID: <8736jgr14z.fsf@devup.no> (raw)
In-Reply-To: <XSh8JydMVmKk7r7WAaJ3J-hdycb_Q8veLjOhopkAeF7W4qki242hKCiIkx8dc-Yo_P1U7wjsn_dxpdFT5-CSxxhCPQy226KfugUs6su9SBU=@carldong.me>

[-- Attachment #1: Type: text/plain, Size: 2600 bytes --]

Carl Dong <contact@carldong.me> writes:

> Hi Marius!
>
>> It would be easier to digest this patch if it came with an actual user of this
>> change. Right now it complicates a very simple procedure for no apparent
>> reason. Can you elaborate a bit on the use case?
>
> Ah! This change is motivated by the work I've been doing in shifting the Bitcoin
> release process to a Guix-based one. The binaries we produce aim to be
> compatible with GLIBC_2_11, and we have glibc compat wrappers
> (https://github.com/bitcoin/bitcoin/blob/f373beebbcc0c7d1160e02dc638a00b3e6831d98/src/compat/glibc_compat.cpp)
> all the way up to 2.27 (since we need RISCV support). With Guix, I hope that we
> don't have to keep updating compat wrappers anymore, and pin our toolchain glibc
> version to a fixed one. See here for how I use this:
> https://github.com/bitcoin/bitcoin/blob/e8dd4da0b287e0fe252c99bb4a7cb26c2e947b71/contrib/guix/packages/gcc-bitcoin.scm#L91

I see, thanks for the links.

>> Guix excels at creating bespoke toolchains like these. It is easy to express
>> this change as a new 'make-gcc-toolchain-with-custom-libc' procedure. So I'm
>> not sure if it's worth changing 'make-gcc-toolchain', which serves a fairly
>> specific use case.
>>
>> I would expect any reasonably complex toolchain to need further tweaks, and we
>> cannot possibly support all such configuration inside 'make-gcc-toolchain'.
>>
>> It does sound useful to make these procedures more generally accessible
>> however. Perhaps 'make-gcc-toolchain' could be implemented in terms of a more
>> generic 'make-toolchain' interface?
>
> That all sound like promising solutions. My thought process comes from porting
> riscv64 to Guix, where I realized that I had to override the default gcc version
> (riscv64 requires gcc 7.1), glibc version (2.27), and kernel headers version
> (4.15). That makes me think that the sensible list of things to be overridable
> for a toolchain would be those three, in case of future architectures. I've
> submitted previous patches to cross-base.scm that added the ability to
> parameterize these three, and this patch was simply doing the same for
> gcc-toolchain.
>
> Anyway, please let me know which approach you'd prefer, and I'd be very happy to
> implement and change. :-)

I feel better about this patch now that I've seen its uses.  It would be
great if you could leave some comments at the top of the definition
about what the libc argument is for, and maybe even a usage example.

Otherwise it LGTM.  Let's hold it for a couple of days in case others
have additional suggestions.

Thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2019-07-08 15:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-23 20:15 [bug#36346] [PATCH] gnu: Allow building toolchain with non-default libc Carl Dong
2019-07-05 22:46 ` Marius Bakke
2019-07-07 14:42   ` Carl Dong
2019-07-08 15:34     ` Marius Bakke [this message]
2019-07-08 19:41 ` Carl Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736jgr14z.fsf@devup.no \
    --to=mbakke@fastmail.com \
    --cc=36346@debbugs.gnu.org \
    --cc=contact@carldong.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).