提交 ab93a139 编写于 作者: A Alessandro Decina

BPF: misc minor review fixes

上级 bd8e5ce4
......@@ -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,
......
......@@ -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"
}
};
......
......@@ -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).
......
......@@ -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"),
}
......
......@@ -48,8 +48,8 @@
("armv7s", "arm"),
("asmjs", "asmjs"),
("avr", "avr"),
("bpfeb", "bpfeb"),
("bpfel", "bpfel"),
("bpfeb", "bpf"),
("bpfel", "bpf"),
("hexagon", "hexagon"),
("i386", "x86"),
("i586", "x86"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册