mirror of
https://github.com/cloudflare/quiche.git
synced 2026-10-02 04:54:38 +08:00
BoringSSL's x86 assembly requires SSE2. boring-sys normally supplies the necessary flags only when the host and target differ, but the cross i686 image is 32-bit native. Add target-scoped CFLAGS and CXXFLAGS passthrough entries so the flags reach the BoringSSL build. These flags work with both boring 4 and 5, so the preparation can land before the dependency upgrade.
42 lines
1.9 KiB
TOML
42 lines
1.9 KiB
TOML
# Use `cross`'s `edge` images instead of the default `latest` (pinned to
|
|
# cross 0.2.5, published 2022). The stock `latest` images for these
|
|
# targets ship pre-C++17 g++ toolchains, which can't build BoringSSL 5.x
|
|
# (it requires C++17 headers like `<string_view>`). The `edge` images
|
|
# are rebuilt regularly from cross's `main` branch and carry a newer
|
|
# toolchain.
|
|
|
|
[target.aarch64-unknown-linux-gnu]
|
|
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge"
|
|
|
|
[target.armv7-unknown-linux-gnueabihf]
|
|
image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:edge"
|
|
|
|
# The `edge` image for i686 is a 32-bit-native userspace and ships only
|
|
# the unprefixed `gcc`/`g++` toolchain. We need:
|
|
# - 32-bit dev libraries (`Scrt1.o`, `crti.o`, etc.) so cmake's
|
|
# compiler-detection probe can link a trivial test program.
|
|
# - Symlinks for `i686-linux-gnu-{gcc,g++}` so `cross` (which sets
|
|
# `linker=i686-linux-gnu-gcc`) and `cc-rs`-based crates (e.g.,
|
|
# `ring`) can find a compiler under the cross-prefixed names they
|
|
# expect.
|
|
[target.i686-unknown-linux-gnu]
|
|
image = "ghcr.io/cross-rs/i686-unknown-linux-gnu:edge"
|
|
pre-build = [
|
|
"dpkg --add-architecture i386",
|
|
"apt-get update && apt-get install --assume-yes libc6-dev-i386 g++-multilib",
|
|
"ln -sf /usr/bin/gcc /usr/local/bin/i686-linux-gnu-gcc",
|
|
"ln -sf /usr/bin/g++ /usr/local/bin/i686-linux-gnu-g++",
|
|
]
|
|
|
|
# BoringSSL's x86 assembly requires SSE2. `boring-sys`'s cmake build
|
|
# doesn't add `-msse2` for i686 targets (its 32-bit-toolchain.cmake
|
|
# sets it as a CACHE STRING, but cmake-rs's `-DCMAKE_C_FLAGS=...` on
|
|
# the command line wins), so inject it via the target-scoped
|
|
# `CFLAGS`/`CXXFLAGS` env vars. `cc-rs` (and through it, `cmake-rs`)
|
|
# honors these and passes them along to BoringSSL's cmake build.
|
|
[target.i686-unknown-linux-gnu.env]
|
|
passthrough = [
|
|
"CFLAGS_i686_unknown_linux_gnu=-msse2 -mfpmath=sse",
|
|
"CXXFLAGS_i686_unknown_linux_gnu=-msse2 -mfpmath=sse",
|
|
]
|