Skip to content

Commit ae60279

Browse files
committed
powerpc/vdso: Rework VDSO32 makefile to add a prefix to object files
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author Christophe Leroy <christophe.leroy@csgroup.eu> commit d88378d In order to merge vdso32 and vdso64 build in following patch, rework Makefile is order to add -32 suffix to VDSO32 object files. Also change sigtramp.S to sigtramp32.S as VDSO64 sigtramp.S is too different to be squashed into VDSO32 sigtramp.S at the first place. gen_vdso_offsets.sh also becomes gen_vdso32_offsets.sh Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/0c421b704a57b228e75a891512568339c53667ad.1642782130.git.christophe.leroy@csgroup.eu (cherry picked from commit d88378d) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent c4891a3 commit ae60279

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

arch/powerpc/kernel/vdso32/Makefile

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
ARCH_REL_TYPE_ABS := R_PPC_JUMP_SLOT|R_PPC_GLOB_DAT|R_PPC_ADDR32|R_PPC_ADDR24|R_PPC_ADDR16|R_PPC_ADDR16_LO|R_PPC_ADDR16_HI|R_PPC_ADDR16_HA|R_PPC_ADDR14|R_PPC_ADDR14_BRTAKEN|R_PPC_ADDR14_BRNTAKEN|R_PPC_REL24
66
include $(srctree)/lib/vdso/Makefile
77

8-
obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o
8+
obj-vdso32 = sigtramp32-32.o gettimeofday-32.o datapage-32.o cacheflush-32.o note-32.o getcpu-32.o
99

1010
ifneq ($(c-gettimeofday-y),)
11-
CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
12-
CFLAGS_vgettimeofday.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
13-
CFLAGS_vgettimeofday.o += $(call cc-option, -fno-stack-protector)
14-
CFLAGS_vgettimeofday.o += -DDISABLE_BRANCH_PROFILING
15-
CFLAGS_vgettimeofday.o += -ffreestanding -fasynchronous-unwind-tables
16-
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
11+
CFLAGS_vgettimeofday-32.o += -include $(c-gettimeofday-y)
12+
CFLAGS_vgettimeofday-32.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
13+
CFLAGS_vgettimeofday-32.o += $(call cc-option, -fno-stack-protector)
14+
CFLAGS_vgettimeofday-32.o += -DDISABLE_BRANCH_PROFILING
15+
CFLAGS_vgettimeofday-32.o += -ffreestanding -fasynchronous-unwind-tables
16+
CFLAGS_REMOVE_vgettimeofday-32.o = $(CC_FLAGS_FTRACE)
17+
CFLAGS_REMOVE_vgettimeofday-32.o += -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc
1718
endif
1819

1920
# Build rules
@@ -24,50 +25,44 @@ else
2425
VDSOCC := $(CC)
2526
endif
2627

27-
CC32FLAGS :=
28-
ifdef CONFIG_PPC64
29-
CC32FLAGS += -m32
30-
KBUILD_CFLAGS := $(filter-out -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc,$(KBUILD_CFLAGS))
31-
endif
32-
33-
targets := $(obj-vdso32) vdso32.so.dbg vgettimeofday.o
28+
targets := $(obj-vdso32) vdso32.so.dbg vgettimeofday-32.o
3429
obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
3530

3631
GCOV_PROFILE := n
3732
KCOV_INSTRUMENT := n
3833
UBSAN_SANITIZE := n
3934
KASAN_SANITIZE := n
4035

41-
ccflags-y := -shared -fno-common -fno-builtin -nostdlib \
42-
-Wl,-soname=linux-vdso32.so.1 -Wl,--hash-style=both
43-
asflags-y := -D__VDSO32__ -s
36+
ccflags-y := -shared -fno-common -fno-builtin -nostdlib -Wl,--hash-style=both
37+
38+
CC32FLAGS := -Wl,-soname=linux-vdso32.so.1 -m32
39+
AS32FLAGS := -D__VDSO32__ -s
4440

45-
obj-y += vdso32_wrapper.o
4641
targets += vdso32.lds
4742
CPPFLAGS_vdso32.lds += -P -C -Upowerpc
4843

4944
# link rule for the .so file, .lds has to be first
50-
$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday.o FORCE
45+
$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o FORCE
5146
$(call if_changed,vdso32ld_and_check)
5247

5348
# assembly rules for the .S files
54-
$(obj-vdso32): %.o: %.S FORCE
49+
$(obj-vdso32): %-32.o: %.S FORCE
5550
$(call if_changed_dep,vdso32as)
56-
$(obj)/vgettimeofday.o: %.o: %.c FORCE
51+
$(obj)/vgettimeofday-32.o: %-32.o: %.c FORCE
5752
$(call if_changed_dep,vdso32cc)
5853

5954
# Generate VDSO offsets using helper script
60-
gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
61-
quiet_cmd_vdsosym = VDSOSYM $@
62-
cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
55+
gen-vdso32sym := $(srctree)/$(src)/gen_vdso32_offsets.sh
56+
quiet_cmd_vdso32sym = VDSO32SYM $@
57+
cmd_vdso32sym = $(NM) $< | $(gen-vdso32sym) | LC_ALL=C sort > $@
6358

6459
include/generated/vdso32-offsets.h: $(obj)/vdso32.so.dbg FORCE
65-
$(call if_changed,vdsosym)
60+
$(call if_changed,vdso32sym)
6661

6762
# actual build commands
6863
quiet_cmd_vdso32ld_and_check = VDSO32L $@
6964
cmd_vdso32ld_and_check = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) ; $(cmd_vdso_check)
7065
quiet_cmd_vdso32as = VDSO32A $@
71-
cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) -c -o $@ $<
66+
cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) $(AS32FLAGS) -c -o $@ $<
7267
quiet_cmd_vdso32cc = VDSO32C $@
7368
cmd_vdso32cc = $(VDSOCC) $(c_flags) $(CC32FLAGS) -c -o $@ $<
File renamed without changes.

0 commit comments

Comments
 (0)