From: Sarah Morgensen via Bug reports for GNU Guix <bug-guix@gnu.org>
To: Malte Frank Gerdes <malte.f.gerdes@gmail.com>
Cc: 36823@debbugs.gnu.org
Subject: bug#36823: gcc bug prevents go program from starting newer gcc results in race condition
Date: Sun, 04 Jul 2021 13:41:54 -0700 [thread overview]
Message-ID: <86fswtak19.fsf@mgsn.dev> (raw)
In-Reply-To: <86wog3tove.fsf@gmail.com> (Malte Frank Gerdes's message of "Sat, 27 Jul 2019 18:37:41 +0200")
[-- Attachment #1: Type: text/plain, Size: 2077 bytes --]
Hello,
Thanks for the report.
Malte Frank Gerdes <malte.f.gerdes@gmail.com> writes:
> Hi,
>
> The precompiled version of Hugo-extended was not able to find some
> runtime dependencies:
> libstdc++.so.6 => not found
> libgcc_s.so.1 => not found
In case you haven't discovered this in the past two years (oops), this
is because Guix does not typically work with pre-compiled software that
relies on system libraries being in /lib, since there is no system-wide
/lib.
> This seems like a version mismatch to me, so i built Hugo with the
> following command:
> go build --tags extended
>
> Now the error is (<HASH> = ypiv8dj4lkvsnm82s639h18l87frrh5g):
> /gnu/store/<HASH>-gcc-6.5.0-lib/lib/libstdc++.so.6: version
> `GLIBCXX_3.4.26' not found
If I build hugo with gcc-toolchain@7 in my user profile, it works fine.
However.... I can still repro this issue with gcc-toolchain@8+:
$ go build --tags extended
$ ./hugo --help
./hugo: /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./hugo)
./hugo: /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./hugo)
This is because gcc 7's libraries are shadowing the newer gcc's
libraries:
$ readelf -d hugo | grep RUNPATH
0x000000000000001d (RUNPATH) Library runpath: [/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib:/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib:/gnu/store/3h7xd0d47a286b6r9qhz4ybi5iaxkfwi-gcc-11.1.0-lib/lib:/home/sarah/.guix-profile/lib:/gnu/store/3h7xd0d47a286b6r9qhz4ybi5iaxkfwi-gcc-11.1.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.1.0/../../..]
If I use patchelf to remove the gcc 7 library dir from RUNPATH, hugo
works fine. This is because Go is patched to unconditionally add a
runpath to gcc 7's libraries but erroneously does not explicitly set
CXX. (See also <https://issues.guix.gnu.org/39400>.)
The following patch should explicitly set CXX for Go, so that it always
uses the "system" version:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: go-explicitly-set-CXX.patch --]
[-- Type: text/x-patch, Size: 1081 bytes --]
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 0318918a37..a27f57aa30 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -395,6 +395,7 @@ in the style of communicating sequential processes (@dfn{CSP}).")
;; FIXME: Some of the .a files are not bit-reproducible.
(let* ((output (assoc-ref outputs "out")))
(setenv "CC" (which "gcc"))
+ (setenv "CXX" (which "g++"))
(setenv "GOOS" "linux")
(setenv "GOROOT" (dirname (getcwd)))
(setenv "GOROOT_FINAL" output)
@@ -577,6 +578,7 @@ in the style of communicating sequential processes (@dfn{CSP}).")
(loader (string-append (assoc-ref inputs "libc")
,(glibc-dynamic-linker))))
(setenv "CC" (which "gcc"))
+ (setenv "CXX" (which "g++"))
(setenv "GO_LDSO" loader)
(setenv "GOOS" "linux")
(setenv "GOROOT" (dirname (getcwd)))
[-- Attachment #3: Type: text/plain, Size: 24 bytes --]
Hope that helps,
Sarah
next parent reply other threads:[~2021-07-04 20:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <86wog3tove.fsf@gmail.com>
2021-07-04 20:41 ` Sarah Morgensen via Bug reports for GNU Guix [this message]
2021-07-06 13:14 ` bug#36823: gcc bug prevents go program from starting newer gcc results in race condition Malte Frank Gerdes
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=86fswtak19.fsf@mgsn.dev \
--to=bug-guix@gnu.org \
--cc=36823@debbugs.gnu.org \
--cc=iskarian@mgsn.dev \
--cc=malte.f.gerdes@gmail.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).