AliceStats/Alice

Trouble compiling on Linux

ericp1337 opened this issue · 3 comments

whenever I try to compile on linux i get errors. I did exactly what was in the build instructions.

Scanning dependencies of target alice-addon
[  4%] Building CXX object CMakeFiles/alice-addon.dir/src/alice/keyvalue.cpp.o
[  4%] Built target alice-addon
Linking CXX shared library libalice-addon-shared.so
/usr/bin/ld: CMakeFiles/alice-addon.dir/src/alice/keyvalue.cpp.o: relocation R_X86_64_32 against `__pthread_key_create' can not be used when making a shared object; recompile with -fPIC
CMakeFiles/alice-addon.dir/src/alice/keyvalue.cpp.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/alice-addon-shared.dir/build.make:62: recipe for target 'libalice-addon-shared.so' failed
make[2]: *** [libalice-addon-shared.so] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/alice-addon-shared.dir/all' failed
make[1]: *** [CMakeFiles/alice-addon-shared.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

Just recompile with -fPIC, it even says so in the output. If you are using GCC, you might also try removing the -fno-pie option unless you run a system with grsecurity.

where exactly should i add that because I tried doing it in the make file but it still gives me the error, even when cleaning the dir.

Edit:
removing the -fno-pie seemed to make it work now for whatever reason.

Adjusting CMake compile options has nothing to do with using Alice. Check the CMake docs on how to adjust the compile options.