Fix cross-compilation on Linux and non-Linux platforms.