unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Pierre Langlois <pierre.langlois@gmx.com>
Cc: 52066@debbugs.gnu.org
Subject: [bug#52066] [PATCH, core-updates-frozen, RFC] Fix static guile on aarch64
Date: Fri, 26 Nov 2021 11:00:05 +0100	[thread overview]
Message-ID: <874k7zb5ju.fsf@gnu.org> (raw)
In-Reply-To: <878rxeebh6.fsf@gmx.com> (Pierre Langlois's message of "Tue, 23 Nov 2021 21:22:31 +0000")

Hi Pierre,

Pierre Langlois <pierre.langlois@gmx.com> skribis:

> The root of the issue seems to be that the make-guile-static procedure
> isn't actually producing a static binary on aarch64.  Digging into it
> more, we do pass the -all-static flag to libtool, but the gcc command
> doesn't actually do any static linking:
>
> /tmp/guix-build-guile-static-3.0.7.drv-0/guile-3.0.7$ make V=1
> ...
> ../libtool  --tag=CC   --mode=link gcc -std=gnu11 -pthread -Wall -Wmissing-prototypes -Wpointer-arith -fno-strict-aliasing -fwrapv -fvisibility=hidden -g -O2 -all-static -pthread -ldl -o guile guile-guile.o libguile-3.0.la -ldl -lcrypt  -lm
> libtool: link: gcc -std=gnu11 -pthread -Wall -Wmissing-prototypes -Wpointer-arith -fno-strict-aliasing -fwrapv -fvisibility=hidden -g -O2 -pthread -o guile guile-guile.o  ./.libs/libguile-3.0.a -L/gnu/store/3539zsmc939g1r9g3r02bpy0m1b9v9c8-libgc-8.0.4/lib -L/gnu/store/sn95w7yk9qwxhw74l590606y53pf5mkf-libffi-3.3/lib /gnu/store/3539zsmc939g1r9g3r02bpy0m1b9v9c8-libgc-8.0.4/lib/libgc.a -lpthread /gnu/store/sn95w7yk9qwxhw74l590606y53pf5mkf-libffi-3.3/lib/libffi.a -lunistring -ldl -lcrypt -lm -pthread

So ‘libtool’ is not passing ‘-static’, right?  Why is that?  (It does
pick .a libs though.)

[...]

> Doing more digging, I found a reference to a similar issue here:
> https://bugzilla.redhat.com/show_bug.cgi?id=1830472#c1, this looks
> related to the -moutline-atomics option that's enabled by default with
> GCC 10.  But we're building guile with GCC 7 so it was a bit confusing.
>
> However, glibc here is actually built with the default GCC 10, and if we
> change that then it works!
>
> --- a/gnu/packages/make-bootstrap.scm
> +++ b/gnu/packages/make-bootstrap.scm
> @@ -85,6 +85,9 @@ (define glibc-for-bootstrap
>            `(cons* "--disable-nscd" "--disable-build-nscd"
>                    "--enable-static-nss"
>                    ,flags))))
> +      (native-inputs
> +       `(("gcc" ,gcc-7)
> +         ,@(package-native-inputs base)))
>  
>        ;; Remove the 'debug' output to allow bit-reproducible builds (when the
>        ;; 'debug' output is used, ELF files end up with a .gnu_debuglink, which

I think that’s a reasonable fix for now; you can push the patch.

However, we should eventually switch to GCC 10 in make-bootstrap.scm; I
don’t think there’s any good justification for sticking to GCC 7.

Thank you!

Ludo’.




  reply	other threads:[~2021-11-26 10:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 21:22 [bug#52066] [PATCH, core-updates-frozen, RFC] Fix static guile on aarch64 Pierre Langlois
2021-11-26 10:00 ` Ludovic Courtès [this message]
2021-11-27 14:34   ` bug#52066: " Pierre Langlois

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=874k7zb5ju.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=52066@debbugs.gnu.org \
    --cc=pierre.langlois@gmx.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.
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).