jedisct1 / libsodium

A modern, portable, easy to use crypto library.
https://libsodium.org
Other
12.08k stars 1.72k forks source link

Recompile with -fPIC #1109

Closed anik01ic closed 2 years ago

anik01ic commented 2 years ago

Hello,

I am writing a Python C extension which uses libsodium. When trying to compile my Python module I am getting the following error:

/usr/bin/ld: /usr/local/lib/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`

I re-compiled libsodium with ./configure --with-pic, but it didn't help. Any ideas how to compile libsodium with the -fPIC flag?

anik01ic commented 2 years ago

I think I should link to the shared object, not the static library, closing this for now.