tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.85k stars 320 forks source link

compiler_rt: Build arm64 arch when targeting SDK 11.0+ #286

Closed akien-mga closed 3 years ago

akien-mga commented 3 years ago

Fixes #258.

Might be worth adding support for arm64e too but I don't know how to check if clang is Apple Clang (which seems to be the requirement as per https://github.com/tpoechtrager/osxcross#what-is-the-goal-of-osxcross).

Thanks to @etrinh and @ancwrd1 for figuring out the needed flag.

Worth noting that while testing this, I had one occurrence where the cmake build failed because it tried to recreate a symlink which existed already... but then I couldn't reproduce the issue anymore on two new attempts (each time starting from a clean git repo).

tpoechtrager commented 3 years ago

This patch introduces a dependency error while building.

JOBS=1 ./build_compiler_rt.sh # Works
JOBS=2 ./build_compiler_rt.sh # Works
JOBS=6 ./build_compiler_rt.sh # Works
JOBS=8 ./build_compiler_rt.sh # Fails
JOBS=12 ./build_compiler_rt.sh # Fails
akien-mga commented 3 years ago

Yeah I suspect there might be a bug in the CMake scripts which don't support parallel builds properly. Should we go with @etrinh's approach in https://github.com/tpoechtrager/osxcross/issues/258#issuecomment-776608074 to do builds in separate folders for each arch and lipo them?

tpoechtrager commented 3 years ago

Might be the best option for now.