how to cross-compile gcc for gnu/hurd with guix?

374 Views Asked by At

as far as i understand, you need to use guix build, specify the target platform and the package name.

i tried this but without success:

$ guix build --target=i586-pc-gnu gcc
...
building /gnu/store/2byqh17pv16wayzscxszmi1njycqrgm0-gawk-mesboot-3.1.8.drv...
...
starting phase `check'
error: in phase 'check': uncaught exception:
srfi-34 #<condition &invoke-error [program: "./gawk" arguments: ("--version") exit-status: #f term-signal: 11 stop-signal: #f] 1504440> 
phase `check' failed after 0.0 seconds
command "./gawk" "--version" failed with signal 11
builder for `/gnu/store/2byqh17pv16wayzscxszmi1njycqrgm0-gawk-mesboot-3.1.8.drv' failed with exit code 1
build of /gnu/store/2byqh17pv16wayzscxszmi1njycqrgm0-gawk-mesboot-3.1.8.drv failed
View build log at '/var/log/guix/drvs/2b/yqh17pv16wayzscxszmi1njycqrgm0-gawk-mesboot-3.1.8.drv.bz2'.
cannot build derivation `/gnu/store/i86785np132ja1s3nig1j26pawhzbl83-bash-minimal-5.1.8.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/2ya7ahb9058sdzghz3mww0xw7mhyv0l6-binutils-2.37.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/w8vi4byxf2brzhh43fr1m1lynd9hpls3-gcc-10.3.0.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/pnj0ann8r7sxb09sj8k1rkra3axqsks6-glibc-2.33.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/djg0pj29h1gn58j8x1lsxqwz95r4cpf7-guile-3.0.7.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/9qvm4sschajnx1x7qxrrs5sxj4vxgphq-libatomic-ops-7.6.10.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/wwqdxm9xqrdl2xwwf4v7rdi4q2r0w51h-libgc-8.0.4.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/v84prklf86izcyvxkm4bdl4mck0v0qm3-libunistring-0.9.10.drv': 1 dependencies couldn't be built
building /gnu/store/am0cafkm6mywhchml2c73bplmqbj6ks4-linux-libre-headers-5.10.35.drv...
cannot build derivation `/gnu/store/1mnrv6fjx2a0jxq5xzfdrgay1apfz0yw-gcc-toolchain-10.3.0.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/1mnrv6fjx2a0jxq5xzfdrgay1apfz0yw-gcc-toolchain-10.3.0.drv' failed

what am i doing wrong? how to cross-compile gcc with guix?

1

There are 1 best solutions below

0
On

advice from the #guix channel from the civodul:

the "gcc-toolchain" package is not amenable to cross-compilation, but the underlying "gcc" is (i know, it's confusing)
concretely, this works: guix build --target=i586-pc-gnu -e '(@ (gnu packages gcc) gcc-10)' -n
(the result is a native GNU/Hurd compiler)

yes, it helped:

$ guix build --target=i586-pc-gnu -e '(@ (gnu packages gcc) gcc)'
...
/gnu/store/gdxd409vrp42g5p6jg4m9lvjv6cwa2sh-gcc-10.3.0-debug
/gnu/store/zj4n31zj8ppngbg3cbfd8n37h2blaysb-gcc-10.3.0-lib
/gnu/store/5hxv2vr3gg2crf5cxig5z3d8llb173m2-gcc-10.3.0
$ file /gnu/store/5hxv2vr3gg2crf5cxig5z3d8llb173m2-gcc-10.3.0/bin/gcc
/gnu/store/5hxv2vr3gg2crf5cxig5z3d8llb173m2-gcc-10.3.0/bin/gcc:
 ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked,
 interpreter /gnu/store/wipjb74h71gqirk9c0hxv6q0ldgg3024-glibc-cross-i586-pc-gnu-2.33/lib/ld.so.1,
 for GNU/Hurd 0.0.0, stripped