tpoechtrager / osxcross

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

Add support for 11.1 SDK #251

Closed flibitijibibo closed 3 years ago

flibitijibibo commented 3 years ago

Looks like Apple is moving to the iOS/tvOS numbering system where the minor releases get the second digit rather than the third - Xcode 12.3 includes support for macOS "11.1". It's an easy fix locally but I wasn't sure if we should be looking for 11.* or 11.1.* for the SDK check in build.sh.

flibitijibibo commented 3 years ago

Blech, turns out this wasn't actually simple at all. The version scheme change is a huge pain! This is my final working diff for 11.1:

diff --git a/build.sh b/build.sh
index a5a1aa3..73541a8 100755
--- a/build.sh
+++ b/build.sh
@@ -41,6 +41,7 @@ case $SDK_VERSION in
   10.15*) TARGET=darwin19; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; ARM_SUPPORTED=0; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9;  ;;
   10.16*) TARGET=darwin20; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; ARM_SUPPORTED=1; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9;  ;;
   11.0*)  TARGET=darwin20; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; ARM_SUPPORTED=1; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9;  ;;
+  11.1*)  TARGET=darwin21; X86_64H_SUPPORTED=1; I386_SUPPORTED=0; ARM_SUPPORTED=1; NEED_TAPI_SUPPORT=1; OSX_VERSION_MIN_INT=10.9;  ;;
  *) echo "Unsupported SDK"; exit 1 ;;
 esac
flibitijibibo commented 3 years ago

Right, after compiling Clang/LLVM 10 I got it to work with the above diff... using darwin21 seems very horribly wrong though?

tpoechtrager commented 3 years ago

I am not sure either whether it's darwin21 or darwin20.1. Maybe someone could enlighten me?

flibitijibibo commented 3 years ago

Looks like it's actually 20.2 :headdesk:

https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history

Unrelated: I'm working on compiler-rt and it looks like Clang 10 is not up to the task for arm64:

https://trac.macports.org/ticket/61555

Checking out Clang 11 now. EDIT: Clang 11 works fine with the 11.1 SDK and compiler-rt successfully builds.

tpoechtrager commented 3 years ago

I added support for the 11.1 SDK. I hope I did it the correct way...