Skip to contentSkip to conversation

Build error in tools/testing/selftests/bpf/

bug-report Harshit Mogalapalli 2 participants 3 messages Oct 28, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 42 lines · Harshit Mogalapalli

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'

Quoted 4 lines

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.

(quoted diff) +0 -0

b/tools/testing/selftests/bpf/Makefile
index 7437c325179e..a276f83d7c52 100644

tools/testing/selftests/bpf/Makefile +2 -1
@@ -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
#2 lore raw

Hi Alan,

Quoted 48 lines · Alan Maguire
Quoted 42 lines · Harshit Mogalapalli

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'

Quoted 4 lines

This looks related to: commit: b720903e2b14 ("selftests/bpf: Enable signature verification for some lskel tests")

Quoted 9 lines

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.

Quoted 10 lines

The patch simply creates a symlink to the cert with the right name, allowing xxd to generate the header without the -n option.

tools/testing/selftests/bpf/Makefile +0 -0
index 7437c325179e..a276f83d7c52 100644

tools/testing/selftests/bpf/Makefile $(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP) · line 729

Quoted 9 lines
tools/testing/selftests/bpf/Makefile +2 -1
@@ -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