* [bug-report] Build error in tools/testing/selftests/bpf/
@ 2025-10-28 9:31 Harshit Mogalapalli
2025-10-28 10:15 ` Alan Maguire
0 siblings, 1 reply; 3+ messages in thread
From: Harshit Mogalapalli @ 2025-10-28 9:31 UTC (permalink / raw)
To: bpf, kpsingh; +Cc: Alan Maguire
Hi all,
I am seeing a build failure with latest bpf-next:
[root@hamogala-Kbuild bpf-next]# git describe
bpf-next-6.16-44604-gf9db3a38224e
[root@hamogala-Kbuild bpf-next]# make -j$(nproc) -C
tools/testing/selftests/bpf/
make: Entering directory '/home/opc/bpf-next/tools/testing/selftests/bpf'
Usage:
xxd [options] [infile [outfile]]
or
xxd -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]
Options:
-a toggle autoskip: A single '*' replaces nul-lines.
Default off.
-b binary digit dump (incompatible with -ps,-i,-r).
Default hex.
-C capitalize variable names in C include file style (-i).
-c cols format <cols> octets per line. Default 16 (-i: 12, -ps:
30).
-E show characters in EBCDIC. Default ASCII.
-e little-endian dump (incompatible with -ps,-i,-r).
-g number of octets per group in normal output. Default 2
(-e: 4).
-h print this summary.
-i output in C include file style.
-l len stop after <len> octets.
-o off add <off> to the displayed file position.
-ps output in postscript plain hexdump style.
-r reverse operation: convert (or patch) hexdump into binary.
-r -s off revert with <off> added to file positions found in hexdump.
-d show offset in decimal instead of hex.
-s [+][-]seek start at <seek> bytes abs. (or +: rel.) infile offset.
-u use upper case hex letters.
-v show version: "xxd V1.10 27oct98 by Juergen Weigert".
make: *** [Makefile:726: verification_cert.h] Error 1
make: *** Deleting file 'verification_cert.h'
make: Leaving directory '/home/opc/bpf-next/tools/testing/selftests/bpf'
This looks related to: commit: b720903e2b14 ("selftests/bpf: Enable
signature verification for some lskel tests")
Thanks,
Harshit
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [bug-report] Build error in tools/testing/selftests/bpf/
2025-10-28 9:31 [bug-report] Build error in tools/testing/selftests/bpf/ Harshit Mogalapalli
@ 2025-10-28 10:15 ` Alan Maguire
2025-10-28 10:24 ` Harshit Mogalapalli
0 siblings, 1 reply; 3+ messages in thread
From: Alan Maguire @ 2025-10-28 10:15 UTC (permalink / raw)
To: Harshit Mogalapalli, bpf, kpsingh
On 28/10/2025 09:31, Harshit Mogalapalli wrote:
> Hi all,
>
> I am seeing a build failure with latest bpf-next:
>
>
> [root@hamogala-Kbuild bpf-next]# git describe
> bpf-next-6.16-44604-gf9db3a38224e
> [root@hamogala-Kbuild bpf-next]# make -j$(nproc) -C tools/testing/
> selftests/bpf/
> make: Entering directory '/home/opc/bpf-next/tools/testing/selftests/bpf'
>
> Usage:
> xxd [options] [infile [outfile]]
> or
> xxd -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]
> Options:
> -a toggle autoskip: A single '*' replaces nul-lines.
> Default off.
> -b binary digit dump (incompatible with -ps,-i,-r). Default
> hex.
> -C capitalize variable names in C include file style (-i).
> -c cols format <cols> octets per line. Default 16 (-i: 12, -ps:
> 30).
> -E show characters in EBCDIC. Default ASCII.
> -e little-endian dump (incompatible with -ps,-i,-r).
> -g number of octets per group in normal output. Default 2
> (-e: 4).
> -h print this summary.
> -i output in C include file style.
> -l len stop after <len> octets.
> -o off add <off> to the displayed file position.
> -ps output in postscript plain hexdump style.
> -r reverse operation: convert (or patch) hexdump into binary.
> -r -s off revert with <off> added to file positions found in hexdump.
> -d show offset in decimal instead of hex.
> -s [+][-]seek start at <seek> bytes abs. (or +: rel.) infile offset.
> -u use upper case hex letters.
> -v show version: "xxd V1.10 27oct98 by Juergen Weigert".
> make: *** [Makefile:726: verification_cert.h] Error 1
> make: *** Deleting file 'verification_cert.h'
> make: Leaving directory '/home/opc/bpf-next/tools/testing/selftests/bpf'
>
> This looks related to: commit: b720903e2b14 ("selftests/bpf: Enable
> signature verification for some lskel tests")
>
>
hi Harshit, I ran into this too; it turns out the version of
/usr/bin/xxd needs to support the -n (name) option and only the
vim-common v9 or later version supports that. The name option allows the
user to provide a name not derived implicitly from the file path
apparently. It _might_ make sense to do something like the below since
it would loosen the requirement for a very new vim-common package to be
installed. Many distros may not have a new enough xxd packaged, and as a
result run into this issue.
The patch simply creates a symlink to the cert with the right name,
allowing xxd to generate the header without the -n option.
diff --git a/tools/testing/selftests/bpf/Makefile
b/tools/testing/selftests/bpf/Makefile
index 7437c325179e..a276f83d7c52 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -722,7 +722,8 @@ $(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP)
$(Q)$(VERIFY_SIG_SETUP) genkey $(BUILD_DIR)
$(VERIFY_SIG_HDR): $(VERIFICATION_CERT)
- $(Q)xxd -i -n test_progs_verification_cert $< > $@
+ $(Q)ln -fs $< test_progs_verification_cert && \
+ xxd -i test_progs_verification_cert > $@
# Define test_progs test runner.
TRUNNER_TESTS_DIR := prog_tests
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [bug-report] Build error in tools/testing/selftests/bpf/
2025-10-28 10:15 ` Alan Maguire
@ 2025-10-28 10:24 ` Harshit Mogalapalli
0 siblings, 0 replies; 3+ messages in thread
From: Harshit Mogalapalli @ 2025-10-28 10:24 UTC (permalink / raw)
To: Alan Maguire, bpf, kpsingh
Hi Alan,
On 28/10/25 15:45, Alan Maguire wrote:
> On 28/10/2025 09:31, Harshit Mogalapalli wrote:
>> Hi all,
>>
>> I am seeing a build failure with latest bpf-next:
>>
>>
>> [root@hamogala-Kbuild bpf-next]# git describe
>> bpf-next-6.16-44604-gf9db3a38224e
>> [root@hamogala-Kbuild bpf-next]# make -j$(nproc) -C tools/testing/
>> selftests/bpf/
>> make: Entering directory '/home/opc/bpf-next/tools/testing/selftests/bpf'
>>
>> Usage:
>> xxd [options] [infile [outfile]]
>> or
>> xxd -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]
>> Options:
>> -a toggle autoskip: A single '*' replaces nul-lines.
>> Default off.
>> -b binary digit dump (incompatible with -ps,-i,-r). Default
>> hex.
>> -C capitalize variable names in C include file style (-i).
>> -c cols format <cols> octets per line. Default 16 (-i: 12, -ps:
>> 30).
>> -E show characters in EBCDIC. Default ASCII.
>> -e little-endian dump (incompatible with -ps,-i,-r).
>> -g number of octets per group in normal output. Default 2
>> (-e: 4).
>> -h print this summary.
>> -i output in C include file style.
>> -l len stop after <len> octets.
>> -o off add <off> to the displayed file position.
>> -ps output in postscript plain hexdump style.
>> -r reverse operation: convert (or patch) hexdump into binary.
>> -r -s off revert with <off> added to file positions found in hexdump.
>> -d show offset in decimal instead of hex.
>> -s [+][-]seek start at <seek> bytes abs. (or +: rel.) infile offset.
>> -u use upper case hex letters.
>> -v show version: "xxd V1.10 27oct98 by Juergen Weigert".
>> make: *** [Makefile:726: verification_cert.h] Error 1
>> make: *** Deleting file 'verification_cert.h'
>> make: Leaving directory '/home/opc/bpf-next/tools/testing/selftests/bpf'
>>
>> This looks related to: commit: b720903e2b14 ("selftests/bpf: Enable
>> signature verification for some lskel tests")
>>
>>
>
> hi Harshit, I ran into this too; it turns out the version of
> /usr/bin/xxd needs to support the -n (name) option and only the
> vim-common v9 or later version supports that. The name option allows the
> user to provide a name not derived implicitly from the file path
> apparently. It _might_ make sense to do something like the below since
> it would loosen the requirement for a very new vim-common package to be
> installed. Many distros may not have a new enough xxd packaged, and as a
> result run into this issue.
>
Ah, thanks for explaining.
> The patch simply creates a symlink to the cert with the right name,
> allowing xxd to generate the header without the -n option.
>
> diff --git a/tools/testing/selftests/bpf/Makefile
> b/tools/testing/selftests/bpf/Makefile
> index 7437c325179e..a276f83d7c52 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -722,7 +722,8 @@ $(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP)
> $(Q)$(VERIFY_SIG_SETUP) genkey $(BUILD_DIR)
>
> $(VERIFY_SIG_HDR): $(VERIFICATION_CERT)
> - $(Q)xxd -i -n test_progs_verification_cert $< > $@
> + $(Q)ln -fs $< test_progs_verification_cert && \
> + xxd -i test_progs_verification_cert > $@
>
> # Define test_progs test runner.
> TRUNNER_TESTS_DIR := prog_tests
>
Agree, this works for me.
Thanks for providing a fix.
Regards,
Harshit
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-28 10:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28 9:31 [bug-report] Build error in tools/testing/selftests/bpf/ Harshit Mogalapalli
2025-10-28 10:15 ` Alan Maguire
2025-10-28 10:24 ` Harshit Mogalapalli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).