libsodium icon indicating copy to clipboard operation
libsodium copied to clipboard

Linux not compiling correctly with -fPIC

Open R2Sam opened this issue 5 months ago • 0 comments

When compiling for linux I'm trying to get a static library compiled with -fPIC so that I may use it as a dependency for my own shared library.

I tried env CFLAGS="$CFLAGS-fPIC" CPPFLAGS="$CPPFLAGS-fPIC" LDFLAGS="$LDFLAGS-fPIC" ./configure

This still results in

lib/Sodium/libsodium-Linux.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

When trying to compile my own shared lib.

R2Sam avatar Jun 11 '25 13:06 R2Sam