Message ID | 20230208205642.270567-3-iii@linux.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | BPF |
Headers | show |
Series | selftests/bpf: Add Memory Sanitizer support | expand |
On Wed, Feb 8, 2023 at 12:57 PM Ilya Leoshkevich <iii@linux.ibm.com> wrote: > > This makes it possible to add sanitizer flags. > > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> > --- > tools/bpf/runqslower/Makefile | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile > index 8b3d87b82b7a..4ff4eed6c01d 100644 > --- a/tools/bpf/runqslower/Makefile > +++ b/tools/bpf/runqslower/Makefile > @@ -13,6 +13,12 @@ BPF_DESTDIR := $(BPFOBJ_OUTPUT) > BPF_INCLUDE := $(BPF_DESTDIR)/include > INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../include/uapi) > CFLAGS := -g -Wall $(CLANG_CROSS_FLAGS) > +ifneq ($(EXTRA_CFLAGS),) > +CFLAGS += $(EXTRA_CFLAGS) > +endif > +ifneq ($(EXTRA_LDFLAGS),) > +LDFLAGS += $(EXTRA_LDFLAGS) > +endif > can't we do this unconditionally? If those variables are not defined, Makefile will substitute empty string, no? > # Try to detect best kernel BTF source > KERNEL_REL := $(shell uname -r) > -- > 2.39.1 >
diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile index 8b3d87b82b7a..4ff4eed6c01d 100644 --- a/tools/bpf/runqslower/Makefile +++ b/tools/bpf/runqslower/Makefile @@ -13,6 +13,12 @@ BPF_DESTDIR := $(BPFOBJ_OUTPUT) BPF_INCLUDE := $(BPF_DESTDIR)/include INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../include/uapi) CFLAGS := -g -Wall $(CLANG_CROSS_FLAGS) +ifneq ($(EXTRA_CFLAGS),) +CFLAGS += $(EXTRA_CFLAGS) +endif +ifneq ($(EXTRA_LDFLAGS),) +LDFLAGS += $(EXTRA_LDFLAGS) +endif # Try to detect best kernel BTF source KERNEL_REL := $(shell uname -r)
This makes it possible to add sanitizer flags. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> --- tools/bpf/runqslower/Makefile | 6 ++++++ 1 file changed, 6 insertions(+)