#1117464 libsodium-dev: relocation R_X86_64_PC32 against symbol `randombytes_sysrandom_implementation' .. recompile with -fPIC

Package:
libsodium-dev
Source:
libsodium-dev
Description:
Network communication, cryptography and signaturing library - headers
Submitter:
Russell Coker
Date:
2025-10-06 04:01:02 UTC
Severity:
normal
#1117464#5
Date:
2025-10-06 03:59:19 UTC
From:
To:
I get the following error when trying to compile a shared object that uses libsodium.a:

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsodium.a(libsodium_la-randombytes.o): warning: relocation against `randombytes_sysrandom_implementation' in read-only section `.text'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsodium.a(libsodium_la-randombytes.o): relocation R_X86_64_PC32 against symbol `randombytes_sysrandom_implementation' 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
make[1]: *** [Makefile:511: blib/arch/auto/Crypt/NaCl/Sodium/Sodium.so] Error 1
make[1]: Leaving directory '/home/etbe/matrix/libcrypt-nacl-sodium-perl'