diff mbox series

[bpf-next] selftests/bpf: fix build-id for liburandom_read.so

Message ID 20221104094016.102049-1-asavkov@redhat.com (mailing list archive)
State Accepted
Commit 61fc5e66f755db24d27ba37ce1ee4873def1a074
Delegated to: BPF
Headers show
Series [bpf-next] selftests/bpf: fix build-id for liburandom_read.so | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-PR pending PR summary
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 11 maintainers not CCed: sdf@google.com kpsingh@kernel.org mykolal@fb.com haoluo@google.com linux-kselftest@vger.kernel.org yhs@fb.com shuah@kernel.org jolsa@kernel.org martin.lau@linux.dev song@kernel.org john.fastabend@gmail.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-16 success Logs for test_progs_no_alu32_parallel on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-17 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-18 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-19 success Logs for test_progs_parallel on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-20 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-22 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-23 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-11 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-13 success Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-14 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-21 success Logs for test_progs_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-24 success Logs for test_verifier on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-7 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-5 success Logs for llvm-toolchain
bpf/vmtest-bpf-next-VM_Test-6 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-4 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-1 pending Logs for ShellCheck

Commit Message

Artem Savkov Nov. 4, 2022, 9:40 a.m. UTC
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>
---
 tools/testing/selftests/bpf/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

KP Singh Nov. 4, 2022, 1:29 p.m. UTC | #1
On Fri, Nov 4, 2022 at 10:41 AM Artem Savkov <asavkov@redhat.com> wrote:
>
> 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>

Acked-by: KP Singh <kpsingh@kernel.org>

This was done in
https://lore.kernel.org/bpf/20200922232140.1994390-1-morbo@google.com
Daniel Borkmann Nov. 4, 2022, 5:38 p.m. UTC | #2
Hi Artem,

On 11/4/22 2:29 PM, KP Singh wrote:
> On Fri, Nov 4, 2022 at 10:41 AM Artem Savkov <asavkov@redhat.com> wrote:
>>
>> 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>
> 
> Acked-by: KP Singh <kpsingh@kernel.org>
> 
> This was done in
> https://lore.kernel.org/bpf/20200922232140.1994390-1-morbo@google.com

When you say "fix", does it actually fix a failing test case or is it more
of a cleanup to align liburandom_read build with urandom_read? From glancing
at the code, we only check build id for urandom_read.

Cheers,
Daniel
Andrii Nakryiko Nov. 4, 2022, 10:58 p.m. UTC | #3
On Fri, Nov 4, 2022 at 10:38 AM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> Hi Artem,
>
> On 11/4/22 2:29 PM, KP Singh wrote:
> > On Fri, Nov 4, 2022 at 10:41 AM Artem Savkov <asavkov@redhat.com> wrote:
> >>
> >> 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>
> >
> > Acked-by: KP Singh <kpsingh@kernel.org>
> >
> > This was done in
> > https://lore.kernel.org/bpf/20200922232140.1994390-1-morbo@google.com
>
> When you say "fix", does it actually fix a failing test case or is it more
> of a cleanup to align liburandom_read build with urandom_read? From glancing
> at the code, we only check build id for urandom_read.

I reworded the subject to "selftests/bpf: Use consistent build-id type
for liburandom_read.so" and pushed. Thanks!

>
> Cheers,
> Daniel
patchwork-bot+netdevbpf@kernel.org Nov. 4, 2022, 11 p.m. UTC | #4
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Fri,  4 Nov 2022 10:40:16 +0100 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests/bpf: fix build-id for liburandom_read.so
    https://git.kernel.org/bpf/bpf-next/c/61fc5e66f755

You are awesome, thank you!
Daniel Borkmann Nov. 4, 2022, 11:07 p.m. UTC | #5
On 11/4/22 11:58 PM, Andrii Nakryiko wrote:
> On Fri, Nov 4, 2022 at 10:38 AM Daniel Borkmann <daniel@iogearbox.net> wrote:
>>
>> Hi Artem,
>>
>> On 11/4/22 2:29 PM, KP Singh wrote:
>>> On Fri, Nov 4, 2022 at 10:41 AM Artem Savkov <asavkov@redhat.com> wrote:
>>>>
>>>> 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>
>>>
>>> Acked-by: KP Singh <kpsingh@kernel.org>
>>>
>>> This was done in
>>> https://lore.kernel.org/bpf/20200922232140.1994390-1-morbo@google.com
>>
>> When you say "fix", does it actually fix a failing test case or is it more
>> of a cleanup to align liburandom_read build with urandom_read? From glancing
>> at the code, we only check build id for urandom_read.
> 
> I reworded the subject to "selftests/bpf: Use consistent build-id type
> for liburandom_read.so" and pushed. Thanks!

Ack, sgtm!
Artem Savkov Nov. 7, 2022, 7:37 a.m. UTC | #6
On Fri, Nov 04, 2022 at 03:58:43PM -0700, Andrii Nakryiko wrote:
> On Fri, Nov 4, 2022 at 10:38 AM Daniel Borkmann <daniel@iogearbox.net> wrote:
> >
> > Hi Artem,
> >
> > On 11/4/22 2:29 PM, KP Singh wrote:
> > > On Fri, Nov 4, 2022 at 10:41 AM Artem Savkov <asavkov@redhat.com> wrote:
> > >>
> > >> 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>
> > >
> > > Acked-by: KP Singh <kpsingh@kernel.org>
> > >
> > > This was done in
> > > https://lore.kernel.org/bpf/20200922232140.1994390-1-morbo@google.com
> >
> > When you say "fix", does it actually fix a failing test case or is it more
> > of a cleanup to align liburandom_read build with urandom_read? From glancing
> > at the code, we only check build id for urandom_read.

I called it a "fix" because it broke expectations of external tools, but
the reworded version sounds much better.

> I reworded the subject to "selftests/bpf: Use consistent build-id type
> for liburandom_read.so" and pushed. Thanks!

Thank you, Andrii.
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 79edef1dbda4..5a792987df66 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -182,7 +182,8 @@  endif
 $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c
 	$(call msg,LIB,,$@)
 	$(Q)$(CLANG) $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $^ $(LDLIBS)   \
-		     -fuse-ld=$(LLD) -Wl,-znoseparate-code -fPIC -shared -o $@
+		     -fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
+		     -fPIC -shared -o $@
 
 $(OUTPUT)/urandom_read: urandom_read.c urandom_read_aux.c $(OUTPUT)/liburandom_read.so
 	$(call msg,BINARY,,$@)