在CentOS上编译CoreCLR出现下面的错误提示:
/data/git/coreclr/src/pal/src/include/pal/context.h:40:2: error: Native context type is not known on this platform!
查看context.h的源代码:
#if HAVE_UCONTEXT_T #include <ucontext.h> typedef ucontext_t native_context_t; #else // HAVE_UCONTEXT_T #error Native context type is not known on this platform! #endif // HAVE_UCONTEXT_T
请问如何解决这个问题?
在cmake的输出日志中发现下面的错误,可能与这个问题有关:
-- Check size of ucontext_t -- Check size of ucontext_t - failed
在 src/pal/tools/clang-compiler-override.txt 文件中删除 SET (CMAKE_C_FLAGS_INIT "-Wall -std=c11") 。
在 src/pal/tests/CMakeLists.txt 文件中添加 SET (CMAKE_C_FLAGS "-Wall -std=c11") 。