Fixed tests on OpenBSD

Since OpenBSD 6.0 W^X is enforced.
Added `RANDOMX_FLAG_SECURE` in tests and benchmarks.
Updated comment.

Excluded `cpu_set_t` since it is not defined on OpenBSD.
This commit is contained in:
ston1th
2019-10-20 14:23:33 +02:00
parent b53f0ed145
commit 5c0486bd33
5 changed files with 26 additions and 3 deletions
+5
View File
@@ -42,6 +42,11 @@ extern "C" {
randomx_flags randomx_get_flags() {
randomx_flags flags = RANDOMX_HAVE_COMPILER ? RANDOMX_FLAG_JIT : RANDOMX_FLAG_DEFAULT;
randomx::Cpu cpu;
#ifdef __OpenBSD__
if (flags == RANDOMX_FLAG_JIT) {
flags |= RANDOMX_FLAG_SECURE;
}
#endif
if (HAVE_AES && cpu.hasAes()) {
flags |= RANDOMX_FLAG_HARD_AES;
}