summaryrefslogtreecommitdiff
path: root/Documentation/bpf
diff options
context:
space:
mode:
authorCupertino Miranda <cupertino.miranda@oracle.com>2024-02-13 20:35:43 +0300
committerAndrii Nakryiko <andrii@kernel.org>2024-02-13 22:28:12 +0300
commit12bbcf8e840f40b82b02981e96e0a5fbb0703ea9 (patch)
tree9238bb36e780acb761de92836f81c420f941aeb8 /Documentation/bpf
parent52dbd67dff5d050e99301100e2cac578eef9b2e9 (diff)
downloadlinux-12bbcf8e840f40b82b02981e96e0a5fbb0703ea9.tar.xz
libbpf: Add support to GCC in CORE macro definitions
Due to internal differences between LLVM and GCC the current implementation for the CO-RE macros does not fit GCC parser, as it will optimize those expressions even before those would be accessible by the BPF backend. As examples, the following would be optimized out with the original definitions: - As enums are converted to their integer representation during parsing, the IR would not know how to distinguish an integer constant from an actual enum value. - Types need to be kept as temporary variables, as the existing type casts of the 0 address (as expanded for LLVM), are optimized away by the GCC C parser, never really reaching GCCs IR. Although, the macros appear to add extra complexity, the expanded code is removed from the compilation flow very early in the compilation process, not really affecting the quality of the generated assembly. Signed-off-by: Cupertino Miranda <cupertino.miranda@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20240213173543.1397708-1-cupertino.miranda@oracle.com
Diffstat (limited to 'Documentation/bpf')
0 files changed, 0 insertions, 0 deletions