unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauermann@kolabnow.com>
To: help-guix@gnu.org
Subject: Build Mesa with a different toolchain version
Date: Tue, 01 Jun 2021 21:46:56 -0300	[thread overview]
Message-ID: <3126247.iAZJFXckTJ@popigai> (raw)

Hello,

I'm having and issue with Mesa on i686-linux which I suspect is caused by
the version of GCC used to build it (i.e. 7.5.0).

To test my theory, I'm trying to build Mesa with a newer version of the
compiler. I tried a few different things, but none worked. I would be
grateful if someone could help me figure out how to do this:

Try #1:

$ guix build --system=i686-linux \
	--with-input=gcc-toolchain=gcc-toolchain@10.3.0 mesa
[…]
successfully built /gnu/store/bg01dw0178yb7v9xr4zmq5f05200f2ql-mesa-20.2.4.drv
/gnu/store/mvy7pl73yqrd9pi3k3xq14i6dmnfbl8s-mesa-20.2.4-bin
/gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4

So aparently it worked. But when checking the libraries, they still
link to GCC 7.5.0.

$ ldd /gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc 
        libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51d9000)
        libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50b9000)

And surprisingly, when changing the requested gcc-toolchain version,
guix doesn't attempt to build anything and just returns the same
store items from the “10.3.0” build:

$ guix build --system=i686-linux --with-input=gcc-toolchain=gcc-toolchain@11.1.0 mesa
/gnu/store/mvy7pl73yqrd9pi3k3xq14i6dmnfbl8s-mesa-20.2.4-bin
/gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4

Try #2:

Next, I tried using ‘package-input-rewriting’ by putting the following
package definition in a channel I created locally (with the appropriate
‘#:use-module’ directives at the top):

```
(define gcc->gcc-10
  (package-input-rewriting `((,gcc . ,gcc-10)
                             (,(make-libstdc++ gcc) . ,(make-libstdc++ gcc-10)))))

(define-public mesa-10
  (package
    (inherit (gcc->gcc-10 mesa))
    (name "mesa-10")))
```

And then:

$ guix pull && guix build --system=i686-linux mesa-10
[…]
successfully built /gnu/store/g4j9kmxgp6lashyipcydn7i6vh2v4s3c-mesa-10-20.2.4.drv
/gnu/store/8iiwn9cnjlfxfi7m1fmdavzgr7y38vv7-mesa-10-20.2.4-bin
/gnu/store/hjci6cqw76hvdawdl04kjmbajklsdwx2-mesa-10-20.2.4

And unfortunately I saw many GCC 7.5.0 processes in the build, for example
(command line abridged because it's too big):

$ pgrep -u guixbuilder01 -a -f cc1
119240 /gnu/store/…-gcc-7.5.0/libexec/gcc/i686-unknown-linux-gnu/7.5.0/cc1 […]

And indeed, still linked to GCC 7.5.0 libraries:

$ ldd /gnu/store/hjci6cqw76hvdawdl04kjmbajklsdwx2-mesa-10-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
        libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51ff000)
        libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50df000)

Also tried using GCC 11 by doing `s/-10/-11/g` in the code I quoted above
and building again:

$ guix build --system=i686-linux mesa-11
[…]
successfully built /gnu/store/vnmwibfpsw3fkm7q7y6z4r5273ri4qra-mesa-11-20.2.4.drv
/gnu/store/w5l307c1vnsik5h1zd9bcjzld2yp6xyl-mesa-11-20.2.4-bin
/gnu/store/l98bxwa5psb3yx56hhb78zr043s10p7q-mesa-11-20.2.4

At least this time it redoes the build instead of just returning the same
store items, but I still see the GCC 7.5.0 processes during the build:

$ pgrep -u guixbuilder01 -a -f cc1
127514 /gnu/store/…-gcc-7.5.0/libexec/gcc/i686-unknown-linux-gnu/7.5.0/cc1 […]

And again, linked with GCC 7.5.0 libraries:

$ ldd /gnu/store/l98bxwa5psb3yx56hhb78zr043s10p7q-mesa-11-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
        libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51e4000)
        libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50c4000)

-- 
Thanks,
Thiago





             reply	other threads:[~2021-06-02  9:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  0:46 Thiago Jung Bauermann [this message]
2021-06-02  1:53 ` Build Mesa with a different toolchain version Thiago Jung Bauermann
2021-06-02  9:44   ` Tobias Geerinckx-Rice
2021-06-02  9:22 ` Efraim Flashner
2021-06-03  5:14   ` Thiago Jung Bauermann
2021-06-02  9:42 ` Tobias Geerinckx-Rice
2021-06-02 11:13   ` Tobias Geerinckx-Rice
2021-06-03  5:35     ` Thiago Jung Bauermann
2021-06-03  5:17   ` Thiago Jung Bauermann

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=3126247.iAZJFXckTJ@popigai \
    --to=bauermann@kolabnow.com \
    --cc=help-guix@gnu.org \
    /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).