leiradel / retroluxury

A retro game library mainly for use with libretro
zlib License
6 stars 5 forks source link

Linux compilation #1

Closed RobLoach closed 8 years ago

RobLoach commented 8 years ago
➜  test git:(master) make
xxd -i res/smile.png | sed "s/unsigned/const unsigned/g" > res/smile.h
xxd -i res/sketch008.ogg | sed "s/unsigned/const unsigned/g" > res/sketch008.h
xxd -i res/bounce.wav | sed "s/unsigned/const unsigned/g" > res/bounce.h
gcc -Wall -O0 -g -I. -I../src -c libretro.c -o libretro.o
gcc -shared -L../src -o test.dll libretro.o -lretroluxury
/usr/bin/ld: libretro.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
libretro.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'test.dll' failed
make: *** [test.dll] Error 1
➜  test git:(master) ✗ ls   
libretro.c  libretro.h  libretro.o  Makefile  res
➜  test git:(master) ✗ retroarch -L libretro.o 
RetroArch [INFO] :: Config: loading config from: /home/rob/.config/retroarch/retroarch.cfg.
RetroArch [INFO] :: Loading dynamic libretro core from: "/home/rob/Documents/retroluxury/test/libretro.o"
RetroArch [ERROR] :: Failed to open libretro core: "/home/rob/Documents/retroluxury/test/libretro.o"
RetroArch [ERROR] :: Error(s): /home/rob/Documents/retroluxury/test/libretro.o: only ET_DYN and ET_EXEC can be loaded
RetroArch [ERROR] :: Fatal error received in: "load_dynamic()"
leiradel commented 8 years ago

@RobLoach thanks for the report, it should be fixed now but please let me know if that's not the case.

RobLoach commented 8 years ago
gcc -shared -L../src -o test.dll libretro.o -lretroluxury
/usr/bin/ld: ../src/libretroluxury.a(rl_config.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
../src/libretroluxury.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'test.dll' failed
make: *** [test.dll] Error 1

Did send up a compilation error, but still running into the above.

leiradel commented 8 years ago

Oops, my bad, I forgot to add -fPIC to the library build. It's fixed with the latest commit.