Skip to contentSkip to conversation

utils/compat_16.mk: Further cleanup of unused sections and variables

PATCH New Petr Vorel 2 participants 5 messages Apr 9, 2018 – Apr 10, 2018

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 utils/compat_16.mk: Further cleanup of unused sections and variables

---
-%_16.o: %.c $(COMPAT_16_H)
Is this make dependency for recompiling when header changes? It doesn't behave like that but maybe I'm missing something.

Kind regards,
Petr

---
 testcases/kernel/syscalls/setuid/Makefile    |  3 ---
 testcases/kernel/syscalls/utils/compat_16.mk | 22 +---------------------
 2 files changed, 1 insertion(+), 24 deletions(-)
testcases/kernel/syscalls/setuid/Makefile +0 -3
index 6bd943aaf..056bb9e80 100644
@@ -19,8 +19,5 @@ top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-#for compat_16.mk uses the compat_16_tst.h
-COMPAT_TST_16_H		:= 1
-
 include $(abs_srcdir)/../utils/compat_16.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/utils/compat_16.mk +1 -21
index 0565ddefa..3dee0c230 100644
@@ -56,28 +56,8 @@ MAKE_TARGETS		:= $(notdir $(patsubst %.c,%,$(SRCS)))
 MAKE_TARGETS_OBJS_WO_COMPAT_16	:= $(addsuffix .o,$(MAKE_TARGETS))
 MAKE_TARGETS		+= $(addsuffix _16,$(MAKE_TARGETS))
 
-# XXX (garrcoop): This code should be put in question as it cannot be applied
-# (no .h file, no TST_USE_NEWER64_SYSCALL def).
 DEF_16			:= TST_USE_COMPAT16_SYSCALL
-
-ifneq ($(COMPAT_TST_16_H),1)
-COMPAT_16_H		:= $(abs_srcdir)/../utils/compat_16.h
-else
-COMPAT_16_H     := $(abs_srcdir)/../utils/compat_tst_16.h
-endif
-
-ifneq ($(wildcard $(COMPAT_16_H)),)
-HAS_COMPAT_16		:= 1
-
-$(MAKE_TARGETS_OBJS_WO_COMPAT_16): $(COMPAT_16_H)
-.INTERMEDIATE: $(MAKE_TARGETS_OBJS_WO_COMPAT_16)
-
-else
-HAS_COMPAT_16		:= 0
-endif
-
 %_16: CPPFLAGS += -D$(DEF_16)=1
-# XXX (garrcoop): End section of code in question..
 
-%_16.o: %.c $(COMPAT_16_H)
+%_16.o: %.c
 	$(COMPILE.c) $(OUTPUT_OPTION) $<
Signature · 1 line
2.16.3
#1 lore raw

PATCH 1/1 utils/compat_16.mk: Further cleanup of unused sections and variables

Quoted 5 lines · Petr Vorel

---
-%_16.o: %.c $(COMPAT_16_H)
Is this make dependency for recompiling when header changes? It doesn't behave like that but maybe I'm missing something.

Hi Petr

-%_16.o: %.c $(COMPAT_16_H)

This make dependency for recompiling _16.o when header changes.

$(MAKE_TARGETS_OBJS_WO_COMPAT_16): $(COMPAT_16_H)
.INTERMEDIATE: $(MAKE_TARGETS_OBJS_WO_COMPAT_16)

This make dependency for recompiling .o when header changes.

I think you may miss something.

This patch will reappear the problem that has been fixed since commit 631d16671d(syscalls/utils/compat_16.mk: fix build dependencies). If we touch/modify the compat_tst_16.h/compat_16.h file and excute "make" in any of syscalls directories which includes compat_16.mk, nothing will happen.

Best Regards
Yang Xu

Quoted 54 lines

Kind regards,
Petr

---
  testcases/kernel/syscalls/setuid/Makefile    |  3 ---
  testcases/kernel/syscalls/utils/compat_16.mk | 22 +---------------------
  2 files changed, 1 insertion(+), 24 deletions(-)
testcases/kernel/syscalls/setuid/Makefile +0 -3
index 6bd943aaf..056bb9e80 100644
@@ -19,8 +19,5 @@ top_srcdir		?= ../../../..
 
  include $(top_srcdir)/include/mk/testcases.mk
 
-#for compat_16.mk uses the compat_16_tst.h
-COMPAT_TST_16_H		:= 1
-
  include $(abs_srcdir)/../utils/compat_16.mk
  include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/utils/compat_16.mk +1 -21
index 0565ddefa..3dee0c230 100644
@@ -56,28 +56,8 @@ MAKE_TARGETS		:= $(notdir $(patsubst %.c,%,$(SRCS)))
  MAKE_TARGETS_OBJS_WO_COMPAT_16	:= $(addsuffix .o,$(MAKE_TARGETS))
  MAKE_TARGETS		+= $(addsuffix _16,$(MAKE_TARGETS))
 
-# XXX (garrcoop): This code should be put in question as it cannot be applied
-# (no .h file, no TST_USE_NEWER64_SYSCALL def).
  DEF_16			:= TST_USE_COMPAT16_SYSCALL
-
-ifneq ($(COMPAT_TST_16_H),1)
-COMPAT_16_H		:= $(abs_srcdir)/../utils/compat_16.h
-else
-COMPAT_16_H     := $(abs_srcdir)/../utils/compat_tst_16.h
-endif
-
-ifneq ($(wildcard $(COMPAT_16_H)),)
-HAS_COMPAT_16		:= 1
-
-$(MAKE_TARGETS_OBJS_WO_COMPAT_16): $(COMPAT_16_H)
-.INTERMEDIATE: $(MAKE_TARGETS_OBJS_WO_COMPAT_16)
-
-else
-HAS_COMPAT_16		:= 0
-endif
-
  %_16: CPPFLAGS += -D$(DEF_16)=1
-# XXX (garrcoop): End section of code in question..
 
-%_16.o: %.c $(COMPAT_16_H)
+%_16.o: %.c
  	$(COMPILE.c) $(OUTPUT_OPTION) $<
author
#2 lore raw

PATCH 1/1 utils/compat_16.mk: Further cleanup of unused sections and variables

Hi Yang,

Quoted 11 lines

Hi Petr

-%_16.o: %.c $(COMPAT_16_H)

This make dependency for recompiling _16.o when header changes.

$(MAKE_TARGETS_OBJS_WO_COMPAT_16): $(COMPAT_16_H)
.INTERMEDIATE: $(MAKE_TARGETS_OBJS_WO_COMPAT_16)

This make dependency for recompiling .o when header changes.

Quoted 7 lines

I think you may miss something.

This patch will reappear the problem that has been fixed since commit 631d16671d(syscalls/utils/compat_16.mk: fix build dependencies). If we touch/modify the compat_tst_16.h/compat_16.h file and excute "make" in any of syscalls directories which includes compat_16.mk, nothing will happen.

Thank you for explaining and sorry for wrong patch.
Before I touch wrong file, that's why it didn't work the obvious way you described.

I still thing that HAS_COMPAT_16 variable is unused and not needed.

Kind regards,
Petr

Quoted 2 lines

Best Regards
Yang Xu

#3 lore raw

PATCH 1/1 utils/compat_16.mk: Further cleanup of unused sections and variables

on 2018/4/10 14:19, Petr Vorel write:

Quoted 14 lines

Hi Yang,

Quoted 4 lines

Hi Petr
-%_16.o: %.c $(COMPAT_16_H)
This make dependency for recompiling _16.o when header changes. $(MAKE_TARGETS_OBJS_WO_COMPAT_16): $(COMPAT_16_H)

Quoted 8 lines

.INTERMEDIATE: $(MAKE_TARGETS_OBJS_WO_COMPAT_16)
This make dependency for recompiling .o when header changes. I think you may miss something.
This patch will reappear the problem that has been fixed since commit 631d16671d(syscalls/utils/compat_16.mk: fix build dependencies). If we touch/modify the compat_tst_16.h/compat_16.h file and excute "make" in any of syscalls directories which includes compat_16.mk, nothing will happen.

Quoted 4 lines

Thank you for explaining and sorry for wrong patch.
Before I touch wrong file, that's why it didn't work the obvious way you described.

I still thing that HAS_COMPAT_16 variable is unused and not needed.

Hi petr

Agreed. The HAS_COMPAT_16 variable is unused .

Quoted 9 lines

Kind regards,
Petr

Quoted 2 lines

Best Regards
Yang Xu

.

author
#4 lore raw

PATCH 1/1 utils/compat_16.mk: Further cleanup of unused sections and variables

Hi Yang,

Quoted 4 lines
Quoted 1 line

I still thing that HAS_COMPAT_16 variable is unused and not needed.

Hi petr

Agreed. The HAS_COMPAT_16 variable is unused .

Thanks for review.

Pushed with added

Kind regards,
Petr