diff --git a/compiler/rustc_target/src/spec/bpf_base.rs b/compiler/rustc_target/src/spec/bpf_base.rs index f8322567a8d607301528ee2785a16dada9cda008..764cc735d75d1b1d02b75d425b075e8153243e4e 100644 --- a/compiler/rustc_target/src/spec/bpf_base.rs +++ b/compiler/rustc_target/src/spec/bpf_base.rs @@ -12,6 +12,10 @@ pub fn opts(endian: Endian) -> TargetOptions { no_builtins: true, panic_strategy: PanicStrategy::Abort, position_independent_executables: true, + // Disable MergeFunctions since: + // - older kernels don't support bpf-to-bpf calls + // - on newer kernels, userspace still needs to relocate before calling + // BPF_PROG_LOAD and not all BPF libraries do that yet merge_functions: MergeFunctions::Disabled, obj_is_bitcode: true, requires_lto: false, diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 49bbcb4d6129d4aa9b54af49301b5e75ae4d0480..be78b2829fc965a9106313a008bd46e941afa3cb 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -235,8 +235,8 @@ fn run(self, builder: &Builder<'_>) -> PathBuf { let llvm_targets = match &builder.config.llvm_targets { Some(s) => s, None => { - "AArch64;ARM;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;\ - Sparc;SystemZ;WebAssembly;X86;BPF" + "AArch64;ARM;BPF;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;\ + Sparc;SystemZ;WebAssembly;X86" } }; diff --git a/src/doc/unstable-book/src/library-features/asm.md b/src/doc/unstable-book/src/library-features/asm.md index 77080b54dc8f019ae200b481f7344420e9b411cb..03dbf4fb617f4c2fd7f8ed637ed124bc39a788f1 100644 --- a/src/doc/unstable-book/src/library-features/asm.md +++ b/src/doc/unstable-book/src/library-features/asm.md @@ -571,8 +571,8 @@ Here is the list of currently supported register classes: | PowerPC | `reg_nonzero` | | `r[1-31]` | `b` | | PowerPC | `freg` | `f[0-31]` | `f` | | wasm32 | `local` | None\* | `r` | -| BPF | `reg` | `r[0-10]` | `r`| -| BPF | `wreg` | `w[0-10]` | `w`| +| BPF | `reg` | `r[0-10]` | `r` | +| BPF | `wreg` | `w[0-10]` | `w` | > **Note**: On x86 we treat `reg_byte` differently from `reg` because the compiler can allocate `al` and `ah` separately whereas `reg` reserves the whole register. > @@ -619,7 +619,7 @@ Each register class has constraints on which value types they can be used with. | PowerPC | `freg` | None | `f32`, `f64` | | wasm32 | `local` | None | `i8` `i16` `i32` `i64` `f32` `f64` | | BPF | `reg` | None | `i8` `i16` `i32` `i64` | -| BPF | `wreg` | `alu32` | `i8` `i16` `i32`| +| BPF | `wreg` | `alu32` | `i8` `i16` `i32` | > **Note**: For the purposes of the above table pointers, function pointers and `isize`/`usize` are treated as the equivalent integer type (`i16`/`i32`/`i64` depending on the target). diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index f5095486d1a79bf799cec25d85307dba7987b08b..e3e5489403812f3757b8a9425aa3fcf8150674fd 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2311,10 +2311,6 @@ fn compile_test_and_save_assembly(&self) -> (ProcRes, PathBuf) { // No extra flags needed. } - Some("bpf-linker") => { - rustc.arg("-Clink-args=--emit=asm"); - } - Some(_) => self.fatal("unknown 'assembly-output' header"), None => self.fatal("missing 'assembly-output' header"), } diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs index 238f4f7ae66588f60912f5495159b7e8eb4f0892..37164c4e5752a26aeb2e837a95a74c077d1b9bed 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -48,8 +48,8 @@ ("armv7s", "arm"), ("asmjs", "asmjs"), ("avr", "avr"), - ("bpfeb", "bpfeb"), - ("bpfel", "bpfel"), + ("bpfeb", "bpf"), + ("bpfel", "bpf"), ("hexagon", "hexagon"), ("i386", "x86"), ("i586", "x86"),