fix libffi sanity check for GCC-based toolchains