From db4b7179ed83cedd87e5b79ef39e93a7b108238f Mon Sep 17 00:00:00 2001 From: Cupertino Miranda Date: Thu, 8 Dec 2022 00:04:30 +0000 Subject: [PATCH] Add BPF architecture target support BPF is a virtual machine and associated ISA that resides in the Linux kernel. Initially intended for user-level packet capture and filtering, BPF is nowadays generalized to serve as a general-purpose infrastructure also for non-networking purposes. Signed-off-by: Cupertino Miranda --- config/arch/bpf.in | 9 +++++++++ samples/bpf-unknown-none/crosstool.config | 11 +++++++++++ samples/bpf-unknown-none/reported.by | 3 +++ scripts/build/arch/bpf.sh | 7 +++++++ 4 files changed, 30 insertions(+) create mode 100644 config/arch/bpf.in create mode 100644 samples/bpf-unknown-none/crosstool.config create mode 100644 samples/bpf-unknown-none/reported.by create mode 100644 scripts/build/arch/bpf.sh diff --git a/config/arch/bpf.in b/config/arch/bpf.in new file mode 100644 index 00000000..9d0d7373 --- /dev/null +++ b/config/arch/bpf.in @@ -0,0 +1,9 @@ +# BPF specific configuration file + +## no-package +## select ARCH_SUPPORTS_EITHER_ENDIAN +## select ARCH_DEFAULT_LE +## select GCC_VERY_NEW +## select BINUTILS_VERY_NEW +## +## help The BPF architecture. diff --git a/samples/bpf-unknown-none/crosstool.config b/samples/bpf-unknown-none/crosstool.config new file mode 100644 index 00000000..383f75d6 --- /dev/null +++ b/samples/bpf-unknown-none/crosstool.config @@ -0,0 +1,11 @@ +CT_CONFIG_VERSION="4" +CT_ARCH_BPF=y +CT_MULTILIB=n +CT_TARGET_VENDOR="unknown" +CT_TARGET_SYS=none +CT_TARGET_ALIAS="bpf-unknown" +CT_GCC_SRC_DEVEL=y +CT_GCC_DEVEL_BRANCH="master" +CT_BINUTILS_SRC_DEVEL=y +CT_BINUTILS_DEVEL_BRANCH="master" +CT_LIBC_NONE=y diff --git a/samples/bpf-unknown-none/reported.by b/samples/bpf-unknown-none/reported.by new file mode 100644 index 00000000..1b18dcb4 --- /dev/null +++ b/samples/bpf-unknown-none/reported.by @@ -0,0 +1,3 @@ +reporter_name="Cupertino Miranda" +reporter_url="" +reporter_comment="BPF toolchain" diff --git a/scripts/build/arch/bpf.sh b/scripts/build/arch/bpf.sh new file mode 100644 index 00000000..de427283 --- /dev/null +++ b/scripts/build/arch/bpf.sh @@ -0,0 +1,7 @@ +# Compute BPF-specific values + +CT_DoArchTupleValues() { + CT_TARGET_ARCH=bpf + CT_TARGET_VENDOR=unknown + CT_TARGET_SYS=none +}