SGX 演示应用程序无法编译

SGX demo application doesn't compile

通过Visual Studio SGX插件,我创建了一个演示应用程序,其EDL如下:

enclave {
    from "sgx_tstdc.edl" import *;
    trusted {
        public char* sign([in, string] const char* message, unsigned saltLength);
};
    untrusted { };
};

符号函数,目前只有returns一个nullptr,所以应该不是问题。

当我尝试用 MSVC 编译它时,出现错误 _mm_lfence identifier not found

SGX代理功能自动使用此功能,我无法控制。

有什么线索吗?

经过各种测试,我注意到 MSVC 和 Intel 编译器都试图将文件编译为 C++ 文件,而它是纯 C。

手动将 C 设置为目标,问题已解决。

希望这对未来的读者有所帮助。