unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 60056@debbugs.gnu.org
Subject: bug#60056: cross-compilation doesn't honor gcc native input
Date: Tue, 13 Dec 2022 21:16:20 -0500	[thread overview]
Message-ID: <87h6xy4tmz.fsf@gmail.com> (raw)

Hello Guix,

I've recently noticed that cross-compiling with a different GCC was not
possible by simply adding them as native inputs the same way we can
already do when compiling natively.

Here's an example in our package collection that fails to cross-compile
for that reason:

--8<---------------cut here---------------start------------->8---
$ guix build --target=arm-linux-gnueabihf --no-offload glibc@2.30

[...]

arm-linux-gnueabihf-gcc ../sysdeps/arm/aeabi_lcsts.c -c -std=gnu11 -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-definition -fmath-errno    -fno-stack-protector -DSTACK_PROTECTOR_LEVEL=0   -ftls-model=initial-exec      -I../include -I/tmp/guix-build-glibc-2.30.drv-0/build/csu  -I/tmp/guix-build-glibc-2.30.drv-0/build  -I../sysdeps/unix/sysv/linux/arm  -I../sysdeps/arm/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/arm  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/arm/armv7/multiarch  -I../sysdeps/arm/armv7  -I../sysdeps/arm/armv6t2  -I../sysdeps/arm/armv6  -I../sysdeps/arm/include -I../sysdeps/arm  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem /gnu/store/qxiyl966akwfj44vkswams3db61r45m7-gcc-cross-arm-linux-gnueabihf-10.3.0-lib/lib/gcc/arm-linux-gnueabihf/10.3.0/include -isystem /gnu/store/qxiyl966akwfj44vkswams3db61r45m7-gcc-cross-arm-linux-gnueabihf-10.3.0-lib/lib/gcc/arm-linux-gnueabihf/10.3.0/include-fixed -isystem /gnu/store/k4lzn762cpwwznxc2gvcyidfjnx3yw7b-linux-libre-headers-5.10.35/include -D_LIBC_REENTRANT -include /tmp/guix-build-glibc-2.30.drv-0/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -o /tmp/guix-build-glibc-2.30.drv-0/build/csu/aeabi_lcsts.o -MD -MP -MF /tmp/guix-build-glibc-2.30.drv-0/build/csu/aeabi_lcsts.o.dt -MT /tmp/guix-build-glibc-2.30.drv-0/build/csu/aeabi_lcsts.o
In file included from ../sysdeps/arm/libc-tls.c:19:
../csu/libc-tls.c: In function ‘__libc_setup_tls’:
../csu/libc-tls.c:209:30: error: array subscript 1 is outside the bounds of an interior zero-length array ‘struct dtv_slotinfo[0]’ [-Werror=zero-length-bounds]
  209 |   static_slotinfo.si.slotinfo[1].map = main_map;
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from ../sysdeps/arm/ldsodefs.h:38,
                 from ../sysdeps/gnu/ldsodefs.h:46,
                 from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,
                 from ../sysdeps/unix/sysv/linux/arm/ldsodefs.h:22,
                 from ../csu/libc-tls.c:21,
                 from ../sysdeps/arm/libc-tls.c:19:
../sysdeps/generic/ldsodefs.h:406:7: note: while referencing ‘slotinfo’
  406 |     } slotinfo[0];
      |       ^~~~~~~~
arm-linux-gnueabihf-gcc ../sysdeps/arm/aeabi_sighandlers.S -c     -I../include -I/tmp/guix-build-glibc-2.30.drv-0/build/csu  -I/tmp/guix-build-glibc-2.30.drv-0/build  -I../sysdeps/unix/sysv/linux/arm  -I../sysdeps/arm/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/arm  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/arm/armv7/multiarch  -I../sysdeps/arm/armv7  -I../sysdeps/arm/armv6t2  -I../sysdeps/arm/armv6  -I../sysdeps/arm/include -I../sysdeps/arm  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem /gnu/store/qxiyl966akwfj44vkswams3db61r45m7-gcc-cross-arm-linux-gnueabihf-10.3.0-lib/lib/gcc/arm-linux-gnueabihf/10.3.0/include -isystem /gnu/store/qxiyl966akwfj44vkswams3db61r45m7-gcc-cross-arm-linux-gnueabihf-10.3.0-lib/lib/gcc/arm-linux-gnueabihf/10.3.0/include-fixed -isystem /gnu/store/k4lzn762cpwwznxc2gvcyidfjnx3yw7b-linux-libre-headers-5.10.35/include -D_LIBC_REENTRANT -include /tmp/guix-build-glibc-2.30.drv-0/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -DASSEMBLER -I/tmp/guix-build-glibc-2.30.drv-0/build/csu/. -g -Werror=undef -Wa,--noexecstack   -o /tmp/guix-build-glibc-2.30.drv-0/build/csu/aeabi_sighandlers.o -MD -MP -MF /tmp/guix-build-glibc-2.30.drv-0/build/csu/aeabi_sighandlers.o.dt -MT /tmp/guix-build-glibc-2.30.drv-0/build/csu/aeabi_sighandlers.o
cc1: all warnings being treated as errors
make[2]: *** [/tmp/guix-build-glibc-2.30.drv-0/build/sysd-rules:519: /tmp/guix-build-glibc-2.30.drv-0/build/csu/libc-tls.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/tmp/guix-build-glibc-2.30.drv-0/glibc-2.30/csu'
make[1]: *** [Makefile:259: csu/subdir_lib] Error 2
make[1]: Leaving directory '/tmp/guix-build-glibc-2.30.drv-0/glibc-2.30'
make: *** [Makefile:9: all] Error 2
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "4") exit-status: 2 term-signal: #f stop-signal: #f> 
phase `build' failed after 8.5 seconds
command "make" "-j" "4" failed with status 2
builder for `/gnu/store/cpabyq7ly2sf1jxxbn8srbqkd9chz9w1-glibc-2.30.drv' failed with exit code 1
build of /gnu/store/cpabyq7ly2sf1jxxbn8srbqkd9chz9w1-glibc-2.30.drv failed
--8<---------------cut here---------------end--------------->8---

-- 
Thanks,
Maxim




             reply	other threads:[~2022-12-14  2:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14  2:16 Maxim Cournoyer [this message]
2022-12-15  3:23 ` bug#60056: [PATCH RFC 1/6] build: Add gnu-build-system v2 Maxim Cournoyer
2022-12-15  3:23   ` bug#60056: [PATCH RFC 2/6] build: gnu-build-system2: Remove source from native inputs Maxim Cournoyer
2022-12-15  3:23   ` bug#60056: [PATCH RFC 3/6] build-systems: gnu: Infer cross-toolchain from native-inputs components Maxim Cournoyer
2022-12-15  3:23   ` bug#60056: [PATCH RFC 4/6] gnu: glibc-2.30: Use gnu-build-system2 to fix cross-compiled build Maxim Cournoyer
2022-12-15  3:23   ` bug#60056: [PATCH RFC 5/6] gnu: make-linux-libre*: Use gnu-build-system2 to fix cross compilation Maxim Cournoyer
2022-12-15  3:23   ` bug#60056: [PATCH RFC 6/6] gnu: u-boot: Fix cross-compilation by using gnu-build-system2 Maxim Cournoyer
2022-12-15 15:09   ` bug#60056: [PATCH RFC 1/6] build: Add gnu-build-system v2 Ludovic Courtès
2022-12-16  4:56     ` Maxim Cournoyer
2022-12-17 11:53       ` zimoun
2022-12-17 15:58         ` Maxim Cournoyer

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=87h6xy4tmz.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=60056@debbugs.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).