gcc: confused about -static -shared -fPIE -fPIC -Wl,-pie
问题 I'm trying to build clang, with all library static linked in. So that I can run it on CentOS 6 with ancient GCC 4.4 version. At first, I think adding the option -static by turning on LLVM_BUILD_STATIC is enough. But in the link stage, it errors out. dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie So, I add -fPIE -Wl,-pie to CMAKE_CXX_FLAGS, and it says --