jedisct1 / libsodium

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

Disable -fPIC flag when building for embedded #992

Closed sijohans closed 4 years ago

sijohans commented 4 years ago

Hello,

I am building this library for en embedded target (nRF52840) using arm-none-eabi-gcc 7.3.1. When i am linking the static library i encounter runtime errors. I have found out that if compiling libsodium without -fPIE and -fPIC it works well.

I cannot understand how i disable PIC using the configure script. Is this supported?

jedisct1 commented 4 years ago

These are automatically disabled on that target. Make sure that you're not using an old version.

https://doc.libsodium.org/installation#cross-compiling https://doc.libsodium.org/installation#stable-branch

sijohans commented 4 years ago

Thank you, saw in the build script that the tag 1.0.18 was used. When checking out stable i did indeed not get the -fPIC or -fPIE flag. Thanks again.