howl-editor / howl

The Howl Editor
http://howl.io
Other
712 stars 68 forks source link

relocation R_X86_64_32S compile errors #432

Closed riktw closed 5 years ago

riktw commented 6 years ago

Hello,

I wanted to try the howl editor, so downloaded the 0.5 stable branch, unzipped it and tried to compile it. Sadly, I got a massive list of errors, all "relocation R_X86_64_32S against .rodata'" or simillar caused by the Luajit part being compiled, for example: /usr/bin/ld: deps/LuaJIT-2.1.0-beta3/src/libluajit.a(lj_err.o): relocation R_X86_64_32S against.rodata' can not be used when making a shared object; recompile with -fPIC

After adding the -fPIC flag in the makefile for luajit and in the makefile for lpeg (in deps/lpeg) So for Luajit, in the makefile in the src folder I changed: cd ${LUAJIT} && $(MAKE) XCFLAGS="-DLUAJIT_ENABLE_LUA52COMPAT" into cd ${LUAJIT} && $(MAKE) XCFLAGS="-DLUAJIT_ENABLE_LUA52COMPAT -fPIC"

and for lpeg, in the /deps/lpeg-0.10.2/makefile, change COPT = -O2 -DNDEBUG into COPT = -O2 -DNDEBUG -fPIC

everything compiled and worked. So the issue has been solved, but I wanted to know in case this is something new or in case someone else has the same error. I am running Debian stretch, using GCC 6.4.0

refi64 commented 5 years ago

How exactly did you compile it? Nothing here is building a shared object, so I have no clue why this is happening. Did you pass any special flags?

riktw commented 5 years ago

Hello, I found out I got this error with a lot of bigger projects, compiling GCC gave me a very similar error as example, so I have the feeling it's a problem on just my machine, sorry to bother you with it :)