From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 04 16:42:02 2021 Received: (at 36823) by debbugs.gnu.org; 4 Jul 2021 20:42:02 +0000 Received: from localhost ([127.0.0.1]:43318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m08wE-00036Z-6F for submit@debbugs.gnu.org; Sun, 04 Jul 2021 16:42:02 -0400 Received: from out2.migadu.com ([188.165.223.204]:17556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m08wB-00036I-3i for 36823@debbugs.gnu.org; Sun, 04 Jul 2021 16:42:00 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1625431317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sYprEYHilqeot5IZBTcN54PSRHKzggDSdn5xsF5VJ8k=; b=QlHKVp6ITawvxwmerEiBHWnLLlgf0kdY9boTU0hSgddHDT6VC9BEDCVWnHNsdgYS/mA2En TJROXIB6HXaafxvKBLonmWr0FI67Zd9yzU9DmqW/5TGjJw2Z0tTtweb7ZgW7v//p38VIpn 96Ck0hU/658VHeoDNcBVa9lSr+xhORU= From: Sarah Morgensen To: Malte Frank Gerdes Subject: Re: bug#36823: gcc bug prevents go program from starting newer gcc results in race condition References: <86wog3tove.fsf@gmail.com> Date: Sun, 04 Jul 2021 13:41:54 -0700 In-Reply-To: <86wog3tove.fsf@gmail.com> (Malte Frank Gerdes's message of "Sat, 27 Jul 2019 18:37:41 +0200") Message-ID: <86fswtak19.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 36823 Cc: 36823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hello, Thanks for the report. Malte Frank Gerdes 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 ( = ypiv8dj4lkvsnm82s639h18l87frrh5g): > /gnu/store/-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 .) The following patch should explicitly set CXX for Go, so that it always uses the "system" version: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=go-explicitly-set-CXX.patch Content-Description: go-explicitly-set-CXX.patch 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))) --=-=-= Content-Type: text/plain Hope that helps, Sarah --=-=-=--