Commit c9b3ded
authored
Enable BPF target in LLVM backend by default (#85630)
Adding the BPF target to the LLVM backend, allows eBPF programs to be
built using the clang that ships with the OSS toolchains.
Should be a low-risk change, which I've tested locally by explicitly
specifying the `--llvm-targets-to-build` flag:
```console
% build/Ninja-ReleaseAssert/llvm-linux-aarch64/bin/clang -print-targets | grep bpf
bpf - BPF (host endian)
bpfeb - BPF (big endian)
bpfel - BPF (little endian)
% touch empty.c
% build/Ninja-ReleaseAssert/llvm-linux-aarch64/bin/clang -target bpf -c empty.c -o empty.o
% file empty.o
empty.o: ELF 64-bit LSB relocatable, eBPF, version 1 (SYSV), not stripped
```
Looks like a negligible increase in build time vs previous PR toolchain
builds:
| Job | Build script analyzer total | LLVM time (sec) |
|----------------------|-----------------------------|-------------------|
| #1584 (this PR)[^0] | 2hr 21m 53s | 1178.85 |
| #1583 (previous)[^1] | 2hr 22m 8s | 1171.51 |
| ...failed runs... | ...failed runs... | ...failed runs... |
| #1578 (previous)[^2] | 2hr 22m 40s | 1171.47 |
| #1577 (previous)[^3] | 2hr 21m 48s | 1168.54 |
| #1576 (previous)[^4] | 2hr 20m 39s | 1174.80 |
And an increased of size comparison of PR toolchain(s) vs last nightly
main, it
looks like it's gone up a bit, but not by this PR:
| PR | `stat -c %s` | Link |
|-------------|--------------|----------------------------------------------------------------|
| — | 1187466342 |
swift-DEVELOPMENT-SNAPSHOT-2025-08-27-a-ubuntu20.04.tar.gz[^5] |
| This PR | 1212116532 |
pull-request/85630/1584/ubuntu2204/PR-ubuntu2204.tar.gz[^6] |
| Previous PR | 1213404191 |
pull-request/85358/1583/ubuntu2204/PR-ubuntu2204.tar.gz[^7] |
| Previous PR | 1213116282 |
pull-request/79684/1578/ubuntu2204/PR-ubuntu2204.tar.gz[^8] |
[^0]: https://ci.swift.org/job/swift-PR-toolchain-Linux/1584/consoleText
[^1]: https://ci.swift.org/job/swift-PR-toolchain-Linux/1583/consoleText
[^2]: https://ci.swift.org/job/swift-PR-toolchain-Linux/1578/consoleText
[^3]: https://ci.swift.org/job/swift-PR-toolchain-Linux/1577/consoleText
[^4]: https://ci.swift.org/job/swift-PR-toolchain-Linux/1576/consoleText
[^5]:
https://download.swift.org/development/ubuntu2004/swift-DEVELOPMENT-SNAPSHOT-2025-08-27-a/swift-DEVELOPMENT-SNAPSHOT-2025-08-27-a-ubuntu20.04.tar.gz
[^6]:
https://download.swift.org/tmp/pull-request/85630/1584/ubuntu2204/PR-ubuntu2204.tar.gz
[^7]:
https://download.swift.org/tmp/pull-request/85358/1583/ubuntu2204/PR-ubuntu2204.tar.gz
[^8]:
https://download.swift.org/tmp/pull-request/79684/1578/ubuntu2204/PR-ubuntu2204.tar.gz1 parent 90e1214 commit c9b3ded
File tree
2 files changed
+2
-2
lines changed- utils/build_swift
- build_swift
- tests
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
1454 | | - | |
| 1454 | + | |
1455 | 1455 | | |
1456 | 1456 | | |
1457 | 1457 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| |||
0 commit comments