kalibera / rchk

102 stars 10 forks source link

linking module flags 'PIC Level': IDs have conflicting values #10

Closed mattdowle closed 6 years ago

mattdowle commented 6 years ago

I'm following the excellent instructions to build natively. I've compiled rchk ok. Now when I build R-devel, it runs well until the very end.

 . ~/build/rchk/scripts/build_r.sh
[ ... snip normal good ouput ... ]
WARNING:Could not find ".llvm_bc" ELF section in "/home/mdowle/build/R-devel/src/extra/blas/libRblas.so", so skipping this entry.
WARNING:Could not find ".llvm_bc" ELF section in "/home/mdowle/build/R-devel/src/modules/lapack/libRlapack.so", so skipping this entry.
WARNING:Could not find ".llvm_bc" ELF section in "/home/mdowle/build/R-devel/lib/libRblas.so", so skipping this entry.
WARNING:Could not find ".llvm_bc" ELF section in "/home/mdowle/build/R-devel/lib/libRlapack.so", so skipping this entry.
ERROR: linking module flags 'PIC Level': IDs have conflicting values
ERROR: linking module flags 'PIC Level': IDs have conflicting values

R-devel appears to be functional, so I proceeded to check the package

~/build/R-devel/packages/lib/data.table$ cat ./libs/datatable.so.maacheck
error: linking module flags 'PIC Level': IDs have conflicting values

Almost there! I'm just looking for quick pointers where to look next. Maybe LLVM Gold linker? But I thought the scripts handled this automatically, if I read correctly.

kalibera commented 6 years ago

The error is from LLVM linker, you may be linking modules with different PIC levels, e.g. one compiled with -fpic and the other with -fPIC. What is the system you are building on? Did you touch PIC options in any way?

kalibera commented 6 years ago

It is probably caused by -fPIC in CFLAGS in cmpconfig.inc. As a quick fix, try removing it. I could not reproduce your problem on my system, but I see the same thing with MonetDBLite and removing "-fPIC" helps. I had added the option in the past to fix problems with some packages, I will try to fix (remove or replace so that it is the same as C/FPICFLAGS).

kalibera commented 6 years ago

Should be now resolved in trunk version of rchk, please try to update (and re-build R from scratch).