arch: vdso: remove if-conditionals of $(c-gettimeofday-y)
Subsystems (6)
PATCH v2 1/1 arch: vdso: remove if-conditionals of $(c-gettimeofday-y)
arm, arm64, csky, mips, powerpc always select GENERIC_GETTIMEOFDAY, hence $(gettimeofday-y) never becomes empty.
riscv conditionally selects GENERIC_GETTIMEOFDAY when MMU=y && 64BIT=y, but arch/riscv/kernel/vdso/vgettimeofday.o is built only under that condition. So, you can always define CFLAGS_vgettimeofday.o
Remove all the meaningless conditionals.
---
Changes in v2:
- Fix csky as well
arch/arm/vdso/Makefile | 4 ---- arch/arm64/kernel/vdso/Makefile | 5 +---- arch/arm64/kernel/vdso32/Makefile | 3 --- arch/csky/kernel/vdso/Makefile | 4 +--- arch/mips/vdso/Makefile | 2 -- arch/powerpc/kernel/vdso32/Makefile | 14 ++++++-------- arch/powerpc/kernel/vdso64/Makefile | 14 ++++++-------- arch/riscv/kernel/vdso/Makefile | 5 +---- 8 files changed, 15 insertions(+), 36 deletions(-)
arch/arm/vdso/Makefile +0 -4
@@ -29,11 +29,7 @@ CFLAGS_REMOVE_vdso.o = -pg # Force -O2 to avoid libgcc dependencies CFLAGS_REMOVE_vgettimeofday.o = -pg -Os $(GCC_PLUGINS_CFLAGS) -ifeq ($(c-gettimeofday-y),) -CFLAGS_vgettimeofday.o = -O2 -else CFLAGS_vgettimeofday.o = -O2 -include $(c-gettimeofday-y) -endif # Disable gcov profiling for VDSO code GCOV_PROFILE := n
arch/arm64/kernel/vdso/Makefile +1 -4
@@ -37,10 +37,7 @@ OBJECT_FILES_NON_STANDARD := y KCOV_INSTRUMENT := n CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -fasynchronous-unwind-tables - -ifneq ($(c-gettimeofday-y),) - CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) -endif +CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) # Disable gcov profiling for VDSO code GCOV_PROFILE := n
arch/arm64/kernel/vdso32/Makefile +0 -3
@@ -133,10 +133,7 @@ hostprogs := $(munge) c-obj-vdso := note.o c-obj-vdso-gettimeofday := vgettimeofday.o - -ifneq ($(c-gettimeofday-y),) VDSO_CFLAGS_gettimeofday_o += -include $(c-gettimeofday-y) -endif VDSO_CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
arch/csky/kernel/vdso/Makefile +1 -3
@@ -12,9 +12,7 @@ vdso-syms += vgettimeofday # Files to link into the vdso obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o -ifneq ($(c-gettimeofday-y),) - CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) -endif +CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) ccflags-y := -fno-stack-protector -DBUILD_VDSO32
arch/mips/vdso/Makefile +0 -2
@@ -36,7 +36,6 @@ cflags-vdso := $(ccflags-vdso) \ aflags-vdso := $(ccflags-vdso) \ -D__ASSEMBLY__ -Wa,-gdwarf-2 -ifneq ($(c-gettimeofday-y),) CFLAGS_vgettimeofday.o = -include $(c-gettimeofday-y) # config-n32-o32-env.c prepares the environment to build a 32bit vDSO
@@ -44,7 +43,6 @@ CFLAGS_vgettimeofday.o = -include $(c-gettimeofday-y) # Note: Needs to be included before than the generic library. CFLAGS_vgettimeofday-o32.o = -include $(srctree)/$(src)/config-n32-o32-env.c -include $(c-gettimeofday-y) CFLAGS_vgettimeofday-n32.o = -include $(srctree)/$(src)/config-n32-o32-env.c -include $(c-gettimeofday-y) -endif CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
arch/powerpc/kernel/vdso32/Makefile +6 -8
@@ -7,14 +7,12 @@ include $(srctree)/lib/vdso/Makefile obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o -ifneq ($(c-gettimeofday-y),) - CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) - CFLAGS_vgettimeofday.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) - CFLAGS_vgettimeofday.o += $(call cc-option, -fno-stack-protector) - CFLAGS_vgettimeofday.o += -DDISABLE_BRANCH_PROFILING - CFLAGS_vgettimeofday.o += -ffreestanding -fasynchronous-unwind-tables - CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -endif +CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) +CFLAGS_vgettimeofday.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) +CFLAGS_vgettimeofday.o += $(call cc-option, -fno-stack-protector) +CFLAGS_vgettimeofday.o += -DDISABLE_BRANCH_PROFILING +CFLAGS_vgettimeofday.o += -ffreestanding -fasynchronous-unwind-tables +CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) # Build rules
arch/powerpc/kernel/vdso64/Makefile +6 -8
@@ -6,14 +6,12 @@ include $(srctree)/lib/vdso/Makefile obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o -ifneq ($(c-gettimeofday-y),) - CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) - CFLAGS_vgettimeofday.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) - CFLAGS_vgettimeofday.o += $(call cc-option, -fno-stack-protector) - CFLAGS_vgettimeofday.o += -DDISABLE_BRANCH_PROFILING - CFLAGS_vgettimeofday.o += -ffreestanding -fasynchronous-unwind-tables - CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -endif +CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) +CFLAGS_vgettimeofday.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) +CFLAGS_vgettimeofday.o += $(call cc-option, -fno-stack-protector) +CFLAGS_vgettimeofday.o += -DDISABLE_BRANCH_PROFILING +CFLAGS_vgettimeofday.o += -ffreestanding -fasynchronous-unwind-tables +CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) # Build rules
arch/riscv/kernel/vdso/Makefile +1 -4
@@ -17,10 +17,7 @@ vdso-syms += flush_icache obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o ccflags-y := -fno-stack-protector - -ifneq ($(c-gettimeofday-y),) - CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y) -endif +CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y) # Build rules targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-syms.S
Signature · 7 lines
2.27.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 15 lines · Masahiro Yamada
arm, arm64, csky, mips, powerpc always select
GENERIC_GETTIMEOFDAY, hence $(gettimeofday-y) never becomes empty.riscv conditionally selects
GENERIC_GETTIMEOFDAYwhen MMU=y && 64BIT=y, butarch/riscv/kernel/vdso/vgettimeofday.ois built only under that condition. So, you can always define CFLAGS_vgettimeofday.oRemove all the meaningless conditionals.
Signed-off-by Masahiro Yamada <[email protected]>---
Changes in v2:
- Fix csky as well
Quoted 7 lines
arch/arm/vdso/Makefile | 4 ---- arch/arm64/kernel/vdso/Makefile | 5 +---- arch/arm64/kernel/vdso32/Makefile | 3 --- arch/csky/kernel/vdso/Makefile | 4 +--- arch/mips/vdso/Makefile | 2 -- arch/powerpc/kernel/vdso32/Makefile | 14 ++++++-------- arch/powerpc/kernel/vdso64/Makefile | 14 ++++++--------
I noticed this the other day and was puzzled why we still needed the conditional, thanks for cleaning it up.
cheers
Quoted 10 lines · Masahiro Yamada
arm, arm64, csky, mips, powerpc always select
GENERIC_GETTIMEOFDAY, hence $(gettimeofday-y) never becomes empty.riscv conditionally selects
GENERIC_GETTIMEOFDAYwhen MMU=y && 64BIT=y, butarch/riscv/kernel/vdso/vgettimeofday.ois built only under that condition. So, you can always define CFLAGS_vgettimeofday.oRemove all the meaningless conditionals.
Signed-off-by Masahiro Yamada <[email protected]>
Quoted 9 lines · Masahiro Yamada
arm, arm64, csky, mips, powerpc always select
GENERIC_GETTIMEOFDAY, hence $(gettimeofday-y) never becomes empty.riscv conditionally selects
GENERIC_GETTIMEOFDAYwhen MMU=y && 64BIT=y, butarch/riscv/kernel/vdso/vgettimeofday.ois built only under that condition. So, you can always define CFLAGS_vgettimeofday.oRemove all the meaningless conditionals.
Quoted 8 lines
Signed-off-by Masahiro Yamada <[email protected]>---
Changes in v2:
- Fix csky as well[..]
arch/mips/vdso/Makefile | 2 --
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]