Full support for cross building with gcc

Tested with native gcc, clang and cross gcc for arm.