aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-13 20:50:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-13 20:50:17 -0400
commitd191c82d4d9bd0bb3b945fc458cc65053ef868a0 (patch)
tree8cd86071b084caade89308bdca2e70b0ce278cd2
parent4d5ac4b8ca1ecbdb600097a26071abc5b47500bf (diff)
parent379d98ddf41344273d9718556f761420f4dc80b3 (diff)
Merge branch 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 vdso update from Thomas Gleixner: "Use LD to link the VDSO libs instead of indirecting trough CC which causes build failures with Clang" * 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: vdso: Use $LD instead of $CC to link
-rw-r--r--arch/x86/entry/vdso/Makefile22
1 files changed, 9 insertions, 13 deletions
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index b9ed1aa53a26..9f695f517747 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -46,10 +46,8 @@ targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
46 46
47CPPFLAGS_vdso.lds += -P -C 47CPPFLAGS_vdso.lds += -P -C
48 48
49VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \ 49VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
50 -Wl,--no-undefined \ 50 -z max-page-size=4096 -z common-page-size=4096
51 -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 \
52 $(DISABLE_LTO)
53 51
54$(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE 52$(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
55 $(call if_changed,vdso) 53 $(call if_changed,vdso)
@@ -93,10 +91,8 @@ CFLAGS_REMOVE_vvar.o = -pg
93# 91#
94 92
95CPPFLAGS_vdsox32.lds = $(CPPFLAGS_vdso.lds) 93CPPFLAGS_vdsox32.lds = $(CPPFLAGS_vdso.lds)
96VDSO_LDFLAGS_vdsox32.lds = -Wl,-m,elf32_x86_64 \ 94VDSO_LDFLAGS_vdsox32.lds = -m elf32_x86_64 -soname linux-vdso.so.1 \
97 -Wl,-soname=linux-vdso.so.1 \ 95 -z max-page-size=4096 -z common-page-size=4096
98 -Wl,-z,max-page-size=4096 \
99 -Wl,-z,common-page-size=4096
100 96
101# x32-rebranded versions 97# x32-rebranded versions
102vobjx32s-y := $(vobjs-y:.o=-x32.o) 98vobjx32s-y := $(vobjs-y:.o=-x32.o)
@@ -121,7 +117,7 @@ $(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE
121 $(call if_changed,vdso) 117 $(call if_changed,vdso)
122 118
123CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds) 119CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
124VDSO_LDFLAGS_vdso32.lds = -m32 -Wl,-m,elf_i386 -Wl,-soname=linux-gate.so.1 120VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1
125 121
126targets += vdso32/vdso32.lds 122targets += vdso32/vdso32.lds
127targets += vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o 123targets += vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o
@@ -155,13 +151,13 @@ $(obj)/vdso32.so.dbg: FORCE \
155# The DSO images are built using a special linker script. 151# The DSO images are built using a special linker script.
156# 152#
157quiet_cmd_vdso = VDSO $@ 153quiet_cmd_vdso = VDSO $@
158 cmd_vdso = $(CC) -nostdlib -o $@ \ 154 cmd_vdso = $(LD) -nostdlib -o $@ \
159 $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \ 155 $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
160 -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \ 156 -T $(filter %.lds,$^) $(filter %.o,$^) && \
161 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' 157 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
162 158
163VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=both) \ 159VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
164 $(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS) 160 $(call ld-option, --build-id) -Bsymbolic
165GCOV_PROFILE := n 161GCOV_PROFILE := n
166 162
167# 163#