Skip to content

Commit

Permalink
BPF: misc minor review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrod committed May 29, 2021
1 parent bd8e5ce commit ab93a13
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_target/src/spec/bpf_base.rs
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/native.rs
Expand Up @@ -235,8 +235,8 @@ impl Step for Llvm {
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"
}
};

Expand Down
6 changes: 3 additions & 3 deletions src/doc/unstable-book/src/library-features/asm.md
Expand Up @@ -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.
>
Expand Down Expand Up @@ -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).
Expand Down
4 changes: 0 additions & 4 deletions src/tools/compiletest/src/runtest.rs
Expand Up @@ -2311,10 +2311,6 @@ impl<'test> TestCx<'test> {
// 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"),
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/util.rs
Expand Up @@ -48,8 +48,8 @@ const ARCH_TABLE: &[(&str, &str)] = &[
("armv7s", "arm"),
("asmjs", "asmjs"),
("avr", "avr"),
("bpfeb", "bpfeb"),
("bpfel", "bpfel"),
("bpfeb", "bpf"),
("bpfel", "bpf"),
("hexagon", "hexagon"),
("i386", "x86"),
("i586", "x86"),
Expand Down

0 comments on commit ab93a13

Please sign in to comment.