| The assembly library of optimization string subroutines is awesome and I have been using it for a few years. A friend of mine asked me to help with some string processing in Erlang -- the string processing is done in C and called from erlang. For this native implemented function (NIF), Erlang requires a shared library of those functions which is loaded at runtime.This is on X86_64. I tried to link libaelf64o.a into the shared library and got relocation error clang -B/usr/lib/gold-ld/ c_src/strutil_nif.o -shared -L/usr/lib/erlang/lib/erl_interface-3.7.7/lib -lerl_interface -lei -o priv/strutil.so ./c_src/libtre.a ./c_src/libaelf64o.a /usr/lib/gold-ld/ld: error: ./c_src/libaelf64o.a(strtouplow64.o): requires dynamic R_X86_64_PC32 reloc against 'InstructionSet' which may overflow at runtime; recompile with -fPIC
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The most helpful link I found about the error is stackoverflow.com/questions/8703485/boost-testing-fpic-linking-error and the suggestion is to compile library with -fPIC
Is there a way to link libaelf64o.a into a shared library or something functionally equivalent -- I just want faster string processing and like the string functions in the library.
Thanks,
George
|