gfortran -cpp on aarch64 Linux may not define __aarch64__, so the
Fortran struct stat layout fix doesn't take effect. Instead, detect
aarch64 in Makefile via uname -m and pass -DUSE_C_STAT. File test
functions use C helpers that get correct struct stat from system headers.
x86_64 and macOS paths unchanged.
macOS ships bash 3.2 which lacks assoc arrays, case transforms, declare -g,
coproc, etc. Tests compared against bash 3.2 produced false failures. All test
files now use BASH_REF (defaults to bash) so CI can point to a modern bash.