Why the compiler can't build linux 6.12?

I’m doing some work on linux 6.12, using the musl cross-compilation chain from host-tools provided by the sdk.
Kernel startup is stuck at starting kernel.
When using glibc, everything works fine.
I built a musl cross-compilation chain myself from here, and it also works fine.
Can anyone provide some help?

The musl cross-compilation toolchain I built myself:

Using built-in specs. COLLECT_GCC=./riscv64-linux-musl-gcc COLLECT_LTO_WRAPPER=/home/troy/software/cross-compile/riscv64-musl/bin/../libexec/gcc/riscv64-linux-musl/9.4.0/lto-wrapper Target: riscv64-linux-musl Configured with: ../src_gcc/configure --enable-languages=c,c++ --disable-bootstrap --disable-assembly --disable-werror --target=riscv64-linux-musl --prefix= --libdir=/lib --disable-multilib --with-sysroot=/riscv64-linux-musl --enable-tls --disable-libmudflap --disable-libsanitizer --disable-gnu-indirect-function --disable-libmpx --enable-initfini-array --enable-libstdcxx-time=rt --with-build-sysroot=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_sysroot AR_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/binutils/ar AS_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/gas/as-new LD_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/ld/ld-new NM_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/binutils/nm-new OBJCOPY_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/binutils/objcopy OBJDUMP_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/binutils/objdump RANLIB_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/binutils/ranlib READELF_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/binutils/readelf STRIP_FOR_TARGET=/home/troy/software/musl-cross-make/build/local/riscv64-linux-musl/obj_binutils/binutils/strip-new --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu Thread model: posix gcc version 9.4.0 (GCC)

host-tools:

Using built-in specs. COLLECT_GCC=./riscv64-unknown-linux-musl-gcc COLLECT_LTO_WRAPPER=/home/troy/duo/duo-buildroot-sdk/host-tools/gcc/riscv64-linux-musl-x86_64/bin/../libexec/gcc/riscv64-unknown-linux-musl/10.2.0/lto-wrapper Target: riscv64-unknown-linux-musl Configured with: /mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/./source/riscv/riscv-gcc/configure --target=riscv64-unknown-linux-musl --with-gmp=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/build-gcc-riscv64-u nknown-linux-musl/build-Xuantie-900-gcc-linux-5.10.4-musl64-x86_64-V2.6.1/lib-for-gcc-x86_64-linux --with-mpfr=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/build-gcc-riscv64-u nknown-linux-musl/build-Xuantie-900-gcc-linux-5.10.4-musl64-x86_64-V2.6.1/lib-for-gcc-x86_64-linux --with-mpc=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/build-gcc-riscv64-u nknown-linux-musl/build-Xuantie-900-gcc-linux-5.10.4-musl64-x86_64-V2.6.1/lib-for-gcc-x86_64-linux --with-libexpat-prefix=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/build-gcc-ris cv64-unknown-linux-musl/build-Xuantie-900-gcc-linux-5.10.4-musl64-x86_64-V2.6.1/lib-for-gcc-x86_64-linux --with-libmpfr-prefix=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/build-gcc-risc v64-unknown-linux-musl/build-Xuantie-900-gcc-linux-5.10.4-musl64-x86_64-V2.6.1/lib-for-gcc-x86_64-linux --with-pkgversion='Xuantie-900 linux-5.10.4 musl gcc Toolchain V2.6.1 B-20220906' CXXFLAGS='-g -O2 -DTHEAD_VERSION_NUMBER=2.6.1 ' --prefix=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/build-gcc-riscv64-unknown-linux-musl/Xuantie-900-gcc-linux-5.10.4-musl64-x86_64-V2.6.1 --with-sysroot=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/build-gcc-riscv64-unknown-linux-musl/Xuantie-900-gcc-linux-5.10.4-musl64-x86_64-V2.6.1/sysroot --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++ --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap --src=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv_4/./source/riscv/riscv-gcc --enable-multilib --with-abi=lp64d --with-arch=rv64gcxthead 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medany' Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (Xuantie-900 linux-5.10.4 musl gcc Toolchain V2.6.1 B-20220906)
1 Like

Could it be alignment issue between uboot and uimage? I haven’t compile RISCV kernel yet, but I have had similar issue (stuck after starting kernel print) with ARMv7 when upgrading from kernel 4.x to 5.x. Around uboot 2021-ish of time, there were a change that requests a stricter alignment in the uimage, while the prepared uimage may not meet that requirement if your packing tool is outdated (tools in some ubuntu version is old).
I can’t tell if it is your issue, but just something to be careful about. It took me quite a couple of weeks to realise that issue.

1 Like

Which device tree did you use?

1 Like

I have resolved…
It has nothing to do with the compiler, I made some mistakes

1 Like