realm / realm-cpp

Realm C++
Apache License 2.0
74 stars 17 forks source link

fPIC required on Linux #127

Open adamski opened 11 months ago

adamski commented 11 months ago

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 commented 10 months ago

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

leemaguire commented 10 months ago

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

adamski commented 10 months ago

@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 commented 6 months ago

@leemaguire any updates?