bitcoin: guix: building for `aarch64-linux-gnu` on aarch64 fails

Running a Guix build of master (f002f8a0e76bd5abd60ef6809b1ff2b4c2d56071) using:

HOSTS="aarch64-linux-gnu" ./contrib/guix/guix-build

on aarch64 hardware (Alpine Docker container, running on Apple M1) currently fails with the following:

cc1: error: no include path in which to search for stdc-predef.h
/gnu/store/lzf5zg0diw2bhh2qji4bl2v46wd8pylc-bash-minimal-5.1.8/bin/bash ../../gcc-10.3.0/gcc/../move-if-change tmp-macro_list macro_list
echo timestamp > s-macro_list
rm -rf include-fixed; mkdir include-fixed
chmod a+rx include-fixed
if [ -d ../prev-gcc ]; then \
  cd ../prev-gcc && \
  make real-install-headers-tar DESTDIR=`pwd`/../gcc/ \
    libsubdir=. ; \
else \
  set -e; for ml in `cat fixinc_list`; do \
    sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`; \
    multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`; \
    fix_dir=include-fixed${multi_dir}; \
    if ! false && test ! -d `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`; then \
      echo The directory that should contain system headers does not exist: >&2 ; \
      echo "  `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`" >&2 ; \
      tooldir_sysinc=`echo "/gnu/store/bp869rrz2z24yvjyma9kkj0alzxvqkc2-gcc-cross-sans-libc-aarch64-linux-gnu-10.3.0-lib/lib/gcc/aarch64-linux-gnu/10.3.0/../../../../../../../aarch64-linux-gnu/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
      if test "x`echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`" = "x${tooldir_sysinc}"; \
      then sleep 1; else exit 1; fi; \
    fi; \
    /gnu/store/lzf5zg0diw2bhh2qji4bl2v46wd8pylc-bash-minimal-5.1.8/bin/bash ../../gcc-10.3.0/gcc/../mkinstalldirs ${fix_dir}; \
    chmod a+rx ${fix_dir} || true; \
    (TARGET_MACHINE='aarch64-unknown-linux-gnu'; srcdir=`cd ../../gcc-10.3.0/gcc; ${PWDCMD-pwd}`; \
      SHELL='/gnu/store/lzf5zg0diw2bhh2qji4bl2v46wd8pylc-bash-minimal-5.1.8/bin/bash'; MACRO_LIST=`${PWDCMD-pwd}`/macro_list ; \
      gcc_dir=`${PWDCMD-pwd}` ; \
      export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
      cd ../build-aarch64-unknown-linux-gnu/fixincludes && \
      /gnu/store/lzf5zg0diw2bhh2qji4bl2v46wd8pylc-bash-minimal-5.1.8/bin/bash ./fixinc.sh "${gcc_dir}/${fix_dir}" \
        `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`  ); \
    rm -f ${fix_dir}/syslimits.h; \
    if [ -f ${fix_dir}/limits.h ]; then \
      mv ${fix_dir}/limits.h ${fix_dir}/syslimits.h; \
    else \
      cp ../../gcc-10.3.0/gcc/gsyslimits.h ${fix_dir}/syslimits.h; \
    fi; \
    chmod a+r ${fix_dir}/syslimits.h; \
  done; \
fi
The directory that should contain system headers does not exist:
  /usr/include
make[3]: *** [Makefile:3172: stmp-fixinc] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-10.3.0.drv-0/build/gcc'
make[2]: *** [Makefile:4688: all-stage1-gcc] Error 2
make[2]: Leaving directory '/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-10.3.0.drv-0/build'
make[1]: *** [Makefile:18381: stage1-bubble] Error 2
make[1]: Leaving directory '/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-10.3.0.drv-0/build'
make: *** [Makefile:946: all] Error 2

Full build log.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (24 by maintainers)

Commits related to this issue

Most upvoted comments

Another step has been made. Now the following packages are being built successfully:

The reason you’re no-longer seeing the previous issue is because by bumping to the newer glibc, that code that was failing to compile (sunrpc) has been obseleted and removed. In any case, bumping to a much newer glibc is not going to be an appropriate fix. I had patched around the sunrpc issue by backporting a glibc commit, see here so no need for a bump, but had stopped looking again after running into the above.

The new issue is this one: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56954. However I think the actual problem here is to do with the fact that this is a cross-compilation, but less so compared to our other cross-compiles. i.e it’s more like x86_64 on x86_64, and something in cross-compilation detection is getting confused.