Set Fall Back Arch To The Primary Arch For MIG

I was looking through the build scripts in XNU to see how MIG is being used. While there are some cases where we need to explicitly set the arch to its 32-bit equivalent (ex: i386 instead of x86-64), those situations seem to be the exception rather than the norm.

As a result, I don't think we should be hardcoding i386 as a fallback. We should use the primary architecture instead.
This commit is contained in:
Thomas A. 2024-05-07 18:20:14 -07:00
parent 42203fa265
commit 0b6b8a3e5c
2 changed files with 3 additions and 1 deletions

View File

@ -28,8 +28,10 @@ macro(generate_architecture)
if (BUILD_TARGET_64BIT) if (BUILD_TARGET_64BIT)
set(APPLE_TARGET_TRIPLET_PRIMARY ${APPLE_TARGET_TRIPLET_64BIT}) set(APPLE_TARGET_TRIPLET_PRIMARY ${APPLE_TARGET_TRIPLET_64BIT})
set(APPLE_ARCH_PRIMARY ${APPLE_ARCH_64BIT})
elseif (BUILD_TARGET_32BIT) elseif (BUILD_TARGET_32BIT)
set(APPLE_TARGET_TRIPLET_PRIMARY ${APPLE_TARGET_TRIPLET_32BIT}) set(APPLE_TARGET_TRIPLET_PRIMARY ${APPLE_TARGET_TRIPLET_32BIT})
set(APPLE_ARCH_PRIMARY ${APPLE_ARCH_32BIT})
else () else ()
set(APPLE_TARGET_TRIPLET_PRIMARY "") set(APPLE_TARGET_TRIPLET_PRIMARY "")
endif () endif ()

View File

@ -38,7 +38,7 @@ function(mig defFileName)
if (NOT MIG_MULTIARCH) if (NOT MIG_MULTIARCH)
set(MIG_MULTIARCH_NO_SUFFIX 1) set(MIG_MULTIARCH_NO_SUFFIX 1)
if (NOT MIG_ARCH) if (NOT MIG_ARCH)
set(MIG_MULTIARCH "i386") set(MIG_MULTIARCH "${APPLE_ARCH_PRIMARY}")
else() else()
set(MIG_MULTIARCH "${MIG_ARCH}") set(MIG_MULTIARCH "${MIG_ARCH}")
endif() endif()