Skip to content

Commit 382eb1f

Browse files
committed
Enable fatal errors by default
Add #![no_builtins] to all test programs; see aya-rs/aya#698 for rationale.
1 parent 92b7410 commit 382eb1f

9 files changed

+20
-6
lines changed

src/bin/bpf-linker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ struct CommandLine {
141141
export: Vec<String>,
142142

143143
/// Whether to treat LLVM errors as fatal.
144-
#[clap(long, action = clap::ArgAction::Set, default_value_t = false)]
144+
#[clap(long, action = clap::ArgAction::Set, default_value_t = true)]
145145
fatal_errors: bool,
146146

147147
// The options below are for wasm-ld compatibility

tests/assembly/auxiliary/dep-section.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// no-prefer-dynamic
22
// compile-flags: --crate-type rlib
3+
#![no_builtins]
4+
#![no_main]
35
#![no_std]
46

57
#[no_mangle]

tests/assembly/auxiliary/dep.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// no-prefer-dynamic
22
// compile-flags: --crate-type rlib
3+
#![no_builtins]
4+
#![no_main]
35
#![no_std]
46

57
#[no_mangle]
68
fn some_dep() -> u8 {
79
42
8-
}
10+
}

tests/assembly/auxiliary/loop-panic-handler.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// no-prefer-dynamic
22
// compile-flags: --crate-type rlib
3+
#![no_builtins]
4+
#![no_main]
35
#![no_std]
46

57
#[panic_handler]
68
fn panic_impl(_: &core::panic::PanicInfo) -> ! {
79
loop {}
810
}
9-

tests/assembly/bin.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
// Same as bpf-sections.rs, but using bin as crate-type.
55

6-
#![no_std]
6+
#![no_builtins]
77
#![no_main]
8+
#![no_std]
89

910
// aux-build: loop-panic-handler.rs
1011
extern crate loop_panic_handler;

tests/assembly/elf-sections.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
// BPF crates export programs (functions) and maps (kernel data structures) through ELF sections.
55
// Verify that the linker correctly outputs those sections.
6+
#![no_builtins]
7+
#![no_main]
68
#![no_std]
79

810
// aux-build: loop-panic-handler.rs
@@ -22,4 +24,4 @@ static mut COUNTER: u32 = 0;
2224

2325
// CHECK: .section "uprobe/connect","ax"
2426
// CHECK: .section "uprobe/dep","ax"
25-
// CHECK: .section "maps/counter","aw"
27+
// CHECK: .section "maps/counter","aw"

tests/assembly/ignore-inline-never.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// assembly-output: bpf-linker
22
// compile-flags: --crate-type cdylib -C link-args=--ignore-inline-never
33
// only-bpfel
4+
#![no_builtins]
5+
#![no_main]
46
#![no_std]
57

68
// Kernels prior to 5.8 (August 2020) don't support function calls. In order to support those

tests/assembly/re-export-symbols.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// assembly-output: bpf-linker
22
// compile-flags: --crate-type cdylib
3+
#![no_builtins]
4+
#![no_main]
35
#![no_std]
46

57
// Check that #[no_mangle] symbols are exported, including those coming from dependency crates.
@@ -15,4 +17,4 @@ fn connect() {
1517
}
1618

1719
// CHECK: .globl connect
18-
// CHECK: .globl some_dep
20+
// CHECK: .globl some_dep

tests/assembly/unroll-loop.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// ignore-test
22
// assembly-output: bpf-linker
33
// compile-flags: --crate-type cdylib -C link-arg=--unroll-loops -C link-arg=-O3
4+
#![no_builtins]
5+
#![no_main]
46
#![no_std]
57
// Recent kernels starting from 5.2 support some bounded loops. Older kernels need all loops to be
68
// unrolled. The linker provides the --unroll-loops flag to aggressively try and unroll.

0 commit comments

Comments
 (0)