diff options
| author | Naohiro Aota <naohiro.aota@wdc.com> | 2019-07-12 06:15:55 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2019-07-12 11:35:07 -0400 |
| commit | e9a1379f9219be439f47a0f063431a92dc529eda (patch) | |
| tree | 3625670e520b344fc58d8fe321df1f0d9be88f10 | |
| parent | d7d170a8e357bd9926cc6bfea5c2385c2eac65b2 (diff) | |
x86/vdso: Fix flip/flop vdso build bug
Two consecutive "make" on an already compiled kernel tree will show
different behavior:
$ make
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
VDSOCHK arch/x86/entry/vdso/vdso64.so.dbg
VDSOCHK arch/x86/entry/vdso/vdso32.so.dbg
Kernel: arch/x86/boot/bzImage is ready (#3)
Building modules, stage 2.
MODPOST 12 modules
$ make
make
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
VDSO arch/x86/entry/vdso/vdso64.so.dbg
OBJCOPY arch/x86/entry/vdso/vdso64.so
VDSO2C arch/x86/entry/vdso/vdso-image-64.c
CC arch/x86/entry/vdso/vdso-image-64.o
VDSO arch/x86/entry/vdso/vdso32.so.dbg
OBJCOPY arch/x86/entry/vdso/vdso32.so
VDSO2C arch/x86/entry/vdso/vdso-image-32.c
CC arch/x86/entry/vdso/vdso-image-32.o
AR arch/x86/entry/vdso/built-in.a
AR arch/x86/entry/built-in.a
AR arch/x86/built-in.a
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
AR init/built-in.a
LD vmlinux.o
<snip>
This is causing "LD vmlinux" once every two times even without any
modifications. This is the same bug fixed in commit 92a4728608a8
("x86/boot: Fix if_changed build flip/flop bug"). Two "if_changed" cannot
be used in one target.
Fix this merging two commands into one function.
Fixes: 7ac870747988 ("x86/vdso: Switch to generic vDSO implementation")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lkml.kernel.org/r/20190712101556.17833-1-naohiro.aota@wdc.com
| -rw-r--r-- | arch/x86/entry/vdso/Makefile | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index 39106111be86..34773395139a 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile | |||
| @@ -56,8 +56,7 @@ VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \ | |||
| 56 | -z max-page-size=4096 | 56 | -z max-page-size=4096 |
| 57 | 57 | ||
| 58 | $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE | 58 | $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE |
| 59 | $(call if_changed,vdso) | 59 | $(call if_changed,vdso_and_check) |
| 60 | $(call if_changed,vdso_check) | ||
| 61 | 60 | ||
| 62 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi | 61 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi |
| 63 | hostprogs-y += vdso2c | 62 | hostprogs-y += vdso2c |
| @@ -127,8 +126,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE | |||
| 127 | $(call if_changed,objcopy) | 126 | $(call if_changed,objcopy) |
| 128 | 127 | ||
| 129 | $(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE | 128 | $(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE |
| 130 | $(call if_changed,vdso) | 129 | $(call if_changed,vdso_and_check) |
| 131 | $(call if_changed,vdso_check) | ||
| 132 | 130 | ||
| 133 | CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds) | 131 | CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds) |
| 134 | VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1 | 132 | VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1 |
| @@ -167,8 +165,7 @@ $(obj)/vdso32.so.dbg: FORCE \ | |||
| 167 | $(obj)/vdso32/note.o \ | 165 | $(obj)/vdso32/note.o \ |
| 168 | $(obj)/vdso32/system_call.o \ | 166 | $(obj)/vdso32/system_call.o \ |
| 169 | $(obj)/vdso32/sigreturn.o | 167 | $(obj)/vdso32/sigreturn.o |
| 170 | $(call if_changed,vdso) | 168 | $(call if_changed,vdso_and_check) |
| 171 | $(call if_changed,vdso_check) | ||
| 172 | 169 | ||
| 173 | # | 170 | # |
| 174 | # The DSO images are built using a special linker script. | 171 | # The DSO images are built using a special linker script. |
| @@ -184,6 +181,9 @@ VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \ | |||
| 184 | -Bsymbolic | 181 | -Bsymbolic |
| 185 | GCOV_PROFILE := n | 182 | GCOV_PROFILE := n |
| 186 | 183 | ||
| 184 | quiet_cmd_vdso_and_check = VDSO $@ | ||
| 185 | cmd_vdso_and_check = $(cmd_vdso); $(cmd_vdso_check) | ||
| 186 | |||
| 187 | # | 187 | # |
| 188 | # Install the unstripped copies of vdso*.so. If our toolchain supports | 188 | # Install the unstripped copies of vdso*.so. If our toolchain supports |
| 189 | # build-id, install .build-id links as well. | 189 | # build-id, install .build-id links as well. |
