This PR is:
Qt relies on the __MAC_OS_X_VERSION_MIN_REQUIRED macro, which is set in the AvailabilityInternal.h SDK header to
the value provided by the Clang driver from the -mmacos-version-min / -mmacosx-version-min option.
Xcode 12 SDK expects the OS-specific __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro:
0#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
1    #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
2        /* compiler for Mac OS X sets __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ */
3        #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
4    #endif
5#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED*/
In the other hand, Xcode 15 SDK expects a general __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ macro:
 0#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
 1    #if defined(__has_builtin) && __has_builtin(__is_target_os)
 2        #if __is_target_os(macos)
 3            #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
 4            #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
 5        #endif
 6    #elif  __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 
 7        #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
 8        #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
 9    #endif /*  __has_builtin(__is_target_os) && __is_target_os(macos) */
10#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
The latter macro is not provided by LLVM Clang until https://github.com/llvm/llvm-project/commit/c8e2dd8c6f490b68e41fe663b44535a8a21dfeab, which is available in Clang 17.
The suggested patch makes Qt “borrow” the __MAC_OS_X_VERSION_MIN_REQUIRED value from MAC_OS_X_VERSION_MIN_REQUIRED, which is set in the AvailabilityMacros.h SDK header.