Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile with local LuaJIT #15

Closed
MaddieM4 opened this issue Jun 29, 2013 · 3 comments
Closed

Cannot compile with local LuaJIT #15

MaddieM4 opened this issue Jun 29, 2013 · 3 comments
Labels

Comments

@MaddieM4
Copy link
Contributor

I ran into this in my Fetchy branch, but I can reproduce in master, so I know it's not me.

git clone git@github.com:scoder/lupa.git
cd lupa
wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz
tar xvf LuaJIT-2.0.2.tar.gz
cd LuaJIT-2.0.2/
make
cd ..
virtualenv venv
source venv/bin/activate
python setup.py install

If I've got my reproduction steps right, this should grab the latest Lupa, then the latest LuaJIT, then builds LuaJIT, creates a virtualenv, and attempts to install Lupa into that virtualenv.

The error goes like this:

found LuaJIT build in /home/philip/projects/lupa/LuaJIT-2.0.2/src
building statically
building without Cython
running install
running build
running build_py
copying lupa/version.py -> build/lib.linux-x86_64-2.7/lupa
running build_ext
building 'lupa._lupa' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/philip/projects/lupa/LuaJIT-2.0.2/src -I/usr/include/python2.7 -c lupa/_lupa.c -o build/temp.linux-x86_64-2.7/lupa/_lupa.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/lupa/_lupa.o /home/philip/projects/lupa/LuaJIT-2.0.2/src/libluajit.a -o build/lib.linux-x86_64-2.7/lupa/_lupa.so
/usr/bin/ld: /home/philip/projects/lupa/LuaJIT-2.0.2/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
/home/philip/projects/lupa/LuaJIT-2.0.2/src/libluajit.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

I'm hoping you'll have more insight into this issue than I do.

@scoder
Copy link
Owner

scoder commented Jun 29, 2013

Please do as the error message tells you and "recompile with -fPIC" in your CFLAGS.

@scoder scoder closed this as completed Jun 29, 2013
@MaddieM4
Copy link
Contributor Author

MaddieM4 commented Jul 1, 2013

Thanks, scoder. I feel like an idiot for burning so much time trying to
reverse-engineer the LuaJIT makefile, never thinking to try adding
"CFLAGS=-fPIC" into the make arguments. That works perfectly.

On Sat, Jun 29, 2013 at 9:56 AM, scoder notifications@github.com wrote:

Please do as the error message tells you and "recompile with -fPIC" in
your CFLAGS.


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-20233230
.

@scoder scoder added the invalid label Feb 12, 2014
@yj36963
Copy link

yj36963 commented Sep 5, 2016

@scoder wow~Your advice is a great help to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants