Re: [QUESTION] Loongarch bpf selftest liburandom_read.so build error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/08/2025 05:30 AM, Vincent Li wrote:
Hi,

I tried to build kernel 6.15-rc5 bpf selftests on Loongarch machine
running Fedora, the bpf test programs seems built ok, but I got
liburandom_read.so build error below:

  LIB      liburandom_read.so

/usr/bin/ld: cannot find crtbeginS.o: No such file or directory

/usr/bin/ld: cannot find -lstdc++: No such file or directory

/usr/bin/ld: cannot find -lgcc: No such file or directory

/usr/bin/ld: cannot find -lgcc_s: No such file or directory

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [Makefile:253:
/usr/src/linux/tools/testing/selftests/bpf/liburandom_read.so] Error 1

Am I missing  gcc tools for Fedora loongarch?

This is related with the cmake option when compiling Clang:

  "-DLLVM_HOST_TRIPLE=loongarch64-redhat-linux"

You can native compile and update your Clang like this:

git clone https://github.com/llvm/llvm-project.git
mkdir -p llvm-project/llvm/build && cd llvm-project/llvm/build
cmake .. -G "Ninja" \
         -DCMAKE_BUILD_TYPE=Release \
         -DLLVM_BUILD_RUNTIME=OFF \
         -DLLVM_ENABLE_PROJECTS="clang;lldb" \
         -DCMAKE_INSTALL_PREFIX=/usr/local/llvm \
         -DLLVM_TARGETS_TO_BUILD="BPF;LoongArch" \
         -DLLVM_HOST_TRIPLE=loongarch64-redhat-linux
ninja -j4
sudo rm -rf /usr/local/llvm && sudo ninja install
export PATH=/usr/local/llvm/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/llvm/lib:$LD_LIBRARY_PATH

or install the fedora 42 and then use this software repo:

https://mirrors.wsyu.edu.cn/fedora/linux/F42/rawhide/Everything/loongarch64/iso/

Thanks,
Tiezhu





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux