bpf: Add new -mco-re option for BPF CO-RE
authorIndu Bhagat <indu.bhagat@oracle.com>
Tue, 7 Sep 2021 18:17:55 +0000 (11:17 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Tue, 7 Sep 2021 18:17:55 +0000 (11:17 -0700)
commite29a9607faae320a92f19b38f0424037ac3bdbfe
tree3e4433186b815b1871bd32d72dc1de30052f549a
parent053db9a49b00d422cd735bee4c0939b7ff07c40e
bpf: Add new -mco-re option for BPF CO-RE

-mco-re in the BPF backend enables code generation for the CO-RE usecase. LTO is
disabled for CO-RE compilations.

gcc/ChangeLog:

* config/bpf/bpf.c (bpf_option_override): For BPF backend, disable LTO
support when compiling for CO-RE.
* config/bpf/bpf.opt: Add new command line option -mco-re.

gcc/testsuite/ChangeLog:

* gcc.target/bpf/core-lto-1.c: New test.
gcc/config/bpf/bpf.c
gcc/config/bpf/bpf.opt
gcc/testsuite/gcc.target/bpf/core-lto-1.c [new file with mode: 0644]