Bug#1060075: gcc-13 FTCBFS: target system type set to nvptx-unknown-none
Control: retitle -1 gcc-13 FTCBFS: nvptx does not cross compile
On 2024-01-06 01:10, Matthias Klose wrote:
> no, the target is always nvptx-unknown-none.
Ack, but in order to cross build nvptx we probably have to set build and
host? I tried cross building gcc 13.2.0-23 on a x86 system with:
DEB_BUILD_OPTIONS='nolang=m2' sbuild --host=arm64
And I got the following error in build-nvptx/config.log:
configure:4591: checking whether we are cross compiling
configure:4599: aarch64-linux-gnu-gcc-13 -o conftest conftest.c >&5
configure:4603: $? = 0
configure:4610: ./conftest
../src-nvptx/configure: line 4612: ./conftest: cannot execute binary file: Exec format error
Things looked slightly better adding --build and --host to
CONFARGS_NVPTX, at least the build process went past the "checking
whether we are cross compiling" step.
diff -Nru gcc-13-13.2.0/debian/rules2 gcc-13-13.2.0/debian/rules2
--- gcc-13-13.2.0/debian/rules2 2024-03-23 13:29:34.000000000 +0100
+++ gcc-13-13.2.0/debian/rules2 2024-04-30 10:28:00.000000000 +0200
@@ -1524,7 +1524,9 @@
--enable-languages=c,c++,fortran,lto \
--enable-checking=release \
--with-system-zlib \
- --without-isl
+ --without-isl \
+ --build=$(DEB_BUILD_GNU_TYPE) \
+ --host=$(DEB_HOST_GNU_TYPE)
# --with-build-time-tools=/$(PF)/nvptx-none/bin
However, there is still a failure later on when the nvptx Makefile tries
to run nvptx-none-gcc -dumpspecs.
GCC_FOR_TARGET is set to nvptx-none-gcc in ./build-nvptx/Makefile and
used in ./build-nvptx/gcc/Makefile, but there is no such command.
cp xgcc gcc-cross
nvptx-none-gcc -dumpspecs > tmp-specs
rm -f gfortran-cross
/bin/bash: line 1: nvptx-none-gcc: command not found
make[4]: *** [Makefile:2226: specs] Error 127
make[4]: *** Waiting for unfinished jobs....
cp gfortran gfortran-cross
rm gcc.pod gfortran.pod lto-dump.pod
make[4]: Leaving directory '/<<PKGBUILDDIR>>/build-nvptx/gcc'
make[3]: *** [Makefile:4622: all-gcc] Error 2
make[3]: Leaving directory '/<<PKGBUILDDIR>>/build-nvptx'
make[2]: *** [Makefile:1022: all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/build-nvptx'
Any ideas welcome. Full build log at:
https://people.debian.org/~ema/gcc-13_13.2.0-23.1_arm64.build
Reply to: