[LTP] [PATCH 1/1] compat_16: Define USE_LEGACY_COMPAT_16_H for legacy tests

Petr Vorel pvorel@suse.cz
Wed Jul 19 12:12:25 CEST 2023


Hi Li,

...
> I'm not sure here if we really need COMPAT_16_H for choosing two compat
> header file.
> As we already use hard code in C source file like #include "compat_16.h" or
> "compat_tst_16.h",
> so compile with -I the header directory is enough I guess.

> Try this simple compat_16.mk, it at least works well on my side.
> Or, did I miss anything in the 16bit compilation?

I like this simplification.

Well, touch compat_16.h causes rebuilding tests which use compat_tst_16.h.
I don't mind that. But OTOH touch compat_tst_16.h does not trigger rebuilding
tests which use compat_tst_16.h :( (tested on
testcases/kernel/syscalls/setregid). Could you please recheck that?

Kind regards,
Petr

> # cat compat_16.mk

> CPPFLAGS += -I$(abs_srcdir) -I$(abs_srcdir)/../utils

> SRCS ?= $(sort $(wildcard $(abs_srcdir)/*.c))

> MAKE_TARGETS := $(notdir $(patsubst %.c,%,$(SRCS)))
> MAKE_TARGETS_OBJS_WO_COMPAT_16 := $(addsuffix .o,$(MAKE_TARGETS))
> MAKE_TARGETS += $(addsuffix _16,$(MAKE_TARGETS))

> DEF_16 := TST_USE_COMPAT16_SYSCALL

> %_16: CPPFLAGS += -D$(DEF_16)=1

> %_16.o: %.c
> $(COMPILE.c) $(OUTPUT_OPTION) $<


More information about the ltp mailing list