Resolve “`.rodata' can not be used when making a PIE object; recompile with -fPIC” or -fPIE
```
/usr/bin/ld: /home/gwm/workspaces/gitlab/j6_nni/deps_x86/gflags/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
```
If we use CMake tool to help compile, we can just add an "-no-pie" to linker flags:
SET(CMAKE_EXE_LINKER_FLAGS " -no-pie")
0 条评论