When running in a nix shell for an old toolchain, e.g. ci_gcc48 for gcc-4.8.5, one still falls back to the native binutils, including as. This can lead to confusing results such as the following:
$ (echo "eor3 v0.16b, v1.16b, v2.16b, v3.16b" | gcc -march=armv8.4-a+sha3 -x assembler - -c -o test.o) && echo "SUCCESS" || echo "FAIL"
SUCCESS
$ (echo "int main(void) { return 0; }" | gcc -march=armv8.4-a+sha3 -x c - -c -o test.o) && echo "SUCCESS" || echo "FAIL"
<stdin>:1:0: error: unknown value ‘armv8.4-a+sha3’ for -march
FAIL
Here, gcc -x assembler falls back to as which is actually the host as, which is newer than the gcc installed through nix.
We should consider bundling gcc versions with somewhat contemporaneous binutils versions.