Commit a9684337 authored by Bill Wendling's avatar Bill Wendling Committed by Masahiro Yamada
Browse files

kbuild: explicitly specify the build id style



ld's --build-id defaults to "sha1" style, while lld defaults to "fast".
The build IDs are very different between the two, which may confuse
programs that reference them.

Signed-off-by: default avatarBill Wendling <morbo@google.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 548b8b51
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -982,8 +982,8 @@ KBUILD_CPPFLAGS += $(KCPPFLAGS)
KBUILD_AFLAGS   += $(KAFLAGS)
KBUILD_CFLAGS   += $(KCFLAGS)

KBUILD_LDFLAGS_MODULE += --build-id
LDFLAGS_vmlinux += --build-id
KBUILD_LDFLAGS_MODULE += --build-id=sha1
LDFLAGS_vmlinux += --build-id=sha1

ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux	+= $(call ld-option, -X,)
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO32
ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8
ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
	    -z max-page-size=4096 -nostdlib -shared $(ldflags-y) \
	    --hash-style=sysv --build-id \
	    --hash-style=sysv --build-id=sha1 \
	    -T

obj-$(CONFIG_VDSO) += vdso.o
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
# routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
# preparation in build-time C")).
ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv	\
	     -Bsymbolic $(call ld-option, --no-eh-frame-hdr) --build-id -n	\
	     -Bsymbolic $(call ld-option, --no-eh-frame-hdr) --build-id=sha1 -n	\
	     $(btildflags-y) -T

ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ VDSO_LDFLAGS += -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1
VDSO_LDFLAGS += -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096
VDSO_LDFLAGS += -nostdlib -shared -mfloat-abi=soft
VDSO_LDFLAGS += -Wl,--hash-style=sysv
VDSO_LDFLAGS += -Wl,--build-id
VDSO_LDFLAGS += -Wl,--build-id=sha1
VDSO_LDFLAGS += $(call cc32-ldoption,-fuse-ld=bfd)


+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ endif
# VDSO linker flags.
ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
	$(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared \
	-G 0 --eh-frame-hdr --hash-style=sysv --build-id -T
	-G 0 --eh-frame-hdr --hash-style=sysv --build-id=sha1 -T

CFLAGS_REMOVE_vdso.o = -pg

Loading