Skip to content

Commit 61fc5e6

Browse files
sm00thanakryiko
authored andcommitted
selftests/bpf: Use consistent build-id type for liburandom_read.so
lld produces "fast" style build-ids by default, which is inconsistent with ld's "sha1" style. Explicitly specify build-id style to be "sha1" when linking liburandom_read.so the same way it is already done for urandom_read. Signed-off-by: Artem Savkov <asavkov@redhat.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: KP Singh <kpsingh@kernel.org> Link: https://lore.kernel.org/bpf/20221104094016.102049-1-asavkov@redhat.com
1 parent b3c09fd commit 61fc5e6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tools/testing/selftests/bpf/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,15 @@ endif
182182
$(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c
183183
$(call msg,LIB,,$@)
184184
$(Q)$(CLANG) $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $^ $(LDLIBS) \
185-
-fuse-ld=$(LLD) -Wl,-znoseparate-code -fPIC -shared -o $@
185+
-fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
186+
-fPIC -shared -o $@
186187

187188
$(OUTPUT)/urandom_read: urandom_read.c urandom_read_aux.c $(OUTPUT)/liburandom_read.so
188189
$(call msg,BINARY,,$@)
189190
$(Q)$(CLANG) $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $(filter %.c,$^) \
190191
liburandom_read.so $(LDLIBS) \
191-
-fuse-ld=$(LLD) -Wl,-znoseparate-code \
192-
-Wl,-rpath=. -Wl,--build-id=sha1 -o $@
192+
-fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
193+
-Wl,-rpath=. -o $@
193194

194195
$(OUTPUT)/sign-file: ../../../../scripts/sign-file.c
195196
$(call msg,SIGN-FILE,,$@)

0 commit comments

Comments
 (0)