Skip to contentSkip to conversation

riscv: Explicitly specify the build id style in vDSO Makefile again

PATCH In review Nathan Chancellor 4 participants 5 messages Nov 8, 2020 – Nov 21, 2020 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: Explicitly specify the build id style in vDSO Makefile again

Commit a96843372331 ("kbuild: explicitly specify the build id style") explicitly set the build ID style to SHA1. Commit c2c81bb2f691 ("RISC-V:
Fix the VDSO symbol generaton for binutils-2.35+") undid this change, likely unintentionally.

Restore it so that the build ID style stays consistent across the tree regardless of linker.

Fixes c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")
---
 arch/riscv/kernel/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/vdso/Makefile +1 -1
index cb8f9e4cfcbf..0cfd6da784f8 100644
@@ -44,7 +44,7 @@ SYSCFLAGS_vdso.so.dbg = $(c_flags)
 $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
 	$(call if_changed,vdsold)
 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
-	-Wl,--build-id -Wl,--hash-style=both
+	-Wl,--build-id=sha1 -Wl,--hash-style=both
 
 # We also create a special relocatable object that should mirror the symbol
 # table and layout of the linked DSO. With ld --just-symbols we can then

base-commit: c2c81bb2f69138f902e1a58d3bef6ad97fb8a92c

Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Nathan Chancellor

Commit a96843372331 ("kbuild: explicitly specify the build id style") explicitly set the build ID style to SHA1. Commit c2c81bb2f691 ("RISC-V:
Fix the VDSO symbol generaton for binutils-2.35+") undid this change, likely unintentionally.

Restore it so that the build ID style stays consistent across the tree regardless of linker.

Fixes c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")

Thanks for the fixup!

(I'm curious what --build-id linker flag does, and what kind of spooky bugs that led to a96843372331?)

Quoted 26 lines
---
 arch/riscv/kernel/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/vdso/Makefile +1 -1
index cb8f9e4cfcbf..0cfd6da784f8 100644
@@ -44,7 +44,7 @@ SYSCFLAGS_vdso.so.dbg = $(c_flags)
 $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
        $(call if_changed,vdsold)
 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
-       -Wl,--build-id -Wl,--hash-style=both
+       -Wl,--build-id=sha1 -Wl,--hash-style=both
 
 # We also create a special relocatable object that should mirror the symbol
 # table and layout of the linked DSO. With ld --just-symbols we can then

base-commit: c2c81bb2f69138f902e1a58d3bef6ad97fb8a92c --
2.29.2

--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20201108203737.94270-1-natechancellor%40gmail.com.

Signature · 2 lines
Thanks,
~Nick Desaulniers
Reviewed-by
#2 lore raw
Quoted 15 lines · Nick Desaulniers
Quoted 11 lines · Nathan Chancellor

Commit a96843372331 ("kbuild: explicitly specify the build id style") explicitly set the build ID style to SHA1. Commit c2c81bb2f691 ("RISC-V:
Fix the VDSO symbol generaton for binutils-2.35+") undid this change, likely unintentionally.

Restore it so that the build ID style stays consistent across the tree regardless of linker.

Fixes c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")
Quoted 7 lines

Thanks for the fixup!

(I'm curious what --build-id linker flag does, and what kind of spooky bugs that led to a96843372331?)

--build-id generates a unique "build id" for the build. It can use several different algorithms to do this. The BFD linker uses sha1 by default while LLD uses a "fast" algorithm. The difference is that the fast algorithm generates a shorter build id. This shouldn't matter in general, but there are some tools out there that expect the build id to be of a certain length, i.e. the BFD style's length, because BFD is more prevalent. The obvious response "well, why don't they just change the expected length?" is difficult in all situations. (Once an assumption is made, it's hard to backtrack.)

You can add this if you like:

Quoted 32 lines
Quoted 18 lines
---
 arch/riscv/kernel/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/vdso/Makefile +1 -1
index cb8f9e4cfcbf..0cfd6da784f8 100644
@@ -44,7 +44,7 @@ SYSCFLAGS_vdso.so.dbg = $(c_flags)
 $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
        $(call if_changed,vdsold)
 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
-       -Wl,--build-id -Wl,--hash-style=both
+       -Wl,--build-id=sha1 -Wl,--hash-style=both
 
 # We also create a special relocatable object that should mirror the symbol
 # table and layout of the linked DSO. With ld --just-symbols we can then
Quoted 8 lines

base-commit: c2c81bb2f69138f902e1a58d3bef6ad97fb8a92c --
2.29.2

--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20201108203737.94270-1-natechancellor%40gmail.com.

--
Thanks,
~Nick Desaulniers

#3 lore raw
Quoted 35 lines · Bill Wendling
Quoted 15 lines · Nick Desaulniers
Quoted 11 lines · Nathan Chancellor

Commit a96843372331 ("kbuild: explicitly specify the build id style") explicitly set the build ID style to SHA1. Commit c2c81bb2f691 ("RISC-V:
Fix the VDSO symbol generaton for binutils-2.35+") undid this change, likely unintentionally.

Restore it so that the build ID style stays consistent across the tree regardless of linker.

Fixes c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")
Quoted 7 lines

Thanks for the fixup!

(I'm curious what --build-id linker flag does, and what kind of spooky bugs that led to a96843372331?)

--build-id generates a unique "build id" for the build. It can use several different algorithms to do this. The BFD linker uses sha1 by default while LLD uses a "fast" algorithm. The difference is that the fast algorithm generates a shorter build id. This shouldn't matter in general, but there are some tools out there that expect the build id to be of a certain length, i.e. the BFD style's length, because BFD is more prevalent. The obvious response "well, why don't they just change the expected length?" is difficult in all situations. (Once an assumption is made, it's hard to backtrack.)

Quoted 3 lines

You can add this if you like:

Cool, thanks for the context, and the review!

Quoted 33 lines
Quoted 33 lines
Quoted 19 lines
---
 arch/riscv/kernel/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/vdso/Makefile +1 -1
index cb8f9e4cfcbf..0cfd6da784f8 100644
@@ -44,7 +44,7 @@ SYSCFLAGS_vdso.so.dbg = $(c_flags)
 $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
        $(call if_changed,vdsold)
 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
-       -Wl,--build-id -Wl,--hash-style=both
+       -Wl,--build-id=sha1 -Wl,--hash-style=both
 
 # We also create a special relocatable object that should mirror the symbol
 # table and layout of the linked DSO. With ld --just-symbols we can then
Quoted 8 lines

base-commit: c2c81bb2f69138f902e1a58d3bef6ad97fb8a92c --
2.29.2

--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20201108203737.94270-1-natechancellor%40gmail.com.

--
Thanks,
~Nick Desaulniers

Signature · 7 lines
Thanks,
~Nick Desaulniers

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#4 lore raw
In reply to Nathan Chancellor
Quoted 28 lines · On Sun, 08 Nov 2020 12:37:37 PST (-0800), [email protected] wrote:

Commit a96843372331 ("kbuild: explicitly specify the build id style") explicitly set the build ID style to SHA1. Commit c2c81bb2f691 ("RISC-V:
Fix the VDSO symbol generaton for binutils-2.35+") undid this change, likely unintentionally.

Restore it so that the build ID style stays consistent across the tree regardless of linker.

Fixes c2c81bb2f691 ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+")
---
 arch/riscv/kernel/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/vdso/Makefile +1 -1
index cb8f9e4cfcbf..0cfd6da784f8 100644
@@ -44,7 +44,7 @@ SYSCFLAGS_vdso.so.dbg = $(c_flags)
 $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
 	$(call if_changed,vdsold)
 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
-	-Wl,--build-id -Wl,--hash-style=both
+	-Wl,--build-id=sha1 -Wl,--hash-style=both
 
 # We also create a special relocatable object that should mirror the symbol
 # table and layout of the linked DSO. With ld --just-symbols we can then
Quoted 1 line

base-commit: c2c81bb2f69138f902e1a58d3bef6ad97fb8a92c

Sorry about that. This is on fixes.