summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/rseq_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/kvm/rseq_test.c')
-rw-r--r--tools/testing/selftests/kvm/rseq_test.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 28f97fb52044..0728b15b5d3a 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -1,5 +1,13 @@
// SPDX-License-Identifier: GPL-2.0-only
-#define _GNU_SOURCE /* for program_invocation_short_name */
+
+/*
+ * Include rseq.c without _GNU_SOURCE defined, before including any headers, so
+ * that rseq.c is compiled with its configuration, not KVM selftests' config.
+ */
+#undef _GNU_SOURCE
+#include "../rseq/rseq.c"
+#define _GNU_SOURCE
+
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
@@ -20,8 +28,6 @@
#include "processor.h"
#include "test_util.h"
-#include "../rseq/rseq.c"
-
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.