# Cross configuration overrides for `cross build`.
#
# The default `ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main` image is based
# on Ubuntu 20.04 and ships gcc 9.4, which triggers a hard panic in
# `aws-lc-sys` (>=0.30) because gcc 9 has a known memcmp codegen bug:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
#
# Workaround: install gcc-10 inside the image and make it the default
# `cc`/`gcc`/`c++` toolchain so the `cc` build crate (used by `aws-lc-sys`)
# automatically picks it up. The aarch64-gnu and musl images use different
# cross compilers and are not affected.
[]
= [
"apt-get update",
"apt-get install --assume-yes --no-install-recommends gcc-10 g++-10",
"ln -sf /usr/bin/gcc-10 /usr/local/bin/cc",
"ln -sf /usr/bin/gcc-10 /usr/local/bin/gcc",
"ln -sf /usr/bin/g++-10 /usr/local/bin/c++",
"ln -sf /usr/bin/g++-10 /usr/local/bin/g++",
]
# Forward C compiler overrides from the host (set in the workflow) into the
# container so `aws-lc-sys`'s `cc` crate uses gcc-10 regardless of how it
# resolves the compiler binary.
[]
= [
"CC",
"CXX",
"CC_x86_64_unknown_linux_gnu",
"CXX_x86_64_unknown_linux_gnu",
"RUSTFLAGS",
]