1

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.

When I try to compile it with MSVC, it 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.

Any clue on what is going on?

Fylax
  • 1,138
  • 2
  • 15
  • 24
  • `_mm_lfence` is declared in ``. You may need to add that header to your source. – 1201ProgramAlarm Feb 25 '18 at 22:28
  • @1201ProgramAlarm thank you for your reply. Nevertheless, it does not work. While this solves the problem, it leads to a redefinition error. I am assuming that I must include some SGX header – Fylax Feb 26 '18 at 08:13

1 Answers1

1

After various tests, I noticed that MSVC as well as Intel compiler, tried to compile the file as C++ file, while it was plain C.

Manually setting C as target, solved the issue.

Hope this helps future readers.

Fylax
  • 1,138
  • 2
  • 15
  • 24