lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250830005555.ebx6sq2j22mm3plp@master>
Date: Sat, 30 Aug 2025 00:55:55 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: Bala-Vignesh-Reddy <reddybalavignesh9979@...il.com>
Cc: richard.weiyang@...il.com, Liam.Howlett@...cle.com,
	akpm@...ux-foundation.org, davem@...emloft.net, david@...hat.com,
	edumazet@...gle.com, gnoack@...gle.com, horms@...nel.org,
	kuba@...nel.org, linux-kernel@...r.kernel.org,
	linux-kselftest@...r.kernel.org, linux-mm@...ck.org,
	linux-security-module@...r.kernel.org, lorenzo.stoakes@...cle.com,
	mhocko@...e.com, mic@...ikod.net, ming.lei@...hat.com,
	pabeni@...hat.com, rppt@...nel.org, shuah@...nel.org,
	skhan@...uxfoundation.org, surenb@...gle.com, vbabka@...e.cz
Subject: Re: [PATCH 2/2] selftests: Replace relative includes with
 non-relative for kselftest.h and kselftest_harness.h

On Fri, Aug 29, 2025 at 04:23:06PM +0530, Bala-Vignesh-Reddy wrote:
>
>>+ifeq ($(KSFT_INCLUDES),)
>>+KSFT_INCLUDES := -I../
>>+endif
>>+
>
>This makes sense, but if we do it for mm/ then we have to
>follow this for all subdirectories in selftests.. that might
>cause problems if subdirectories are nested ones likes filesystems/.
>Duplicating this across all subdir Makefile adds churn and can
>lead to errors.
>
>Another way, is adding `CFLAGS += -I../` as is done in net/Makefile,
>but this also doesn't solve the problem completely as this also
>remain to relative addressing.
>
>But, if preferred we can add this snippet in Makefile to
>resolve the error temporarily.

Well, maybe I find a way.

Since we already get the top_srcdir in lib.mk, sounds we can add the include
path directly in lib.mk.

Some quick build looks good, not fully tested.

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 530390033929..1d3d0ad037d7 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -199,11 +199,18 @@ clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir)
 # Build with _GNU_SOURCE by default
 CFLAGS += -D_GNU_SOURCE=
 
+CFLAGS += -I${top_srcdir}/tools/testing/selftests
+
 # Enables to extend CFLAGS and LDFLAGS from command line, e.g.
 # make USERCFLAGS=-Werror USERLDFLAGS=-static
 CFLAGS += $(USERCFLAGS)
 LDFLAGS += $(USERLDFLAGS)

>
>Thanks,
>Bala Vignesh

-- 
Wei Yang
Help you, Help me

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ