[llvm] BPF: Emit an error for illegal LD_imm64 insn when LLVM_ENABLE_ASSERTI… (PR #74035)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 10:24:12 PST 2023


eddyz87 wrote:

Rebuilt everything from scratch using the following commands:

```
$ cmake -S llvm -B build/ -DCMAKE_BUILD_TYPE=Release -G Ninja \
  -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
  -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
  -DLLVM_ENABLE_ASSERTIONS=OFF \
  -DLLVM_ENABLE_ZLIB=ON \
  -DCMAKE_C_COMPILER=/usr/bin/clang \
  -DCMAKE_CXX_COMPILER=/usr/bin/clang++
$ ninja -j14 -C build/
```

Confirmed that assertions are off:

```
$ grep LLVM_ENABLE_ASSERTIONS build/CMakeCache.txt 
LLVM_ENABLE_ASSERTIONS:BOOL=OFF
```

Still no error:

```
$ which clang
/home/eddy/work/llvm-project/build/bin/clang
$ cat test-asm-ll.c 
int foo(void)
{
  asm volatile ("r1 = 10 + w3 ll;");
  return 0;
}
$ clang -O2 --target=bpf -c test-asm-ll.c -o /dev/null
$ echo $?
0
```

Repository state:
```
fc1061e40f73 - (HEAD -> tmp) BPF: Emit an error for illegal LD_imm64 insn when LLVM_ENABLE_ASSERTIONS=OFF (6 hours ago) <Yonghong Song>
248446980317 - (main) Revert "[BPF] Attribute preserve_static_offset for structs" (22 hours ago) <Eduard Zingerman>
e86591b37d4e - [flang] Improve procedure interface compatibility checking for dummy … (#72704) (22 hours ago) <Peter Klausler>
...
```

https://github.com/llvm/llvm-project/pull/74035


More information about the llvm-commits mailing list