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

Fails to build because it requires RocksDB to be build with -fPIC #4

Closed
roncemer opened this issue Jul 8, 2015 · 2 comments
Closed
Assignees

Comments

@roncemer
Copy link

roncemer commented Jul 8, 2015

With the latest rocksdb, I get this error when building rocksdb-php:

g++ -std=c++11 -fPIC -shared src/.cpp -lrocksdb -lpthread -lrt -lsnappy -lgflags -lz -lbz2 -lphpcpp -lmemenv -I./src/include -o bin/rocksdb_php.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib/librocksdb.a(db_impl.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib/librocksdb.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:11: recipe for target 'all' failed
make: *
* [all] Error 1

@Photonios
Copy link
Owner

Issue should be resolved now. You have to compile RocksDB with -fPIC now. I've updated the README on how to do that.

I've also fixed the Makefile to no longer link to libmemenv, because it appears that this is no longer necessary.

Thanks for reporting it!

Can you please verify that it builds now so I can close the issue?

@Photonios Photonios changed the title Build Error Fails to build because it requires RocksDB to be build with -fPIC Jul 12, 2015
@janisz
Copy link

janisz commented Aug 30, 2021

Why -fPIC is now necessary?

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

3 participants