unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Antoine Poinsot <darosior@protonmail.com>
To: Philip McGrath <philip@philipmcgrath.com>
Cc: Guix Help <help-guix@gnu.org>
Subject: Re: Bootstrappable Release Build of Rust Application
Date: Thu, 18 Apr 2024 08:07:47 +0000	[thread overview]
Message-ID: <YRhWj7LBo8qV9lqR2UXmuM5G83-TCKY_b5lGTYoH61ClcqA-GhkJ7hkjR2kYi8PfFj0BFvknYBWHwjXlJaPUbrk_m7qeex9HaUFSl5gxIwg=@protonmail.com> (raw)
In-Reply-To: <e9affdd0-a0d6-4660-b10c-bdc84251e542@app.fastmail.com>

Thanks for sharing.

Unfortunately the very same `make-gcc-toolchain` keeps failing to compile for me, even with the same gcc and glibc versions as you:
```
In file included from ../include/pthread.h:1,                                                                                                                                                                                                                                                                                                                                                                                           
                 from ../sysdeps/nptl/thread_db.h:25,                                                                                                                                                                                                                                                                                                                                                                                   
                 from ../nptl/descr.h:32,                                                                                                                                                                                                                                                                                                                                                                                               
                 from ../sysdeps/x86_64/nptl/tls.h:130,                                                                                                                                                                                                                                                                                                                                                                                 
                 from ../include/link.h:51,                                                                                                                                                                                                                                                                                                                                                                                             
                 from ../include/dlfcn.h:4,                                                                                                                                                                                                                                                                                                                                                                                             
                 from ../sysdeps/generic/ldsodefs.h:32,                                                                                                                                                                                                                                                                                                                                                                                 
                 from ../sysdeps/x86/ldsodefs.h:64,                                                                                                                                                                                                                                                                                                                                                                                     
                 from ../sysdeps/gnu/ldsodefs.h:46,                                                                                                                                                                                                                                                                                                                                                                                     
                 from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,                                                                                                                                                                                                                                                                                                                                                                         
                 from <stdin>:2:                                                                                                                                                                                                                                                                                                                                                                                                        
../sysdeps/nptl/pthread.h:719:47: error: argument 1 of type ‘struct __jmp_buf_tag *’ declared as a pointer [-Werror=array-parameter=]                                                                                                                                                                                                                                                                                                   
  719 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;                                                                                                                                                                                                                                                                                                                                                 
      |                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~
```

Code is basically the same as yours:
```
(define gcc-toolchain-2.31
  (make-gcc-toolchain gcc glibc-2.31))

(package-with-c-toolchain rust-liana_gui-5.0.0 `(("gcc-toolchain" ,gcc-toolchain-2.31)))
```


On Wednesday, April 17th, 2024 at 5:17 PM, Philip McGrath <philip@philipmcgrath.com> wrote:

> Hi,
> 
> On Wed, Apr 17, 2024, at 6:28 AM, Antoine Poinsot wrote:
> 
> > Good morning all,
> > 
> > I've been working on using Guix for the reproducible builds of my Rust
> > software. My main question is about linking my program against an older
> > glibc version (or better yet, statically linking it against musl).
> > 
> > [...]
> > 
> > Now this links against glibc 2.35. I need to target ideally 2.29 or at
> > most 2.31. That's what i'm seeking help for. I've tried the obvious:
> > `guix build -f test2.scm --with-input=glibc=glibc@2.29`
> 
> 
> My knowledge in this area is very shallow, but I also have wanted to link against old glibc versions, for somewhat similar purposes. The best I've got so far is at [1], in which I successfully use `make-gcc-toolchain` to use `gcc` with `glibc-2.31` and define a helper function `package-with-old-stable-libc` to supply it to `package-with-c-toolchain`. I use that in [2] to compile the library I'm interested in against the old glibc version. While this is the best solution I've found so far, I'm still not entirely happy with it! While the code I'm pointing you to isn't too bad, other parts of the overall setup are overly complex (in fairness, largely to also build for Apple platforms), and I haven't managed to build against Glibc 2.23 to fix [3]. But hopefully some of this might be useful, or, better yet, someone might suggest a better solution!
> 
> Philip
> 
> [1]: https://github.com/libgit2-racket/native-libs/blob/bd400daed8d4e38db6fc472d4ec82b99a884303c/guix/old-stable-libc.scm
> [2]: https://github.com/libgit2-racket/native-libs/blob/bd400daed8d4e38db6fc472d4ec82b99a884303c/guix/extracted/non-apple.scm
> [3]: https://github.com/libgit2-racket/libgit2/issues/2


      reply	other threads:[~2024-04-18 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 10:28 Bootstrappable Release Build of Rust Application Antoine Poinsot
2024-04-17 15:17 ` Philip McGrath
2024-04-18  8:07   ` Antoine Poinsot [this message]

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='YRhWj7LBo8qV9lqR2UXmuM5G83-TCKY_b5lGTYoH61ClcqA-GhkJ7hkjR2kYi8PfFj0BFvknYBWHwjXlJaPUbrk_m7qeex9HaUFSl5gxIwg=@protonmail.com' \
    --to=darosior@protonmail.com \
    --cc=help-guix@gnu.org \
    --cc=philip@philipmcgrath.com \
    /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.
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).