Checking that the host is macOS is not sufficient here, since the linker is still a GNU linker when cross-compiling for a chip. Instead, use the linker_type variable introduced in the previous commit.