Re: [PATCH v3 0/8] Add objtool and orc support for LoongArch

From: Tiezhu Yang
Date: Fri Oct 20 2023 - 06:28:17 EST




On 10/20/2023 04:51 PM, Huacai Chen wrote:
Cross compiling on X86 for LoongArch fails:

CALL scripts/checksyscalls.sh
DESCEND objtool
make[5]: *** No rule to make target
'/usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h', needed by
'/home/chenhuacai/linux-official.git/tools/objtool/libsubcmd/exec-cmd.o'.
Stop.
make[4]: *** [Makefile:80:
/home/chenhuacai/linux-official.git/tools/objtool/libsubcmd/libsubcmd-in.o]
Error 2
make[3]: *** [Makefile:82:
/home/chenhuacai/linux-official.git/tools/objtool/libsubcmd/libsubcmd.a]
Error 2
make[2]: *** [Makefile:73: objtool] Error 2
make[1]: *** [/home/chenhuacai/linux-official.git/Makefile:1355:
tools/objtool] Error 2
make: *** [Makefile:234: __sub-make] Error 2

It seems that there is no stdbool.h in your cross compile environment.

It works well with the following steps, you can try it.

wget https://github.com/loongson/build-tools/releases/download/2023.08.08/x86_64-cross-tools-loongarch64-gcc-libc.tar.xz
tar xf x86_64-cross-tools-loongarch64-gcc-libc.tar.xz -C /opt
export PATH=/opt/cross-tools/bin/:$PATH
export LD_LIBRARY_PATH=/opt/cross-tools/loongarch64-unknown-linux-gnu/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/cross-tools/lib:$LD_LIBRARY_PATH
export CROSS_COMPILE=loongarch64-unknown-linux-gnu-
export ARCH=loongarch

find /opt -name stdbool.h
/opt/cross-tools/lib/gcc/loongarch64-unknown-linux-gnu/14.0.0/include/stdbool.h
/opt/cross-tools/loongarch64-unknown-linux-gnu/include/c++/14.0.0/tr1/stdbool.h

cd linux.git
make loongson3_defconfig
make menuconfig # select CONFIG_UNWINDER_ORC
make -j4

Thanks,
Tiezhu