Skip to content

Commit

Permalink
Set Fall Back Arch To The Primary Arch For MIG
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CuriousTommy committed May 8, 2024
1 parent 42203fa commit 0b6b8a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmake/architecture.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ macro(generate_architecture)

if (BUILD_TARGET_64BIT)
set(APPLE_TARGET_TRIPLET_PRIMARY ${APPLE_TARGET_TRIPLET_64BIT})
set(APPLE_ARCH_PRIMARY ${APPLE_ARCH_64BIT})
elseif (BUILD_TARGET_32BIT)
set(APPLE_TARGET_TRIPLET_PRIMARY ${APPLE_TARGET_TRIPLET_32BIT})
set(APPLE_ARCH_PRIMARY ${APPLE_ARCH_32BIT})
else ()
set(APPLE_TARGET_TRIPLET_PRIMARY "")
endif ()
Expand Down
2 changes: 1 addition & 1 deletion cmake/mig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function(mig defFileName)
if (NOT MIG_MULTIARCH)
set(MIG_MULTIARCH_NO_SUFFIX 1)
if (NOT MIG_ARCH)
set(MIG_MULTIARCH "i386")
set(MIG_MULTIARCH "${APPLE_ARCH_PRIMARY}")
else()
set(MIG_MULTIARCH "${MIG_ARCH}")
endif()
Expand Down

0 comments on commit 0b6b8a3

Please sign in to comment.