]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Disable SEC pragma macro on GCC
authorJames Hilliard <james.hilliard1@gmail.com>
Wed, 6 Jul 2022 11:18:38 +0000 (05:18 -0600)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 8 Jul 2022 22:11:34 +0000 (15:11 -0700)
commit5fe2b6db4a60ba663723a2974ec9679a14dd33b7
tree2a64b1d5bc1baa1a6a1918814df997de2157d558
parent3ba52a597a37df247707d082ab6c9a64d6d9530b
libbpf: Disable SEC pragma macro on GCC

It seems the gcc preprocessor breaks with pragmas when surrounding
__attribute__.

Disable these pragmas on GCC due to upstream bugs see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90400

Fixes errors like:
error: expected identifier or '(' before '#pragma'
  106 | SEC("cgroup/bind6")
      | ^~~

error: expected '=', ',', ';', 'asm' or '__attribute__' before '#pragma'
  114 | char _license[] SEC("license") = "GPL";
      | ^~~

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220706111839.1247911-1-james.hilliard1@gmail.com
tools/lib/bpf/bpf_helpers.h