keystone-enclave / keystone

Keystone Enclave (QEMU + HiFive Unleashed)
Other
467 stars 134 forks source link

Problems when porting libsodium to Keystone #364

Open yangshihao-arron opened 1 year ago

yangshihao-arron commented 1 year ago

first I copy the directory sodium_patches into Kyestone Second I use this command

git checkout 4917510626c55c1f199ef7383ae164cf96044aea
patch -p1 < /home/ysh/code/keystone/sodium_patches/configure.ac.patch
./autogen.sh
./configure --host=riscv64-unknown-linux-gnu --disable-ssp --disable-asm --without-pthreads
make
export LIBSODIUM_DIR=$(pwd)/src/libsodium/

it is successful third I build the SDK Fourth, I tested whether it was successful,I use the code below in eapp_native.c

#include "sodium.h"
int main(){
   if (sodium_init() < 0) {
       ocall_print_string("sodium failed");
    }else{
      ocall_print_string("sodium successful");
    }
}

but when I use make hello-native-package it occurs:/home/ysh/code/keystone/sdk/examples/hello-native/eapp/eapp_native.c:11:10: fatal error: sodium.h: No such file or directory 11 | #include "sodium.h" | ^~~~~~ compilation terminated.

shirinebadi commented 2 months ago

Hi @yangshihao-arron I'm also facing this problem. Could you solve it?