diff --git a/Cross.toml b/Cross.toml index 2a7689e..897692b 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,2 +1,16 @@ [build.env] passthrough = ["JEMALLOC_SYS_WITH_LG_PAGE"] + +# The default x86_64-unknown-linux-gnu cross image (Ubuntu 20.04) ships GCC 9.x, +# which is affected by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189 (a memcmp +# miscompilation). aws-lc-sys >= 0.33 hard-panics with "### COMPILER BUG DETECTED ###" +# when it finds this compiler, breaking the build. Install GCC 10 (10.3.0, in the +# "known to work" set) and point gcc/g++/cc at it so every C dependency builds with it. +# aarch64 is unaffected: it's a true cross-compile, so aws-lc-sys can't run its probe +# binary and skips the check entirely. +[target.x86_64-unknown-linux-gnu] +pre-build = [ + "apt-get update && apt-get install --assume-yes gcc-10 g++-10", + "update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10", + "update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100", +]