Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

Cannot compile demo application

Caprioli__Nico
Beginner
328 Views

Through Visual Studio SGX plugin, I created a demo application whose EDL is the following:
 

enclave {
    from "sgx_tstdc.edl" import *;

    trusted { 
		public char* sign([in, string] const char* message, unsigned saltLength);
    };

    untrusted { 
    };
};

The sign function, right now, just returns a nullptr, so it shouldn't be the problem.

Trying to compile with Intel Compiler, I get the error "argument of type "long *" is incompatible with parameter of type "int *"Enclave C:\Program Files (x86)\Intel\IntelSGXSDK\include\libc++\atomic  1998".

Following this post https://software.intel.com/en-us/forums/intel-software-guard-extensions-intel-sgx/topic/747943 I switched to MSVC, which now, in turn, gives me the error "_mm_lfence identifier not found".

 

This function is automatically used by the SGX proxy function and I have no control over it.
What am I missing?

Thank you

 

0 Kudos
2 Replies
Hoang_N_Intel
Employee
328 Views

If you can try to change the project configuration to "Simulation" mode instead of "Release" or "Debug" to see whether the issue exists or not. If it still does, please zip and post your sample solution here if you can so we can recreate the issue better. Thanks.

0 Kudos
Caprioli__Nico
Beginner
328 Views

Hoang Nguyen (Intel) wrote:

If you can try to change the project configuration to "Simulation" mode instead of "Release" or "Debug" to see whether the issue exists or not. If it still does, please zip and post your sample solution here if you can so we can recreate the issue better. Thanks.

Changing to Simulation, I noticed that the compiler compiled the autogenerated files as C instead of C++. Back to debug I manually selected "Compile as C" in file properties and it finally compiled fine. It seems like MSVC tried to compile it as C++ file and missed something.

0 Kudos
Reply