diff options
author | 2024-05-07 21:38:26 +0000 | |
---|---|---|
committer | 2024-05-08 17:08:36 -0600 | |
commit | daef47b89efd0b745e8478d69a3ad724bd8b4dc6 (patch) | |
tree | 1eb539ac49dd3ce0e05453c66349b63878b981e5 /tools/testing/selftests/Makefile | |
parent | selftests/resctrl: fix clang build warnings related to abs(), labs() calls (diff) | |
download | linux-daef47b89efd0b745e8478d69a3ad724bd8b4dc6.tar.gz linux-daef47b89efd0b745e8478d69a3ad724bd8b4dc6.tar.bz2 linux-daef47b89efd0b745e8478d69a3ad724bd8b4dc6.zip |
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/Makefile')
-rw-r--r-- | tools/testing/selftests/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index e1504833654d..ed012a7f0786 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -161,11 +161,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif |