I try to link a sgx_tprotected_fs lib, but I missed some linking errors:
```
= note: /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_do_file_recovery':
          Enclave_u.c:(.text+0x10): undefined reference to 
`u_sgxprotectedfs_do_file_recovery'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_fwrite_recovery_node':
          Enclave_u.c:(.text+0x30): undefined reference to 
`u_sgxprotectedfs_fwrite_recovery_node'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_recovery_file_open':
          Enclave_u.c:(.text+0x49): undefined reference to 
`u_sgxprotectedfs_recovery_file_open'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_remove':
          Enclave_u.c:(.text+0x69): undefined reference to 
`u_sgxprotectedfs_remove'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_fflush':
          Enclave_u.c:(.text+0x89): undefined reference to 
`u_sgxprotectedfs_fflush'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_fclose':
          Enclave_u.c:(.text+0xa9): undefined reference to 
`u_sgxprotectedfs_fclose'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_fwrite_node':
          Enclave_u.c:(.text+0xd4): undefined reference to 
`u_sgxprotectedfs_fwrite_node'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_fread_node':
          Enclave_u.c:(.text+0xf4): undefined reference to 
`u_sgxprotectedfs_fread_node'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_check_if_file_exists':
          Enclave_u.c:(.text+0x109): undefined reference to 
`u_sgxprotectedfs_check_if_file_exists'
          /usr/bin/ld: ../lib/libEnclave_u.a(Enclave_u.o): in function 
`Enclave_u_sgxprotectedfs_exclusive_file_open':
          Enclave_u.c:(.text+0x135): undefined reference to 
`u_sgxprotectedfs_exclusive_file_open'
          collect2: error: ld returned 1 exit status
```
My enclave.edl's content:
```
enclave {
    from "sgx_tstd.edl" import *;
    from "sgx_stdio.edl" import *;
    from "sgx_backtrace.edl" import *;
    from "sgx_tstdc.edl" import *;
    from "sgx_tprotected_fs.edl" import *;
    trusted {
        /* define ECALLs here. */

        //public sgx_status_t say_something([in, size=len] const uint8_t* 
some_string, size_t len);
        public sgx_status_t initial_secret_seed_gen(size_t nodenum, 
                [out, size=shares_len] uint8_t* shares, size_t shares_len,
                [out, size=commits_len] uint8_t* commits, size_t commits_len);

    };
    untrusted{};
};
```
And I have linked it in my Makefile:
```
RustEnclave_Link_Flags := -Wl,--no-undefined -nostdlib -nodefaultlibs 
-nostartfiles -L$(SGX_LIBRARY_PATH) \
        -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
        -Wl,--start-group -lsgx_tstdc -l$(Service_Library_Name) 
-l$(Crypto_Library_Name) -lsgx_tprotected_fs $(RustEnclave_Link_Libs) 
-Wl,--end-group \
        -Wl,--version-script=enclave/Enclave.lds \
        $(ENCLAVE_LDFLAGS)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/305

Reply via email to