I can use libsodium 1.0.7 just fine in Ubuntu but there seems to be some issue when trying to cross-compile the libsodium library to an armv5 architecture (armv5tejl-unknown-linux-gnueabihf
).
I have used ./configure --host=armv5tejl-unknown-linux-gnueabihf
and then make DESTDIR=/home/myself/ARM/
.
All files are generated fine (headers and static & shared library files) and I can compile and link a small test C-program which then generates a segmentation fault when it's executed on my ARMv5 target (toolchain and all is fine, everything else I compile & link not using libsodium runs perfectly fine on my ARM machine):
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sodium.h"
int main()
{
printf("sodium_init()=%d\n",sodium_init()); // Fine, = 0
unsigned char pbk[crypto_box_PUBLICKEYBYTES];
unsigned char sbk[crypto_box_SECRETKEYBYTES];
crypto_box_keypair(pbk,sbk); // <-- Segmentation fault.
}
I have also tried the official cross-compile for ARM instructions at https://download.libsodium.org/doc/installation/index.html but configure fails due to a missing nosys.specs
file. Is there somewhere I can download this (I have goggled it and it seems that it has to be specifically generated for the libsodium package)?