ValveSoftware / voglperf

Benchmarking tool for Linux OpenGL games. Spews frame information, logs frametimes.
Other
201 stars 31 forks source link

Compile error #2

Closed imgxx closed 10 years ago

imgxx commented 10 years ago

Error at "make voglperf64":

Linking C shared library /home/img/voglperf/bin/libvoglperf64.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/voglperf.dir/link.txt --verbose=1
/usr/bin/cc  -fPIC -g -Wall -Wextra -fno-omit-frame-pointer -march=corei7 -Wno-unused-parameter -Wno-unused-function -fno-strict-aliasing -fno-math-errno -fvisibility=hidden -Wno-unused-local-typedefs   -fno-exceptions -g -O2 -DNDEBUG -Wl,--no-undefined -Wl,--version-script=/home/img/voglperf/src/libvoglperf_linker_script.txt -shared -Wl,-soname,libvoglperf64.so -o /home/img/voglperf/bin/libvoglperf64.so CMakeFiles/voglperf.dir/voglperf.c.o -Wl,-Bstatic -lSDL2 -Wl,-Bdynamic -ldl -lpthread -lrt -lm 
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libSDL2.a(SDL_string.o): перемещение R_X86_64_32S для «.rodata» не может использоваться при создании общего объекта; перекомпилируйте с -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libSDL2.a: error adding symbols: Некорректное значение

System information: https://gist.github.com/imgxx/9203971

mikesart commented 10 years ago

SDL2 libraries need to be installed. This should help:

http://askubuntu.com/questions/344512/what-is-the-general-procedure-to-install-development-libraries-in-ubuntu

Thanks.

imgxx commented 10 years ago

This packages included in ubuntu 13.10 repos I have installed libsdl2-2.0-0 and libsdl2-dev

mikesart commented 10 years ago

Yep - that should work if those are available. Quite a few games are 32-bit so you'll most likely need the i386 versions as well. Thanks Imgxx.

imgxx commented 10 years ago

I have installed them before I got this error :) Maybe sdl2 packages in ubuntu compiled without -fPIC option

mikesart commented 10 years ago

Is that what this is saying? /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libSDL2.a(SDL_string.o): перемещение R_X86_64_32S для «.rodata» не может использоваться при создании общего объекта; перекомпилируйте с -fPIC

mikesart commented 10 years ago

And yes, I'm building SDL with "./configure CFLAGS=-fPIC CPPFLAGS=-fPIC && make -j 8".

Building the 64-bit static library without -fPIC seems wrong to me...

imgxx commented 10 years ago

From the internet. I think, this is the same error message. relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

Firstly, I was thinking, that this is about voglperf, but it is already compiled with -fPIC

mikesart commented 10 years ago

Yeah - the way that 64-bit libSDL2.a is compiled right now it will only work if linked with the main program. I think that's not entirely useful. More info here: http://www.technovelty.org/c/position-independent-code-and-x86-64-libraries.html We should ask whoever does the upstream sdl packages - but in the meantime you're probably stuck compiling your own SDL. Sorry!

imgxx commented 10 years ago

I'm OK with compiling it for now. Thanks