ubuntu_bpf test failed to build on F-OEM-5.6

Bug #1879360 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Fix Released
Undecided
Po-Hsu Lin
linux-oem-5.6 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Test build failed with:
    Couldn't find kernel BTF; set VMLINUX_BTF to specify its location.

Please find attachment for the complete build log.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: linux-image-5.6.0-1010-oem 5.6.0-1010.10
ProcVersionSignature: User Name 5.6.0-1010.10-oem 5.6.8
Uname: Linux 5.6.0-1010-oem x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
Date: Mon May 18 16:03:17 2020
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: linux-signed-oem-5.6
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
tags: added: ubuntu-bpf
tags: added: 5.6 oem
tags: added: sru-20200427
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

This is affecting the net test in ubuntu_kernel_selftests on F-OEM-5.6 as well.

Timo Aaltonen (tjaalton)
affects: linux-signed-oem-5.6 (Ubuntu) → linux-oem-5.6 (Ubuntu)
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Build log on jenkins is complaining about the use of unknown builtin '__builtin_preserve_field_info:

    ^
    progs/test_core_reloc_bitfields_direct.c:59:13: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
    out->s32 = BPF_CORE_READ_BITFIELD(in, s32);
    ^
    /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:68:36: note: expanded from macro 'BPF_CORE_READ_BITFIELD'
    const void *p = (const void *)s + __CORE_RELO(s, field, BYTE_OFFSET); \
    ^
    /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:23:2: note: expanded from macro '__CORE_RELO'
    __builtin_preserve_field_info((src)->field, BPF_FIELD_##info)
    ^
    7 errors generated.
    llc-9: error: llc-9: :1:1: error: expected top-level entity
    BPF obj compilation failed
    ^

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

a fix is committed to git

Changed in linux-oem-5.6 (Ubuntu):
status: New → Fix Committed
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Download full text (5.4 KiB)

Issue still exist in 5.6.0-1011.11

 Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
 progs/test_xdp_bpf2bpf.c:11:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
 } __attribute__((preserve_access_index));
 ^
 progs/test_xdp_bpf2bpf.c:19:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
 } __attribute__((preserve_access_index));
 ^
 progs/test_xdp_bpf2bpf.c:28:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
 } __attribute__((preserve_access_index));
 ^
 3 warnings generated.
 progs/test_core_reloc_bitfields_direct.c:53:13: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
 out->ub1 = BPF_CORE_READ_BITFIELD(in, ub1);
 ^
 /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:68:36: note: expanded from macro 'BPF_CORE_READ_BITFIELD'
 const void *p = (const void *)s + __CORE_RELO(s, field, BYTE_OFFSET); \
 ^
 /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:23:2: note: expanded from macro '__CORE_RELO'
 __builtin_preserve_field_info((src)->field, BPF_FIELD_##info)
 ^
 progs/test_core_reloc_bitfields_direct.c:54:13: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
 out->ub2 = BPF_CORE_READ_BITFIELD(in, ub2);
 ^
 /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:68:36: note: expanded from macro 'BPF_CORE_READ_BITFIELD'
 const void *p = (const void *)s + __CORE_RELO(s, field, BYTE_OFFSET); \
 ^
 /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:23:2: note: expanded from macro '__CORE_RELO'
 __builtin_preserve_field_info((src)->field, BPF_FIELD_##info)
 ^
 progs/test_core_reloc_bitfields_direct.c:55:13: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
 out->ub7 = BPF_CORE_READ_BITFIELD(in, ub7);
 ^
 /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:68:36: note: expanded from macro 'BPF_CORE_READ_BITFIELD'
 const void *p = (const void *)s + __CORE_RELO(s, field, BYTE_OFFSET); \
 ^
 /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:23:2: note: expanded from macro '__CORE_RELO'
 __builtin_preserve_field_info((src)->field, BPF_FIELD_##info)
 ^
 progs/test_core_reloc_bitfields_direct.c:56:13: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
 out->sb4 = BPF_CORE_READ_BITFIELD(in, sb4);
 ^
 /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:68:36: note: expanded from macro 'BPF_CORE_READ_BITFIELD'
 const void *p = (const void *)s + __CORE_RELO(s, field, BYTE_OFFSET); \
 ^
 /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/test...

Read more...

Po-Hsu Lin (cypressyew)
tags: added: sru-20200629
Timo Aaltonen (tjaalton)
Changed in linux-oem-5.6 (Ubuntu):
status: Fix Committed → Won't Fix
status: Won't Fix → Confirmed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

try it with clang-10?

Changed in linux-oem-5.6 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Timo Aaltonen (tjaalton) wrote :
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Test built OK with clang-10, I will see if this change can be applied to all different kernel / arch in Focal

(It's reported that the clang-10 does not work well with s390x https://kernel.ubuntu.com/git/ubuntu/autotest-client-tests.git/commit/?id=95f91d5964229e56faa7034c258e5b36b6c59b17)

Changed in linux-oem-5.6 (Ubuntu):
status: Incomplete → Invalid
Changed in ubuntu-kernel-tests:
assignee: nobody → Po-Hsu Lin (cypressyew)
status: New → In Progress
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

The test_map test build with llvm-10 / clang-10 on Focal s390x zVM will fail with:
  libbpf: Error loading .BTF into kernel: -22.
  libbpf: Error loading BTF: Invalid argument(22)

I think I will need to make exception for 5.6 kernel on Focal.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

yeah, and make it default in groovy and up

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

On Groovy it seems clang was pointed to clang-10, so no further fixes were needed for now.

Changed in ubuntu-kernel-tests:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.