1 # SPDX-License-Identifier: GPL-2.0
3 # List of files in the vdso, has to be asm only for now
5 obj-vdso32
= sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o
10 VDSOCC
:= $(CROSS32_COMPILE
)gcc
20 targets
:= $(obj-vdso32
) vdso32.so vdso32.so.dbg
21 obj-vdso32
:= $(addprefix $(obj
)/, $(obj-vdso32
))
27 ccflags-y
:= -shared
-fno-common
-fno-builtin
-nostdlib \
28 -Wl
,-soname
=linux-vdso32.so
.1 -Wl
,--hash-style
=both
29 asflags-y
:= -D__VDSO32__
-s
31 obj-y
+= vdso32_wrapper.o
33 CPPFLAGS_vdso32.lds
+= -P
-C
-Upowerpc
35 # Force dependency (incbin is bad)
36 $(obj
)/vdso32_wrapper.o
: $(obj
)/vdso32.so
38 # link rule for the .so file, .lds has to be first
39 $(obj
)/vdso32.so.dbg
: $(src
)/vdso32.lds
$(obj-vdso32
) FORCE
40 $(call if_changed
,vdso32ld
)
42 # strip rule for the .so file
43 $(obj
)/%.so
: OBJCOPYFLAGS
:= -S
44 $(obj
)/%.so
: $(obj
)/%.so.dbg FORCE
45 $(call if_changed
,objcopy
)
47 # assembly rules for the .S files
48 $(obj-vdso32
): %.o
: %.S FORCE
49 $(call if_changed_dep
,vdso32as
)
51 # actual build commands
52 quiet_cmd_vdso32ld
= VDSO32L
$@
53 cmd_vdso32ld
= $(VDSOCC
) $(c_flags
) $(CC32FLAGS
) -o
$@
-Wl
,-T
$(filter %.lds
,$^
) $(filter %.o
,$^
)
54 quiet_cmd_vdso32as
= VDSO32A
$@
55 cmd_vdso32as
= $(VDSOCC
) $(a_flags
) $(CC32FLAGS
) -c
-o
$@
$<
57 # install commands for the unstripped file
58 quiet_cmd_vdso_install
= INSTALL
$@
59 cmd_vdso_install
= cp
$(obj
)/$@.dbg
$(MODLIB
)/vdso
/$@
61 vdso32.so
: $(obj
)/vdso32.so.dbg
62 @mkdir
-p
$(MODLIB
)/vdso
63 $(call cmd
,vdso_install
)
65 vdso_install
: vdso32.so