| .. | .. |
|---|
| 1 | +# SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | # |
|---|
| 2 | 3 | # Building a vDSO image for AArch64. |
|---|
| 3 | 4 | # |
|---|
| .. | .. |
|---|
| 11 | 12 | targets := $(obj-vdso) vdso.so vdso.so.dbg |
|---|
| 12 | 13 | obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) |
|---|
| 13 | 14 | |
|---|
| 14 | | -ccflags-y := -shared -fno-common -fno-builtin |
|---|
| 15 | | -ccflags-y += -nostdlib -Wl,-soname=linux-vdso.so.1 \ |
|---|
| 16 | | - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) |
|---|
| 17 | | -ccflags-y += -fPIC -Wl,-shared -g |
|---|
| 15 | +ccflags-y := -shared -fno-common -fno-builtin -nostdlib -fPIC -Wl,-shared -g \ |
|---|
| 16 | + -Wl,-soname=linux-vdso.so.1 -Wl,--hash-style=sysv |
|---|
| 18 | 17 | |
|---|
| 19 | 18 | # Disable gcov profiling for VDSO code |
|---|
| 20 | 19 | GCOV_PROFILE := n |
|---|
| 21 | 20 | |
|---|
| 22 | 21 | |
|---|
| 23 | 22 | obj-y += vdso.o |
|---|
| 24 | | -extra-y += vdso.lds |
|---|
| 23 | +targets += vdso.lds |
|---|
| 25 | 24 | CPPFLAGS_vdso.lds += -P -C -U$(ARCH) |
|---|
| 26 | 25 | |
|---|
| 27 | 26 | # Force dependency |
|---|
| 28 | 27 | $(obj)/vdso.o : $(obj)/vdso.so |
|---|
| 29 | 28 | |
|---|
| 30 | 29 | # Link rule for the .so file, .lds has to be first |
|---|
| 31 | | -$(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) |
|---|
| 30 | +$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE |
|---|
| 32 | 31 | $(call if_changed,vdsold) |
|---|
| 33 | 32 | |
|---|
| 34 | 33 | |
|---|
| .. | .. |
|---|
| 40 | 39 | # Generate VDSO offsets using helper script |
|---|
| 41 | 40 | gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh |
|---|
| 42 | 41 | quiet_cmd_vdsosym = VDSOSYM $@ |
|---|
| 43 | | -define cmd_vdsosym |
|---|
| 44 | | - $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ |
|---|
| 45 | | -endef |
|---|
| 42 | + cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ |
|---|
| 46 | 43 | |
|---|
| 47 | 44 | include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE |
|---|
| 48 | 45 | $(call if_changed,vdsosym) |
|---|
| .. | .. |
|---|
| 65 | 62 | |
|---|
| 66 | 63 | # Actual build commands |
|---|
| 67 | 64 | quiet_cmd_vdsold = VDSOL $@ |
|---|
| 68 | | - cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@ |
|---|
| 65 | + cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $(real-prereqs) -o $@ |
|---|
| 69 | 66 | quiet_cmd_vdsoas = VDSOA $@ |
|---|
| 70 | 67 | cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $< |
|---|
| 71 | 68 | quiet_cmd_vdsocc = VDSOA $@ |
|---|