Skip to content

Commit d191c82

Browse files
committed
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
2 parents 4d5ac4b + 379d98d commit d191c82

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

arch/x86/entry/vdso/Makefile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
4646

4747
CPPFLAGS_vdso.lds += -P -C
4848

49-
VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \
50-
-Wl,--no-undefined \
51-
-Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 \
52-
$(DISABLE_LTO)
49+
VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
50+
-z max-page-size=4096 -z common-page-size=4096
5351

5452
$(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
5553
$(call if_changed,vdso)
@@ -93,10 +91,8 @@ CFLAGS_REMOVE_vvar.o = -pg
9391
#
9492

9593
CPPFLAGS_vdsox32.lds = $(CPPFLAGS_vdso.lds)
96-
VDSO_LDFLAGS_vdsox32.lds = -Wl,-m,elf32_x86_64 \
97-
-Wl,-soname=linux-vdso.so.1 \
98-
-Wl,-z,max-page-size=4096 \
99-
-Wl,-z,common-page-size=4096
94+
VDSO_LDFLAGS_vdsox32.lds = -m elf32_x86_64 -soname linux-vdso.so.1 \
95+
-z max-page-size=4096 -z common-page-size=4096
10096

10197
# x32-rebranded versions
10298
vobjx32s-y := $(vobjs-y:.o=-x32.o)
@@ -121,7 +117,7 @@ $(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE
121117
$(call if_changed,vdso)
122118

123119
CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
124-
VDSO_LDFLAGS_vdso32.lds = -m32 -Wl,-m,elf_i386 -Wl,-soname=linux-gate.so.1
120+
VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1
125121

126122
targets += vdso32/vdso32.lds
127123
targets += vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o
@@ -155,13 +151,13 @@ $(obj)/vdso32.so.dbg: FORCE \
155151
# The DSO images are built using a special linker script.
156152
#
157153
quiet_cmd_vdso = VDSO $@
158-
cmd_vdso = $(CC) -nostdlib -o $@ \
154+
cmd_vdso = $(LD) -nostdlib -o $@ \
159155
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
160-
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
156+
-T $(filter %.lds,$^) $(filter %.o,$^) && \
161157
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
162158

163-
VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=both) \
164-
$(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
159+
VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
160+
$(call ld-option, --build-id) -Bsymbolic
165161
GCOV_PROFILE := n
166162

167163
#

0 commit comments

Comments
 (0)