]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gcc/gcc-command-options/machine-dependent-options/ebpf-options.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gcc / gcc-command-options / machine-dependent-options / ebpf-options.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. program:: eBPF
7
8 .. index:: eBPF Options
9
10 .. _ebpf-options:
11
12 eBPF Options
13 ^^^^^^^^^^^^
14
15 .. index:: eBPF Options
16
17 .. option:: -mframe-limit=bytes
18
19 This specifies the hard limit for frame sizes, in bytes. Currently,
20 the value that can be specified should be less than or equal to
21 :samp:`32767`. Defaults to whatever limit is imposed by the version of
22 the Linux kernel targeted.
23
24 .. option:: -mkernel={version}
25
26 This specifies the minimum version of the kernel that will run the
27 compiled program. GCC uses this version to determine which
28 instructions to use, what kernel helpers to allow, etc. Currently,
29 :samp:`{version}` can be one of :samp:`4.0`, :samp:`4.1`, :samp:`4.2`,
30 :samp:`4.3`, :samp:`4.4`, :samp:`4.5`, :samp:`4.6`, :samp:`4.7`,
31 :samp:`4.8`, :samp:`4.9`, :samp:`4.10`, :samp:`4.11`, :samp:`4.12`,
32 :samp:`4.13`, :samp:`4.14`, :samp:`4.15`, :samp:`4.16`, :samp:`4.17`,
33 :samp:`4.18`, :samp:`4.19`, :samp:`4.20`, :samp:`5.0`, :samp:`5.1`,
34 :samp:`5.2`, :samp:`latest` and :samp:`native`.
35
36 .. option:: -mbig-endian
37
38 Generate code for a big-endian target.
39
40 .. option:: -mlittle-endian
41
42 Generate code for a little-endian target. This is the default.
43
44 .. option:: -mjmpext
45
46 Enable generation of extra conditional-branch instructions.
47 Enabled for CPU v2 and above.
48
49 .. option:: -mjmp32
50
51 Enable 32-bit jump instructions. Enabled for CPU v3 and above.
52
53 .. option:: -malu32
54
55 Enable 32-bit ALU instructions. Enabled for CPU v3 and above.
56
57 .. option:: -mcpu={version}
58
59 This specifies which version of the eBPF ISA to target. Newer versions
60 may not be supported by all kernels. The default is :samp:`v3`.
61
62 Supported values for :samp:`{version}` are:
63
64 :samp:`v1`
65 The first stable eBPF ISA with no special features or extensions.
66
67 :samp:`v2`
68 Supports the jump extensions, as in :option:`-mjmpext`.
69
70 :samp:`v3`
71 All features of v2, plus:
72
73 * 32-bit jump operations, as in :option:`-mjmp32`
74
75 * 32-bit ALU operations, as in :option:`-malu32`
76
77 .. option:: -mco-re
78
79 Enable BPF Compile Once - Run Everywhere (CO-RE) support. Requires and
80 is implied by :option:`-gbtf`.
81
82 .. option:: -mno-co-re
83
84 Disable BPF Compile Once - Run Everywhere (CO-RE) support. BPF CO-RE
85 support is enabled by default when generating BTF debug information for
86 the BPF target.
87
88 .. option:: -mxbpf
89
90 Generate code for an expanded version of BPF, which relaxes some of
91 the restrictions imposed by the BPF architecture:
92
93 * Save and restore callee-saved registers at function entry and
94 exit, respectively.