linux编译问题集锦(持续更新中)

问题:fileappender.o relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPI
解决:

  1. 使用 ar -x liblog4cplus.a 解包
  2. readelf --relocs fileappender.o | egrep '(GOT|PLT|JU?MP_SLOT)' 如果输出为空,则该静态库没有position-independent,需要在该静态库的编译脚本添加 -fPIC
posted @ 2015-09-20 22:28  Lcnoctave  阅读(7560)  评论(0编辑  收藏  举报