Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools: testing: support EXTRA_CFLAGS in shared.mk

This allows the user to set cflags when building tests that use this
shared build infrastructure.

For example, it enables building with -Werror so that patch-check scripts
will fail:

make -C tools/testing/vma -j EXTRA_CFLAGS=-Werror

Link: https://lkml.kernel.org/r/20250828-b4-vma-no-atomic-h-v2-3-02d146a58ed2@google.com
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Acked-by: Pedro Falcato <pfalcato@suse.de>
Cc: Jann Horn <jannh@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Brendan Jackman and committed by
Andrew Morton
953dad21 d794cd23

+1
+1
tools/testing/shared/shared.mk
··· 4 4 CFLAGS += -I../shared -I. -I../../include -I../../arch/$(SRCARCH)/include \ 5 5 -I../../../lib -g -Og -Wall \ 6 6 -D_LGPL_SOURCE -fsanitize=address -fsanitize=undefined 7 + CFLAGS += $(EXTRA_CFLAGS) 7 8 LDFLAGS += -fsanitize=address -fsanitize=undefined 8 9 LDLIBS += -lpthread -lurcu 9 10 LIBS := slab.o find_bit.o bitmap.o hweight.o vsprintf.o