Appendix - Building Linux Binaries

On the Ubuntu 18.04LTS

cd $LINUX_TOP
export ARCH=arm64
export CROSS_COMPILE=gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-

sudo apt-get install gawk wget git-core diffstat unzip texinfo
gcc-multilib build-essential chrpath socat cpio python python3
python3-pip python3-pexpect xz-utils debianutils iputils-ping
python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm
libncurses-dev gawk flex bison openssl libssl-dev

git clone GitHub - altera-opensource/linux-socfpga: Linux development repository for socfpga linux-socfpga.a53
cd linux-socfpga.a53
git checkout -b test-kernel -t origin/socfpga-5.10.70-lts
make clean && make mrproper

echo “CONFIG_JFFS2_FS=y” >> arch/arm64/configs/defconfig
echo “CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=n” >> arch/arm64/configs/defconfig
sed -i ‘s/spi-max-frequency = <100000000>;/spi-max-frequency = <50000000>;/g’ arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts

make defconfig
make -j 48 Image dtbs modules

CALL scripts/atomic/check-atomics.sh
CC arch/arm64/kernel/asm-offsets.s
In file included from ./include/uapi/linux/swab.h:8,
from ./include/linux/swab.h:5,
from ./include/uapi/linux/byteorder/little_endian.h:13,
from ./include/linux/byteorder/little_endian.h:5,
from ./arch/arm64/include/uapi/asm/byteorder.h:23,
from ./include/asm-generic/bitops/le.h:6,
from ./arch/arm64/include/asm/bitops.h:29,
from ./include/linux/bitops.h:29,
from ./include/linux/of.h:15,
from ./include/linux/irqdomain.h:35,
from ./include/linux/acpi.h:13,
from ./include/acpi/apei.h:9,
from ./include/acpi/ghes.h:5,
from ./include/linux/arm_sdei.h:8,
from arch/arm64/kernel/asm-offsets.c:10:
./include/asm/swab.h:21:5: 警告: “LINUX_ARM_ARCH” is not defined, evaluates to 0 [-Wundef]
21 | #if LINUX_ARM_ARCH >= 6
| ^~~~~~~~~~~~~~~~~~
In file included from ./include/uapi/linux/signal.h:5,
from ./include/linux/signal_types.h:10,
from ./include/linux/sched.h:30,
from ./arch/arm64/include/asm/compat.h:16,
from ./arch/arm64/include/asm/stat.h:13,
from ./include/linux/stat.h:6,
from ./include/linux/sysfs.h:22,
from ./include/linux/kobject.h:20,
from ./include/linux/of.h:17,
from ./include/linux/irqdomain.h:35,
from ./include/linux/acpi.h:13,
from ./include/acpi/apei.h:9,
from ./include/acpi/ghes.h:5,
from ./include/linux/arm_sdei.h:8,
from arch/arm64/kernel/asm-offsets.c:10:
./include/asm/signal.h:11: 警告: “_NSIG_BPW”重定义
11 | #define _NSIG_BPW 32
|
In file included from ./include/asm-generic/signal.h:5,
from ./arch/arm64/include/uapi/asm/signal.h:26,
from ./include/asm/signal.h:5,
from ./include/uapi/linux/signal.h:5,
from ./include/linux/signal_types.h:10,
from ./include/linux/sched.h:30,
from ./arch/arm64/include/asm/compat.h:16,
from ./arch/arm64/include/asm/stat.h:13,
from ./include/linux/stat.h:6,
from ./include/linux/sysfs.h:22,
from ./include/linux/kobject.h:20,
from ./include/linux/of.h:17,
from ./include/linux/irqdomain.h:35,
from ./include/linux/acpi.h:13,
from ./include/acpi/apei.h:9,
from ./include/acpi/ghes.h:5,
from ./include/linux/arm_sdei.h:8,
from arch/arm64/kernel/asm-offsets.c:10:
./include/uapi/asm-generic/signal.h:8: 附注: 这是先前定义的位置
8 | #define _NSIG_BPW __BITS_PER_LONG
|
In file included from ./include/uapi/linux/signal.h:5,
from ./include/linux/signal_types.h:10,
from ./include/linux/sched.h:30,
from ./arch/arm64/include/asm/compat.h:16,
from ./arch/arm64/include/asm/stat.h:13,
from ./include/linux/stat.h:6,
from ./include/linux/sysfs.h:22,
from ./include/linux/kobject.h:20,
from ./include/linux/of.h:17,
from ./include/linux/irqdomain.h:35,
from ./include/linux/acpi.h:13,
from ./include/acpi/apei.h:9,
from ./include/acpi/ghes.h:5,
from ./include/linux/arm_sdei.h:8,
from arch/arm64/kernel/asm-offsets.c:10:
./include/asm/signal.h:18:3: 错误: conflicting types for ‘sigset_t’; have ‘struct <匿名>’
18 | } sigset_t;
| ^~~~~~~~
In file included from ./include/asm-generic/signal.h:5,
from ./arch/arm64/include/uapi/asm/signal.h:26,
from ./include/asm/signal.h:5,
from ./include/uapi/linux/signal.h:5,
from ./include/linux/signal_types.h:10,
from ./include/linux/sched.h:30,
from ./arch/arm64/include/asm/compat.h:16,
from ./arch/arm64/include/asm/stat.h:13,
from ./include/linux/stat.h:6,
from ./include/linux/sysfs.h:22,
from ./include/linux/kobject.h:20,
from ./include/linux/of.h:17,
from ./include/linux/irqdomain.h:35,
from ./include/linux/acpi.h:13,
from ./include/acpi/apei.h:9,
from ./include/acpi/ghes.h:5,
from ./include/linux/arm_sdei.h:8,
from arch/arm64/kernel/asm-offsets.c:10:
./include/uapi/asm-generic/signal.h:92:3: 附注: previous declaration of ‘sigset_t’ with type ‘sigset_t’
92 | } sigset_t;
| ^~~~~~~~
make[1]: *** [scripts/Makefile.build:117:arch/arm64/kernel/asm-offsets.s] 错误 1
make: *** [Makefile:1215:prepare0] 错误 2

Hi Sun,
I followed the following linux build according to
Stratix 10 SoC FPGA First Single QSPI Flash Boot | Projects | RocketBoards.org
and was able to make Image and dtbs
Maybe you can try making Linux-socfpga v5.10.100 according to this?
Host machine: CentOS7
Hope it helps