summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/lib.mk
diff options
context:
space:
mode:
authorEdward Liaw <edliaw@google.com>2024-05-08 00:38:26 +0300
committerShuah Khan <skhan@linuxfoundation.org>2024-05-09 02:08:36 +0300
commitdaef47b89efd0b745e8478d69a3ad724bd8b4dc6 (patch)
tree1eb539ac49dd3ce0e05453c66349b63878b981e5 /tools/testing/selftests/lib.mk
parent14d28ec6f821622211aa65b4da156399c9a4a9c6 (diff)
downloadlinux-daef47b89efd0b745e8478d69a3ad724bd8b4dc6.tar.xz
selftests: Compile kselftest headers with -D_GNU_SOURCE
Add the -D_GNU_SOURCE flag to KHDR_INCLUDES so that it is defined in a central location. Commit 809216233555 ("selftests/harness: remove use of LINE_MAX") introduced asprintf into kselftest_harness.h, which is a GNU extension and needs _GNU_SOURCE to either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler. Fixed up commit log: Shuah Khan <skhan@linuxfoundation.org> Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX") Reported-by: kernel test robot <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang@intel.com Signed-off-by: Edward Liaw <edliaw@google.com> Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Mark Brown <broonie@kernel.org> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/lib.mk')
-rw-r--r--tools/testing/selftests/lib.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 8ae203d8ed7f..7fa4a96e26ed 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -53,7 +53,7 @@ selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST))))
top_srcdir = $(selfdir)/../../..
ifeq ($(KHDR_INCLUDES),)
-KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include
+KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include
endif
# The following are built by lib.mk common compile rules.