Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Velocypack example builder recompile with -fPIC #4

Closed
sandrokeil opened this issue Oct 19, 2017 · 3 comments
Closed

Velocypack example builder recompile with -fPIC #4

sandrokeil opened this issue Oct 19, 2017 · 3 comments

Comments

@sandrokeil
Copy link
Owner

After #3 was resolved, new error occurred.

/usr/bin/ld: //usr/local/lib/libvelocypack.a(Builder.cpp.o): relocation R_X86_64_TPOFF32 against `_ZGVZN8arangodb10velocypack7Builder19sortObjectIndexLongEPhRSt6vectorImSaImEEE7entries' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: //usr/local/lib/libvelocypack.a(Slice.cpp.o): relocation R_X86_64_PC32 against symbol `_ZN8arangodb10velocypack15SliceStaticData7TypeMapE' 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
Makefile:132: recipe for target 'arangodb.so' failed
make: *** [arangodb.so] Error 1

How to resolve this?

@sandrokeil
Copy link
Owner Author

@martin-schilling Maybe this could help Things to remember when compiling/linking C/C++ software, at least me. ;-) We should integrate the velocypack stuff in our extension, so no shared library is needed.

A libvelocypack.a (static library) file is already present. How can we use it or maybe this for the PHP extension?

@martin-schilling
Copy link
Collaborator

@sandrokeil I think i found the solution :). Try adding -fPIC to deps/velocypack/cmake/Modules/AR_CompilerSettings.cmake:10 BASE_COMPILER_OPTIONS. The whole main.cpp works for me now

@sandrokeil
Copy link
Owner Author

Solved by #5

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

No branches or pull requests

2 participants