guix: building for `aarch64-linux-gnu` on aarch64 fails #22458

issue fanquake opened this issue on July 15, 2021
  1. fanquake commented at 1:22 PM on July 15, 2021: member

    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.

  2. fanquake added the label Bug on Jul 15, 2021
  3. fanquake added the label Build system on Jul 15, 2021
  4. MarcoFalke commented at 2:39 PM on July 15, 2021: member

    See also #21194

  5. dongcarl commented at 2:02 AM on July 16, 2021: contributor

    @fanquake Looks like the build log was truncated, can you send the full one?

  6. fanquake commented at 2:07 AM on July 16, 2021: member

    @fanquake Looks like the build log was truncated, can you send the full one?

    If you click "raw" when looking at the gist, it should show you the full log.

  7. dongcarl commented at 2:12 AM on July 16, 2021: contributor

    Ah thanks!

  8. dongcarl commented at 2:52 AM on July 16, 2021: contributor

    @fanquake Could you try out this patch for me?

    diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
    index 5805006053..414a596f17 100644
    --- a/contrib/guix/manifest.scm
    +++ b/contrib/guix/manifest.scm
    @@ -93,9 +93,11 @@ http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
       (let* ((xbinutils (cross-binutils target))
              ;; 1. Build a cross-compiling gcc without targeting any libc, derived
              ;; from BASE-GCC-FOR-LIBC
    -         (xgcc-sans-libc (cross-gcc target
    -                                    #:xgcc base-gcc-for-libc
    -                                    #:xbinutils xbinutils))
    +         (xgcc-sans-libc (package-with-extra-configure-variable
    +                          (cross-gcc target
    +                                     #:xgcc base-gcc-for-libc
    +                                     #:xbinutils xbinutils)
    +                          "inhibit_libc" "true"))
              ;; 2. Build cross-compiled kernel headers with XGCC-SANS-LIBC, derived
              ;; from BASE-KERNEL-HEADERS
              (xkernel (cross-kernel-headers target
    
    
  9. fanquake referenced this in commit ffd1b1240f on Jul 16, 2021
  10. fanquake referenced this in commit 29a6d264ed on Jul 16, 2021
  11. fanquake commented at 6:15 AM on July 16, 2021: member

    @fanquake Could you try out this patch for me?

    Thanks for taking a look. I've just tried the patch, branch here, and it looks like it's failing in the same way, however the full build log is available here: https://gist.github.com/fanquake/20487ae1b64cc57c215e7ce590501b92.

  12. dongcarl commented at 6:19 AM on July 16, 2021: contributor

    @fanquake Might be a mistake on my end but wanted to verify: are you sure that you didn't accidentally make it "inhibit_libcc" (with an extra c?) That's what I'm seeing in the logs right now.

  13. fanquake referenced this in commit a9f9e4caf0 on Jul 16, 2021
  14. fanquake commented at 7:10 AM on July 16, 2021: member

    Might be a mistake on my end but wanted to verify:

    Ugh, nope, that was my bad. Fixed up the patch and re-ran the build: https://gist.github.com/fanquake/c372618a8cf9a0445d1930e00744f1b4. Note that I also ran a guix gc and guix pull between this and the last build.

  15. dongcarl commented at 7:33 AM on July 16, 2021: contributor

    @fanquake Huh... Do you mind building that specific derivation with --keep-failed and sending me the build directory as well? Gotta dig a bit.

  16. dongcarl commented at 11:40 PM on July 16, 2021: contributor

    Dug a bit, try:

    diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
    index 5805006053..be556fc522 100644
    --- a/contrib/guix/manifest.scm
    +++ b/contrib/guix/manifest.scm
    @@ -84,6 +84,16 @@ http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
       (package-with-extra-patches xbinutils
         (search-our-patches "binutils-mingw-w64-disable-flags.patch")))
     
    +(define (bitcoin-cross-gcc-sans-libc target xgcc xbinutils)
    +  (package
    +    (inherit (cross-gcc target
    +                        #:xgcc xgcc
    +                        #:xbinutils xbinutils))
    +    (arguments
    +     (substitute-keyword-arguments (package-arguments xgcc)
    +       ((#:make-flags flags)
    +        `(cons "inhibit_libc=true" ,flags))))))
    +
     (define (make-cross-toolchain target
                                   base-gcc-for-libc
                                   base-kernel-headers
    @@ -93,9 +103,9 @@ http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
       (let* ((xbinutils (cross-binutils target))
              ;; 1. Build a cross-compiling gcc without targeting any libc, derived
              ;; from BASE-GCC-FOR-LIBC
    -         (xgcc-sans-libc (cross-gcc target
    -                                    #:xgcc base-gcc-for-libc
    -                                    #:xbinutils xbinutils))
    +         (xgcc-sans-libc (bitcoin-cross-gcc-sans-libc target
    +                                                      base-gcc-for-libc
    +                                                      xbinutils))
              ;; 2. Build cross-compiled kernel headers with XGCC-SANS-LIBC, derived
              ;; from BASE-KERNEL-HEADERS
              (xkernel (cross-kernel-headers target
    
  17. sipa commented at 11:51 PM on July 16, 2021: member

    @dongcarl Have a branch?

  18. fanquake referenced this in commit e30f194b11 on Jul 16, 2021
  19. fanquake commented at 11:56 PM on July 16, 2021: member
  20. dongcarl commented at 12:02 AM on July 17, 2021: contributor

    Writing down some context for myself so I don't forget:

    1. inhibit_libc is only AC_SUBST'd at the gcc/ sub-directory, but NOT at the top directory of the gcc repository
    2. GCC does not use AC_CONFIG_SUBDIRS for its subdirectories, rather, it runs ./configure for its subdirectories at make-time, this means that a flag supplied at ./configure-time at the top directory and not AC_SUBST'd would not be passed to ./configure at the subdirectory level.
  21. dongcarl commented at 12:03 AM on July 17, 2021: contributor

    Also... I should get myself an aarch64 build box......

  22. fanquake commented at 1:31 AM on July 17, 2021: member

    Tested with the updated patch:

    make[3]: Leaving directory '/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/gcc'
    mkdir -p -- aarch64-unknown-linux-gnu/libgcc
    Checking multilib configuration for libgcc...
    Configuring stage 1 in aarch64-unknown-linux-gnu/libgcc
    configure: creating cache ./config.cache
    checking build system type... aarch64-unknown-linux-gnu
    checking host system type... aarch64-unknown-linux-gnu
    checking for --enable-version-specific-runtime-libs... no
    checking for a BSD-compatible install... /gnu/store/wiv74mq31s0vppzm99qwnjkd8xa3albw-coreutils-8.32/bin/install -c
    checking for gawk... gawk
    checking for aarch64-unknown-linux-gnu-ar... ar
    checking for aarch64-unknown-linux-gnu-lipo... lipo
    checking for aarch64-unknown-linux-gnu-nm... /tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/./gcc/nm
    checking for aarch64-unknown-linux-gnu-ranlib... ranlib
    checking for aarch64-unknown-linux-gnu-strip... strip
    checking whether ln -s works... yes
    checking for aarch64-unknown-linux-gnu-gcc... /tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/./gcc/xgcc -B/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/./gcc/ -B/gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/bin/ -B/gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/lib/ -isystem /gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/include -isystem /gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/sys-include   
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether /tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/./gcc/xgcc -B/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/./gcc/ -B/gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/bin/ -B/gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/lib/ -isystem /gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/include -isystem /gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/sys-include    accepts -g... yes
    checking for /tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/./gcc/xgcc -B/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/./gcc/ -B/gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/bin/ -B/gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/lib/ -isystem /gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/include -isystem /gnu/store/0x6x96gvifjp5zhcj48s9cf29zb0ffil-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0/aarch64-unknown-linux-gnu/sys-include    option to accept ISO C89... none needed
    checking how to run the C preprocessor... /lib/cpp
    configure: error: in `/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build/aarch64-unknown-linux-gnu/libgcc':
    configure: error: C preprocessor "/lib/cpp" fails sanity check
    See `config.log' for more details.
    make[2]: *** [Makefile:16831: configure-stage1-target-libgcc] Error 1
    make[2]: Leaving directory '/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build'
    make[1]: *** [Makefile:21251: stage1-bubble] Error 2
    make[1]: Leaving directory '/tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-0/build'
    make: *** [Makefile:932: all] Error 2
    command "make" "-j" "7" "inhibit_libc=true" "LDFLAGS_FOR_TARGET=-B/gnu/store/cb88z63hyg1icd2kkahiink2p291mhr2-glibc-2.31/lib -Wl,-dynamic-linker -Wl,/gnu/store/cb88z63hyg1icd2kkahiink2p291mhr2-glibc-2.31/lib/ld-linux-aarch64.so.1" "LDFLAGS=-Wl,-rpath=/gnu/store/cb88z63hyg1icd2kkahiink2p291mhr2-glibc-2.31/lib -Wl,-dynamic-linker -Wl,/gnu/store/cb88z63hyg1icd2kkahiink2p291mhr2-glibc-2.31/lib/ld-linux-aarch64.so.1" "BOOT_CFLAGS=-O2 -g0" failed with status 2
    

    Full log.

    Then ran:

    guix build /gnu/store/1rmh3vsc39ls8q5zqx9pn6613h5avpay-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv --keep-failed
    

    The contents of that directory (tmp/guix-build-gcc-cross-sans-libc-aarch64-linux-gnu-7.5.0.drv-6/) is available here: https://github.com/fanquake/build_artifacts/releases/tag/guix_22458.

  23. dongcarl commented at 9:43 PM on July 21, 2021: contributor
  24. fanquake referenced this in commit fe5fdbd687 on Mar 9, 2022
  25. hebasto commented at 9:47 AM on May 19, 2022: member

    FWIW, I've tried another approach, but it also fails. The error differs from the initial one though.

  26. hebasto commented at 12:09 PM on May 21, 2022: member

    FWIW, I've tried another approach, but it also fails. The error differs from the initial one though.

    Following this rabbit hole, I found that the --build=aarch64-unknown-linux-gnu and --target=aarch64-linux-gnu configure flags change the build system behavior in the following way.

    For the mentioned set of flags, which is broken:

    ... | grep -e 'in \./'
    Configuring stage 1 in ./libiberty
    Configuring stage 1 in ./intl
    Configuring stage 1 in ./libbacktrace
    Configuring stage 1 in ./libdecnumber
    Configuring stage 1 in ./gcc
    Configuring stage 1 in ./libcpp
    Configuring stage 2 in ./libiberty
    Configuring stage 2 in ./intl
    Configuring stage 2 in ./libbacktrace
    Configuring stage 2 in ./libdecnumber
    

    and the "stage 2" fails in each directory.

    For any other set of flags, which works fine:

    ... | grep -e 'in \./'
    Configuring in ./libiberty
    Configuring in ./fixincludes
    Configuring in ./libbacktrace
    Configuring in ./intl
    Configuring in ./libdecnumber
    Configuring in ./gcc
    Configuring in ./libcpp
    Configuring in ./libcc1
    
  27. hebasto commented at 8:36 AM on May 22, 2022: member

    FWIW, I've managed to build gcc-cross-sans-libc-aarch64-linux-gnu-10.3.0 with this branch. :pizza:

    Unfortunately, the following glibc-cross-aarch64-linux-gnu-2.24 fails.

    UPDATE: the full log is available here.

  28. hebasto commented at 11:07 AM on May 22, 2022: member

    FWIW, I've managed to build gcc-cross-sans-libc-aarch64-linux-gnu-10.3.0 with this branch.

    Unfortunately, the following glibc-cross-aarch64-linux-gnu-2.24 fails.

    UPDATE: the full log is available here.

    The error:

    aarch64-linux-gnu-gcc   -D_RPC_THREAD_SAFE_ -D_GNU_SOURCE -DIS_IN_build -include /tmp/guix-build-glibc-cross-aarch64-linux-gnu-2.24.drv-0/build/config.h rpc_main.c \
    	-o /tmp/guix-build-glibc-cross-aarch64-linux-gnu-2.24.drv-0/build/sunrpc/cross-rpc_main.o -MMD -MP -MF /tmp/guix-build-glibc-cross-aarch64-linux-gnu-2.24.drv-0/build/sunrpc/cross-rpc_main.o.dt -MT /tmp/guix-build-glibc-cross-aarch64-linux-gnu-2.24.drv-0/build/sunrpc/cross-rpc_main.o -c
    rpc_main.c:37:10: fatal error: errno.h: No such file or directory
       37 | #include <errno.h>
          |          ^~~~~~~~~
    compilation terminated.
    make[2]: *** [Makefile:171: /tmp/guix-build-glibc-cross-aarch64-linux-gnu-2.24.drv-0/build/sunrpc/cross-rpc_main.o] Error 1
    

    looks weird because the errno.h header is available in many places. For example, ../source/include/errno.h

  29. laanwj referenced this in commit b04f42efe3 on Jul 1, 2022
  30. fanquake commented at 5:09 PM on July 18, 2022: member

    Updated the build logs / failures in the issue description, as of master (f002f8a0e76bd5abd60ef6809b1ff2b4c2d56071).

  31. bitcoin deleted a comment on Jul 18, 2022
  32. fanquake referenced this in commit fe57cd7a1b on Aug 2, 2022
  33. hebasto commented at 10:53 AM on August 4, 2022: member

    FWIW, I've managed to build gcc-cross-sans-libc-aarch64-linux-gnu-10.3.0 with this branch. 🍕

    Unfortunately, the following glibc-cross-aarch64-linux-gnu-2.24 fails.

    UPDATE: the full log is available here.

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

    • gcc-cross-sans-libc-aarch64-linux-gnu
    • glibc-cross-aarch64-linux-gnu

    Building of gcc-cross-aarch64-linux-gnu fails with the following error:

    /tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/./prev-gcc/xg++ -B/tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/./prev-gcc/ -B/gnu/store/x4r97fc5k2d2h44nh6gq1dyw9k85m7kx-gcc-cross-aarch64-linux-gnu-10.3.0/aarch64-linux-gnu/bin/ -nostdinc++ -B/tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/src/.libs -B/tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/libsupc++/.libs  -I/tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/include/aarch64-linux-gnu  -I/tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/include  -I/tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/gcc-10.3.0/libstdc++-v3/libsupc++ -L/tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/src/.libs -L/tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/libsupc++/.libs -c   -g -O2 -fno-checking -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H  -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc-10.3.0/gcc -I../../gcc-10.3.0/gcc/build -I../../gcc-10.3.0/gcc/../include  -I../../gcc-10.3.0/gcc/../libcpp/include  \
    	-o build/gengtype-parse.o ../../gcc-10.3.0/gcc/gengtype-parse.c
    In file included from ./bconfig.h:3,
                     from ../../gcc-10.3.0/gcc/genchecksum.c:20:
    ./auto-host.h:2448:16: error: declaration does not declare anything [-fpermissive]
     2448 | #define rlim_t long
          |                ^~~~
    In file included from ../../gcc-10.3.0/gcc/genchecksum.c:21:
    ../../gcc-10.3.0/gcc/system.h:488:14: error: conflicting declaration of C function ‘void* sbrk(int)’
      488 | extern void *sbrk (int);
          |              ^~~~
    In file included from ../../gcc-10.3.0/gcc/system.h:294,
                     from ../../gcc-10.3.0/gcc/genchecksum.c:21:
    /gnu/store/y8x9n30a8lb18qz9757phgjg6kmp0zzf-glibc-cross-aarch64-linux-gnu-2.32/include/unistd.h:1055:14: note: previous declaration ‘void* sbrk(intptr_t)’
     1055 | extern void *sbrk (intptr_t __delta) __THROW;
          |              ^~~~
    In file included from ../../gcc-10.3.0/gcc/genchecksum.c:21:
    ../../gcc-10.3.0/gcc/system.h:496:14: error: ambiguating new declaration of ‘char* strstr(const char*, const char*)’
      496 | extern char *strstr (const char *, const char *);
          |              ^~~~~~
    In file included from /tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/include/cstring:42,
                     from ../../gcc-10.3.0/gcc/system.h:235,
                     from ../../gcc-10.3.0/gcc/genchecksum.c:21:
    /gnu/store/y8x9n30a8lb18qz9757phgjg6kmp0zzf-glibc-cross-aarch64-linux-gnu-2.32/include/string.h:327:1: note: old declaration ‘const char* strstr(const char*, const char*)’
      327 | strstr (const char *__haystack, const char *__needle) __THROW
          | ^~~~~~
    In file included from ../../gcc-10.3.0/gcc/genchecksum.c:21:
    ../../gcc-10.3.0/gcc/system.h:544:20: error: conflicting declaration of C function ‘const char* strsignal(int)’
      544 | extern const char *strsignal (int);
          |                    ^~~~~~~~~
    In file included from /tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/include/cstring:42,
                     from ../../gcc-10.3.0/gcc/system.h:235,
                     from ../../gcc-10.3.0/gcc/genchecksum.c:21:
    /gnu/store/y8x9n30a8lb18qz9757phgjg6kmp0zzf-glibc-cross-aarch64-linux-gnu-2.32/include/string.h:462:14: note: previous declaration ‘char* strsignal(int)’
      462 | extern char *strsignal (int __sig) __THROW;
          |              ^~~~~~~~~
    In file included from ../../gcc-10.3.0/gcc/system.h:695,
                     from ../../gcc-10.3.0/gcc/genchecksum.c:21:
    ../../gcc-10.3.0/gcc/../include/libiberty.h:112:14: error: ambiguating new declaration of ‘char* basename(const char*)’
      112 | extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
          |              ^~~~~~~~
    In file included from /tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/include/cstring:42,
                     from ../../gcc-10.3.0/gcc/system.h:235,
                     from ../../gcc-10.3.0/gcc/genchecksum.c:21:
    /gnu/store/y8x9n30a8lb18qz9757phgjg6kmp0zzf-glibc-cross-aarch64-linux-gnu-2.32/include/string.h:508:26: note: old declaration ‘const char* basename(const char*)’
      508 | extern "C++" const char *basename (const char *__filename)
          |                          ^~~~~~~~
    In file included from ./bconfig.h:3,
                     from ../../gcc-10.3.0/gcc/genhooks.c:20:
    ./auto-host.h:2448:16: error: declaration does not declare anything [-fpermissive]
     2448 | #define rlim_t long
          |                ^~~~
    In file included from ../../gcc-10.3.0/gcc/genhooks.c:21:
    ../../gcc-10.3.0/gcc/system.h:488:14: error: conflicting declaration of C function ‘void* sbrk(int)’
      488 | extern void *sbrk (int);
          |              ^~~~
    In file included from ../../gcc-10.3.0/gcc/system.h:294,
                     from ../../gcc-10.3.0/gcc/genhooks.c:21:
    /gnu/store/y8x9n30a8lb18qz9757phgjg6kmp0zzf-glibc-cross-aarch64-linux-gnu-2.32/include/unistd.h:1055:14: note: previous declaration ‘void* sbrk(intptr_t)’
     1055 | extern void *sbrk (intptr_t __delta) __THROW;
          |              ^~~~
    In file included from ../../gcc-10.3.0/gcc/genhooks.c:21:
    ../../gcc-10.3.0/gcc/system.h:496:14: error: ambiguating new declaration of ‘char* strstr(const char*, const char*)’
      496 | extern char *strstr (const char *, const char *);
          |              ^~~~~~
    In file included from /tmp/guix-build-gcc-cross-aarch64-linux-gnu-10.3.0.drv-0/build/prev-aarch64-linux-gnu/libstdc++-v3/include/cstring:42,
                     from ../../gcc-10.3.0/gcc/system.h:235,
                     from ../../gcc-10.3.0/gcc/genhooks.c:21:
    /gnu/store/y8x9n30a8lb18qz9757phgjg6kmp0zzf-glibc-cross-aarch64-linux-gnu-2.32/include/string.h:327:1: note: old declaration ‘const char* strstr(const char*, const char*)’
      327 | strstr (const char *__haystack, const char *__needle) __THROW
          | ^~~~~~
    make[3]: *** [Makefile:2723: build/genchecksum.o] Error 1
    
  34. fanquake commented at 12:36 PM on August 4, 2022: member

    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.

  35. fanquake referenced this in commit aedbfa3d36 on Aug 17, 2022
  36. fanquake referenced this in commit f98d7d5435 on Aug 18, 2022
  37. fanquake referenced this in commit a09860176c on Aug 19, 2022
  38. fanquake referenced this in commit a825457ece on Aug 19, 2022
  39. fanquake referenced this in commit 501615373c on Aug 19, 2022
  40. fanquake added this to the milestone 24.0 on Aug 19, 2022
  41. hebasto referenced this in commit a6882b0bc6 on Aug 22, 2022
  42. fanquake referenced this in commit c7d6724658 on Aug 22, 2022
  43. fanquake referenced this in commit eb08c59aea on Aug 23, 2022
  44. fanquake referenced this in commit 66117cc706 on Aug 24, 2022
  45. fanquake referenced this in commit f985ef3744 on Aug 24, 2022
  46. fanquake referenced this in commit 0faf2029a0 on Aug 24, 2022
  47. fanquake referenced this in commit 56e79fe683 on Aug 31, 2022
  48. fanquake closed this on Sep 4, 2022

  49. fanquake referenced this in commit df31e468b9 on Sep 4, 2022
  50. fanquake referenced this in commit b41fd3369d on Sep 4, 2022
  51. sidhujag referenced this in commit 2633ef7047 on Sep 4, 2022
  52. fanquake referenced this in commit 5465f7f9a5 on Oct 10, 2022
  53. dekm referenced this in commit 742d34acb4 on Oct 27, 2022
  54. dekm referenced this in commit 6feb67d850 on Oct 27, 2022
  55. dekm referenced this in commit 803da2b042 on Oct 27, 2022
  56. dekm referenced this in commit 7be91387dd on Nov 7, 2022
  57. fanquake referenced this in commit a59dd16cf5 on Nov 8, 2022
  58. fanquake referenced this in commit 0f4583e5c1 on Nov 8, 2022
  59. dekm referenced this in commit 70b22f0f88 on Nov 12, 2022
  60. dekm referenced this in commit 563e5c6d31 on Apr 6, 2023
  61. PastaPastaPasta referenced this in commit 325f0f5e07 on Apr 16, 2023
  62. PastaPastaPasta referenced this in commit e4a6ea6032 on Apr 16, 2023
  63. dekm referenced this in commit 4eef3195af on Jun 26, 2023
  64. dekm referenced this in commit 1cc903a5e5 on Jun 26, 2023
  65. bitcoin locked this on Sep 4, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-25 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me