]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Revert "selftests: Compile kselftest headers with -D_GNU_SOURCE"
authorShuah Khan <skhan@linuxfoundation.org>
Fri, 17 May 2024 02:51:07 +0000 (20:51 -0600)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 20 May 2024 14:59:58 +0000 (08:59 -0600)
This reverts commit daef47b89efd0b745e8478d69a3ad724bd8b4dc6.

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>
tools/testing/selftests/Makefile
tools/testing/selftests/kselftest_harness.h
tools/testing/selftests/lib.mk

index f0431e6cb67e031cb80b3ca91b973b2244924005..9039f3709affb91e91af16741c309e8c5c5de5ef 100644 (file)
@@ -170,11 +170,11 @@ ifneq ($(KBUILD_OUTPUT),)
   # $(realpath ...) resolves symlinks
   abs_objtree := $(realpath $(abs_objtree))
   BUILD := $(abs_objtree)/kselftest
-  KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include
+  KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include
 else
   BUILD := $(CURDIR)
   abs_srctree := $(shell cd $(top_srcdir) && pwd)
-  KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include
+  KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include
   DEFAULT_INSTALL_HDR_PATH := 1
 endif
 
index 37b03f1b8741d177baad2380201b28ecdc66a2a2..3c8f2965c2850c8fa0a95259433857e4a324641b 100644 (file)
@@ -51,7 +51,7 @@
 #define __KSELFTEST_HARNESS_H
 
 #ifndef _GNU_SOURCE
-static_assert(0, "kselftest harness requires _GNU_SOURCE to be defined");
+#define _GNU_SOURCE
 #endif
 #include <asm/types.h>
 #include <ctype.h>
index 33c24ceddfb7119a7236b65ed7e295f27db3c5e3..09e8a854f0fcfe00120b0b7e730209884396f2ba 100644 (file)
@@ -67,7 +67,7 @@ MAKEFLAGS += --no-print-directory
 endif
 
 ifeq ($(KHDR_INCLUDES),)
-KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include
+KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include
 endif
 
 # The following are built by lib.mk common compile rules.