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

/usr/bin/ld final link failed bad value #47

Open
sfederici opened this issue Mar 12, 2017 · 0 comments
Open

/usr/bin/ld final link failed bad value #47

sfederici opened this issue Mar 12, 2017 · 0 comments

Comments

@sfederici
Copy link

Hi Michal, I'm trying to install luacrypto by using luarocks in Ubuntu 16.10. I first installed luarocks then I tried running

luarocks install lapis

but I got an error message saying that the luacrypto package couldn't be installed because it couldn't find the evp.h file of openssl.

So, as suggested in the error message, I tried with

luarocks install luacrypto OPENSSL_DIR=/usr/local OPENSSL_LIBDIR=/usr/local/ssl/ lib OPENSSL_INCDIR=/usr/local/ssl/ include

This time I got the following output and error message:

Installing https://rocks.moonscript.org/luacrypto-0.3.2-2.src.rock...
Using https://rocks.moonscript.org/luacrypto-0.3.2-2.src.rock... switching to 'build' mode
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/lcrypto.c -o src/lcrypto.o -I/usr/local/ssl/include
gcc -shared -o crypto.so -L/usr/local/lib src/lcrypto.o -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/ssl/lib: -lcrypto
/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(obj_dat.o): relocation R_X86_64_PC32 against symbol `obj_cleanup_defer' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld final link failed bad value
collect2: error: ld returned 1 exit status
Error: Build error: Failed compiling module crypto.so

I understand that I should recompile luacrypto with the -fPIC flag? Is that correct? If this is the solution, as I'm not expert about libraries and compilation, could you please let me know how I can recompile luacrypto (that I already downloaded) with this flag?

Note: I'm using openssl 1.0.2k.

Thanks in advance

Stefano

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

No branches or pull requests

1 participant