Skip to content

Commit cee27ae

Browse files
committed
Revert "selftests: Compile kselftest headers with -D_GNU_SOURCE"
This reverts commit daef47b. This framework change to add D_GNU_SOURCE to KHDR_INCLUDES to Makefile, lib.mk, and kselftest_harness.h is causing build failures and warnings. Revert this change. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent ea5f6ad commit cee27ae

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

tools/testing/selftests/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ ifneq ($(KBUILD_OUTPUT),)
170170
# $(realpath ...) resolves symlinks
171171
abs_objtree := $(realpath $(abs_objtree))
172172
BUILD := $(abs_objtree)/kselftest
173-
KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include
173+
KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include
174174
else
175175
BUILD := $(CURDIR)
176176
abs_srctree := $(shell cd $(top_srcdir) && pwd)
177-
KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include
177+
KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include
178178
DEFAULT_INSTALL_HDR_PATH := 1
179179
endif
180180

tools/testing/selftests/kselftest_harness.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#define __KSELFTEST_HARNESS_H
5252

5353
#ifndef _GNU_SOURCE
54-
static_assert(0, "kselftest harness requires _GNU_SOURCE to be defined");
54+
#define _GNU_SOURCE
5555
#endif
5656
#include <asm/types.h>
5757
#include <ctype.h>

tools/testing/selftests/lib.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ MAKEFLAGS += --no-print-directory
6767
endif
6868

6969
ifeq ($(KHDR_INCLUDES),)
70-
KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include
70+
KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include
7171
endif
7272

7373
# The following are built by lib.mk common compile rules.

0 commit comments

Comments
 (0)