[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Build Mesa with a different toolchain version
From: |
Thiago Jung Bauermann |
Subject: |
Build Mesa with a different toolchain version |
Date: |
Tue, 01 Jun 2021 21:46:56 -0300 |
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
- Build Mesa with a different toolchain version,
Thiago Jung Bauermann <=