On Wed, May 7, 2025 at 2:30 PM Vincent Li <vincent.mc.li@xxxxxxxxx> 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? I installed gcc-c++-loongarch64-linux-gnu.loongarch64, now the error is reduced to LIB liburandom_read.so /usr/bin/ld: cannot find -lstdc++: No such file or directory /usr/bin/ld: cannot find -lgcc_s: No such file or directory Why is it looking for lstdc++ that seems to be c++ library while urandom_read_lib1.c urandom_read_lib2.c are not c++ code? $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c liburandom_read.map $(call msg,LIB,,$@) $(Q)$(CLANG) $(CLANG_TARGET_ARCH) \ $(filter-out -static,$(CFLAGS) $(LDFLAGS)) \ $(filter %.c,$^) $(filter-out -static,$(LDLIBS)) \ -Wno-unused-command-line-argument \ -fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \ -Wl,--version-script=liburandom_read.map \ -fPIC -shared -o $@