The first step in getting GCC BPF arena support is enabling the GCC style btf tags in the kernel which currently only supports the clang builds (which in kernel speak is: enabling CONFIG_PAHOLE_HAS_BTF_TAG for CC_IS_GCC).
Currently an x86 defconfig spews out over ~60k instances of: warning: 'btf_type_tag' attribute does not apply to functions when one is enough to break a -Werror build. And warnings are just the symptoms of the root-cause that those tags are dropped which the series addresses: - 1/2: debug/128479: tagged function pointers - 2/2: debug/125991: functions returning a tagged pointer With these all the warnings above are gone, and tags are retained: BTF going from 810 TYPE_TAG records to 849 (percpu 127 -> 141, rcu 259 -> 282, user 423 -> 425). Note: 1. Patch 2 was posted before, as patch 3 of "[PATCH 0/3] btf_type_tag updates" https://inbox.sourceware.org/gcc-patches/[email protected]/ The other two patches of that series have been split out by scope and are a separate posting, which applies on top of this one. 2. This series applies on top of dwarf: do not clone a typedef for a tagged use of it [PR128441] https://inbox.sourceware.org/gcc-patches/[email protected]/ Bootstrapped and regression tested on x86_64-pc-linux-gnu. stage2 and stage3 compare successfully, with no new FAILs and 32 new PASSes. Vineet Gupta (2): c-family, dwarf: record a btf_type_tag on a pointed-to function [PR128479] c-family: handle btf_type_tag for function returning pointer [PR125991] gcc/c-family/c-attribs.cc | 28 ++++++++++++++-- gcc/doc/extend.texi | 4 +++ gcc/dwarf2out.cc | 13 ++++++++ gcc/testsuite/gcc.dg/attr-btf-type-tag-3.c | 9 +++--- .../gcc.dg/debug/btf/btf-type-tag-10.c | 14 ++++++++ .../gcc.dg/debug/btf/btf-type-tag-11.c | 16 ++++++++++ .../gcc.dg/debug/btf/btf-type-tag-12.c | 19 +++++++++++ .../gcc.dg/debug/btf/btf-type-tag-13.c | 12 +++++++ .../gcc.dg/debug/btf/btf-type-tag-14.c | 32 +++++++++++++++++++ .../gcc.dg/debug/btf/btf-type-tag-9.c | 16 ++++++++++ .../gcc.dg/debug/btf/btf-type-tag-c2x-2.c | 26 +++++++++++++++ .../debug/dwarf2/btf-type-tag-fnptr-1.c | 23 +++++++++++++ 12 files changed, 206 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-type-tag-10.c create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-type-tag-11.c create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-type-tag-12.c create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-type-tag-13.c create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-type-tag-14.c create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-type-tag-9.c create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-type-tag-c2x-2.c create mode 100644 gcc/testsuite/gcc.dg/debug/dwarf2/btf-type-tag-fnptr-1.c -- 2.53.0-Meta
