realm-cpp icon indicating copy to clipboard operation
realm-cpp copied to clipboard

fPIC required on Linux

Open adamski opened this issue 1 year ago • 4 comments

My Linux build server reports the following linker error:

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'vtable for realm::internal::DefaultTransport'; recompile with -fPIC
>>> defined in ../_deps/cpprealm-build/src/libcpprealm.a(network_transport.cpp.o)
>>> referenced by network_transport.cpp
>>>               network_transport.cpp.o:(realm::internal::DefaultTransport::~DefaultTransport()) in archive ../_deps/cpprealm-build/src/libcpprealm.a

I have solved this issue with our own libraries with the following:

set_target_properties(${PROJECT_NAME} PROPERTIES
        POSITION_INDEPENDENT_CODE TRUE

adamski avatar Dec 06 '23 13:12 adamski

@leemaguire would it be helpful if I provide a PR for this issue?

adamski avatar Jan 09 '24 00:01 adamski

@adamski could you share the details of your linux box? Distro version, compiler version etc.

leemaguire avatar Jan 09 '24 10:01 leemaguire

@leemaguire I'm using this Docker image: https://hub.docker.com/r/arbmind/cmake-clang

This is a link to the Docker file used to create the image: https://github.com/arBmind/cmake-containers/blob/develop/Dockerfile

adamski avatar Jan 09 '24 11:01 adamski

@leemaguire any updates?

adamski avatar May 07 '24 23:05 adamski