Build error under Centos 7.4
jmechalas opened this issue · 1 comments
jmechalas commented
The sgx-v4.15.11-r1 tag will not build under CentOS 7.4 without help:
CC drivers/platform/x86/intel_sgx/le/enclave/utils.o
/home/johnm/git/kvm-sgx/drivers/platform/x86/intel_sgx/le/enclave/utils.c: In function \u2018_compare\u2019:
/home/johnm/git/kvm-sgx/drivers/platform/x86/intel_sgx/le/enclave/utils.c:74:2: error: \u2018for\u2019 loop initial declarations are only allowed in C99 mode
for (uint32_t i = 0; i < size; i++) {
^
/home/johnm/git/kvm-sgx/drivers/platform/x86/intel_sgx/le/enclave/utils.c:74:2: note: use option -std=c99 or -std=gnu99 to compile your code
Seems it's using -std=gnu89.
I think the best fix here is to just not inline the variable declaration in the for loop.
jmechalas commented
Time marches on. This is an old version of kvm-sgx and CentOS 7 is still on a 3.x kernel.