In 3A6000/3C5000, gentoo is deployed. Using crossdev to add a cross-compilation environment does not work.
# 1. Run crossdev by referring to the corresponding documentation. ex
crossdev riscv64-linux-gnu
# The same is true for other architectures or combinations
# such as aarch64-unknown-linux-gnu, x86_64-pc-linux-gnu, i686-w64-mingw32
crossdev log
crossdev version: 20240209
Host Portage ARCH: loong
Host Portage System: loongarch64-unknown-linux-gnu (loongarch64-unknown-linux-gnu)
Target Portage ARCH: *
Target System: riscv64-linux-gnu
Stage: 4 (C/C++ compiler)
USE=multilib: no
Target ABIs: lp64d
binutils: binutils-[latest]
gcc: gcc-[latest]
headers: linux-headers-[latest]
libc: glibc-[latest]
CROSSDEV_OVERLAY: /var/db/repos/dlang
PORT_LOGDIR: /var/log/portage
PORTAGE_CONFIGROOT: /
Portage flags:
Log: /var/log/portage/cross-riscv64-linux-gnu-binutils.log
Emerging cross-binutils ... [ ok ]
Log: /var/log/portage/cross-riscv64-linux-gnu-gcc-stage1.log
Emerging cross-gcc-stage1 ...
error: gcc failed :(
If you file a bug, please attach the following logfiles:
/var/log/portage/cross-riscv64-linux-gnu-info.log
/var/log/portage/cross-riscv64-linux-gnu-gcc-stage1.log.xz
/var/tmp/portage/cross-riscv64-linux-gnu/gcc*/temp/gcc-config.logs.tar.xz
gcc log
make[2]: Leaving directory '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/build/riscv64-linux-gnu/libgcc'
make[1]: Leaving directory '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/build'
mv: cannot stat '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/image/usr/***lib64***/libcc1*': No such file or directory
ERROR: cross-riscv64-linux-gnu/gcc-14.0.9999::dlang failed (install phase):
(no error message)
Call stack:
ebuild.sh, line 136: Called src_install
environment, line 3044: Called toolchain_src_install
environment, line 4468: Called gcc_movelibs
environment, line 1595: Called die
The specific snippet of code:
mv "${ED}"/usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die;
If you need support, post the output of \`emerge --info '=cross-riscv64-linux-gnu/gcc-14.0.9999::dlang'\`,
the complete build log and the output of \`emerge -pqv '=cross-riscv64-linux-gnu/gcc-14.0.9999::dlang'\`.
Please include /var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/gcc-build-logs.tar.xz in your bug report.
The complete build log is located at '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/temp/build.log'.
The ebuild environment file is located at '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/temp/environment'.
Working directory: '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/build'
S: '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/gcc-14.0.9999'
\>\>\> Failed to emerge cross-riscv64-linux-gnu/gcc-14.0.9999, Log file:
\>\>\> '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/temp/build.log'
Messages for package cross-riscv64-linux-gnu/gcc-14.0.9999:
I think it has something to do with the environment variables generated by crossdev.
In 3A6000/3C5000, gentoo is deployed. Using crossdev to add a cross-compilation environment does not work.
crossdev log
crossdev version: 20240209 Host Portage ARCH: loong Host Portage System: loongarch64-unknown-linux-gnu (loongarch64-unknown-linux-gnu) Target Portage ARCH: * Target System: riscv64-linux-gnu Stage: 4 (C/C++ compiler) USE=multilib: no Target ABIs: lp64d binutils: binutils-[latest] gcc: gcc-[latest] headers: linux-headers-[latest] libc: glibc-[latest] CROSSDEV_OVERLAY: /var/db/repos/dlang PORT_LOGDIR: /var/log/portage PORTAGE_CONFIGROOT: / Portage flags: Log: /var/log/portage/cross-riscv64-linux-gnu-binutils.log Emerging cross-binutils ... [ ok ] Log: /var/log/portage/cross-riscv64-linux-gnu-gcc-stage1.log Emerging cross-gcc-stage1 ... error: gcc failed :( If you file a bug, please attach the following logfiles: /var/log/portage/cross-riscv64-linux-gnu-info.log /var/log/portage/cross-riscv64-linux-gnu-gcc-stage1.log.xz /var/tmp/portage/cross-riscv64-linux-gnu/gcc*/temp/gcc-config.logs.tar.xzgcc log
make[2]: Leaving directory '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/build/riscv64-linux-gnu/libgcc' make[1]: Leaving directory '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/build' mv: cannot stat '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/image/usr/***lib64***/libcc1*': No such file or directory ERROR: cross-riscv64-linux-gnu/gcc-14.0.9999::dlang failed (install phase): (no error message) Call stack: ebuild.sh, line 136: Called src_install environment, line 3044: Called toolchain_src_install environment, line 4468: Called gcc_movelibs environment, line 1595: Called die The specific snippet of code: mv "${ED}"/usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die; If you need support, post the output of \`emerge --info '=cross-riscv64-linux-gnu/gcc-14.0.9999::dlang'\`, the complete build log and the output of \`emerge -pqv '=cross-riscv64-linux-gnu/gcc-14.0.9999::dlang'\`. Please include /var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/gcc-build-logs.tar.xz in your bug report. The complete build log is located at '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/temp/build.log'. The ebuild environment file is located at '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/temp/environment'. Working directory: '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/build' S: '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/work/gcc-14.0.9999' \>\>\> Failed to emerge cross-riscv64-linux-gnu/gcc-14.0.9999, Log file: \>\>\> '/var/tmp/portage/cross-riscv64-linux-gnu/gcc-14.0.9999/temp/build.log' Messages for package cross-riscv64-linux-gnu/gcc-14.0.9999:I think it has something to do with the environment variables generated by crossdev.
crossdev env
## /etc/portage/env/cross-riscv64-linux-gnu/gcc.conf SYMLINK_LIB=no COLLISION_IGNORE="${COLLISION_IGNORE} /usr/lib/debug/.build-id" TARGET_ABI='lp64d' TARGET_MULTILIB_ABIS='lp64d' TARGET_DEFAULT_ABI='lp64d' CFLAGS_ilp32='-mabi=ilp32 -march=rv32imac' CFLAGS_ilp32d='-mabi=ilp32d -march=rv32imafdc' CFLAGS_lp64='-mabi=lp64 -march=rv64imac' CFLAGS_lp64d='-mabi=lp64d -march=rv64gc' CHOST_default='' CHOST_ilp32='riscv32-linux-gnu' CHOST_ilp32d='riscv32-linux-gnu' CHOST_lp64='riscv64-linux-gnu' CHOST_lp64d='riscv64-linux-gnu' CTARGET_default='riscv64-linux-gnu' CTARGET_ilp32='riscv32-linux-gnu' CTARGET_ilp32d='riscv32-linux-gnu' CTARGET_lp64='riscv64-linux-gnu' CTARGET_lp64d='riscv64-linux-gnu' LDFLAGS_lp64d='' LIBDIR_default='lib' LIBDIR_ilp32='lib32/ilp32' LIBDIR_ilp32d='lib32/ilp32d' LIBDIR_lp64='lib/lp64' LIBDIR_lp64d='***lib64***' ABI='lp64d' MULTILIB_ABIS='lp64d' DEFAULT_ABI='lp64d'But really, crossdev is a variable copied from another location.
This location is in
/var/db/repos/gentoo/eclass/
.