由于缺少-fPIC
. _ 她来自 ci20 MIPS 开发板:
...
[ 92%] Built target cryptopp-object
Scanning dependencies of target cryptopp-shared
Scanning dependencies of target cryptopp-static
Linking CXX static library libcryptopp.a
Linking CXX shared library libcryptopp.so
/usr/bin/ld: CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o: relocation R_MIPS_HI16 against
`a local symbol' can not be used when making a shared object; recompile with -fPIC
CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
由于注册压力,该项目的政策是除了 32 位 x86 之外的所有地方都向我们提供 PIC。这意味着 x86_64、ARM-32、Aarch32、Aarch64、MIPS、MIPS64、UltraSparc 等获得 PIC。
我相信目标处理器是在CMAKE_SYSTEM_PROCESSOR
. 我遇到的问题是文档没有告诉我值,所以我无法弄清楚如何制作“非 32 位 x86”测试。
如何在 CMakeList.txt 中检测 32 位 x86 处理器?
更好的是,我希望看到 CMake 设置的处理器的完整列表CMAKE_SYSTEM_PROCESSOR
。如果有人有清单,那么提供它会很棒。