rustc default compiler optimization level is O3. This change removes the option that overrides the default optimization level, because it is safe to do so. The code generation is incorrect in some cases because of link-time optimizations, which remain disabled for compiling BPF programs. In addition, this commit updates the expected instruction counts for assert_instruction_count test.
19 lines
509 B
Bash
19 lines
509 B
Bash
#
|
|
# Configures the BPF SDK environment
|
|
#
|
|
|
|
if [ -z "$bpf_sdk" ]; then
|
|
bpf_sdk=.
|
|
fi
|
|
|
|
# Ensure the sdk is installed
|
|
"$bpf_sdk"/scripts/install.sh
|
|
|
|
# Use the SDK's version of llvm to build the compiler-builtins for BPF
|
|
export CC="$bpf_sdk/dependencies/bpf-tools/llvm/bin/clang"
|
|
export AR="$bpf_sdk/dependencies/bpf-tools/llvm/bin/llvm-ar"
|
|
export OBJDUMP="$bpf_sdk/dependencies/bpf-tools/llvm/bin/llvm-objdump"
|
|
export OBJCOPY="$bpf_sdk/dependencies/bpf-tools/llvm/bin/llvm-objcopy"
|
|
|
|
export RUSTFLAGS="-C lto=no"
|