3.19.13 eBPF Options

-mframe-limit=bytes

This specifies the hard limit for frame sizes, in bytes. Currently, the value that can be specified should be less than or equal to ‘32767’. Defaults to whatever limit is imposed by the version of the Linux kernel targeted.

-mbig-endian

Generate code for a big-endian target.

-mlittle-endian

Generate code for a little-endian target. This is the default.

-mjmpext
-mno-jmpext

Enable or disable generation of extra conditional-branch instructions. Enabled for CPU v2 and above.

-mjmp32
-mno-jmp32

Enable or disable generation of 32-bit jump instructions. Enabled for CPU v3 and above.

-malu32
-mno-alu32

Enable or disable generation of 32-bit ALU instructions. Enabled for CPU v3 and above.

-mv3-atomics
-mno-v3-atomics

Enable or disable instructions for general atomic operations introduced in CPU v3. Enabled for CPU v3 and above.

-mbswap
-mno-bswap

Enable or disable byte swap instructions. Enabled for CPU v4 and above.

-msdiv
-mno-sdiv

Enable or disable signed division and modulus instructions. Enabled for CPU v4 and above.

-msmov
-mno-smov

Enable or disable sign-extending move and memory load instructions. Enabled for CPU v4 and above.

-mcpu=version

This specifies which version of the eBPF ISA to target. Newer versions may not be supported by all kernels. The default is ‘v4’.

Supported values for version are:

v1

The first stable eBPF ISA with no special features or extensions.

v2

Supports the jump extensions, as in -mjmpext.

v3

All features of v2, plus:

  • 32-bit jump operations, as in -mjmp32
  • 32-bit ALU operations, as in -malu32
  • general atomic operations, as in -mv3-atomics
v4

All features of v3, plus:

  • Byte swap instructions, as in -mbswap
  • Signed division and modulus instructions, as in -msdiv
  • Sign-extending move and memory load instructions, as in -msmov
-mco-re

Enable BPF Compile Once - Run Everywhere (CO-RE) support. Requires and is implied by -gbtf.

-mno-co-re

Disable BPF Compile Once - Run Everywhere (CO-RE) support. BPF CO-RE support is enabled by default when generating BTF debug information for the BPF target.

-mxbpf

Generate code for an expanded version of BPF, which relaxes some of the restrictions imposed by the BPF architecture:

  • Save and restore callee-saved registers at function entry and exit, respectively.
-masm=dialect

Outputs assembly instructions using eBPF selected dialect. The default is ‘pseudoc’.

Supported values for dialect are:

normal

Outputs normal assembly dialect.

pseudoc

Outputs pseudo-c assembly dialect.

-minline-memops-threshold=bytes

Specifies a size threshold in bytes at or below which memmove, memcpy and memset shall always be expanded inline. Operations dealing with sizes larger than this threshold would have to be implemented using a library call instead of being expanded inline, but since BPF doesn’t allow libcalls, exceeding this threshold results in a compile-time error. The default is ‘1024’ bytes.