cpuinfo icon indicating copy to clipboard operation
cpuinfo copied to clipboard

Failed to compile shared library

Open zhangzhimin opened this issue 1 year ago • 1 comments

base) ➜  build_debug git:(preview) ✗ make cpuinfo
Consolidate compiler generated dependencies of target cpuinfo
[  0%] Linking C shared library ../../lib/libcpuinfo.so
/usr/bin/ld: CMakeFiles/cpuinfo.dir/src/init.c.o: in function `cpuinfo_initialize':
/home/zhimin/Projects/Matazure/galois/third_party/cpuinfo/src/init.c:30: undefined reference to `cpuinfo_x86_linux_init'
/usr/bin/ld: CMakeFiles/cpuinfo.dir/src/init.c.o: relocation R_X86_64_PC32 against undefined hidden symbol `cpuinfo_x86_linux_init' can not be used when making a shared object
/usr/bin/ld: final link failed: bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [third_party/cpuinfo/CMakeFiles/cpuinfo.dir/build.make:145: lib/libcpuinfo.so] Error 1
make[2]: *** [CMakeFiles/Makefile2:55466: third_party/cpuinfo/CMakeFiles/cpuinfo.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:55473: third_party/cpuinfo/CMakeFiles/cpuinfo.dir/rule] Error 2
make: *** [Makefile:19806: cpuinfo] Error 2

third_party/cpuinfo/src/cpuinfo/internal-api.h: 51

CPUINFO_PRIVATE void cpuinfo_x86_linux_init(void);

CPUINFO_PRIVATE will make cpuinfo_x86_linux_init symbol to be hidden, so we can not use it in the shared library?

zhangzhimin avatar Oct 08 '24 20:10 zhangzhimin