diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index c7a38c3eee8294..506211704068aa 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -443,13 +443,7 @@ else() endif(CLR_CMAKE_TARGET_UNIX) # check if host & target os/arch combination are valid -if (CLR_CMAKE_TARGET_OS STREQUAL CLR_CMAKE_HOST_OS) - if(NOT(CLR_CMAKE_TARGET_ARCH STREQUAL CLR_CMAKE_HOST_ARCH)) - if(NOT((CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM64) OR (CLR_CMAKE_HOST_ARCH_I386 AND CLR_CMAKE_TARGET_ARCH_ARM) OR (CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM) OR (CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_I386))) - message(FATAL_ERROR "Invalid platform and target arch combination TARGET_ARCH=${CLR_CMAKE_TARGET_ARCH} HOST_ARCH=${CLR_CMAKE_HOST_ARCH}") - endif() - endif() -else() +if (NOT (CLR_CMAKE_TARGET_OS STREQUAL CLR_CMAKE_HOST_OS)) if(NOT (CLR_CMAKE_HOST_OS STREQUAL windows)) message(FATAL_ERROR "Invalid host and target os/arch combination. Host OS: ${CLR_CMAKE_HOST_OS}") endif() diff --git a/src/coreclr/pal/inc/pal.h b/src/coreclr/pal/inc/pal.h index f58c854487128a..d2b5e1591a6cca 100644 --- a/src/coreclr/pal/inc/pal.h +++ b/src/coreclr/pal/inc/pal.h @@ -2623,7 +2623,7 @@ PALIMPORT BOOL PALAPI PAL_GetUnwindInfoSize(SIZE_T baseAddress, ULONG64 ehFrameH #if defined(__APPLE__) && defined(__i386__) #define PAL_CS_NATIVE_DATA_SIZE 76 -#elif defined(__APPLE__) && defined(__x86_64__) +#elif defined(__APPLE__) && defined(HOST_AMD64) #define PAL_CS_NATIVE_DATA_SIZE 120 #elif defined(__APPLE__) && defined(HOST_ARM64) #define PAL_CS_NATIVE_DATA_SIZE 120 @@ -4530,12 +4530,14 @@ void _mm_setcsr(unsigned int i); #ifdef __cplusplus +#if defined(HOST_ARM64) && defined(TARGET_ARM64) class CORJIT_FLAGS; PALIMPORT VOID PALAPI PAL_GetJitCpuCapabilityFlags(CORJIT_FLAGS *flags); +#endif // HOST_ARM64 && TARGET_ARM64 #endif diff --git a/src/coreclr/pal/src/exception/seh-unwind.cpp b/src/coreclr/pal/src/exception/seh-unwind.cpp index f718be6af54c27..3cfc4a0985d5b2 100644 --- a/src/coreclr/pal/src/exception/seh-unwind.cpp +++ b/src/coreclr/pal/src/exception/seh-unwind.cpp @@ -54,7 +54,7 @@ Module Name: #endif // HOST_UNIX -#if defined(TARGET_OSX) && defined(TARGET_ARM64) +#if defined(TARGET_OSX) && defined(HOST_ARM64) // MacOS uses ARM64 instead of AARCH64 to describe these registers // Create aliases to reuse more code enum @@ -96,7 +96,7 @@ enum UNW_AARCH64_V30 = UNW_ARM64_D30, UNW_AARCH64_V31 = UNW_ARM64_D31 }; -#endif // defined(TARGET_OSX) && defined(TARGET_ARM64) +#endif // defined(TARGET_OSX) && defined(HOST_ARM64) //---------------------------------------------------------------------- diff --git a/src/coreclr/pal/src/misc/jitsupport.cpp b/src/coreclr/pal/src/misc/jitsupport.cpp index 209b36590837a8..f7ca5c36e71217 100644 --- a/src/coreclr/pal/src/misc/jitsupport.cpp +++ b/src/coreclr/pal/src/misc/jitsupport.cpp @@ -148,6 +148,7 @@ static unsigned long GetCpuCapabilityFlagsFromCpuInfo() } #endif // defined(HOST_ARM64) && defined(__linux__) +#if defined(HOST_ARM64) && defined(TARGET_ARM64) PALIMPORT VOID PALAPI @@ -155,7 +156,6 @@ PAL_GetJitCpuCapabilityFlags(CORJIT_FLAGS *flags) { _ASSERTE(flags); -#if defined(HOST_ARM64) #if HAVE_AUXV_HWCAP_H unsigned long hwCap = getauxval(AT_HWCAP); @@ -294,10 +294,5 @@ PAL_GetJitCpuCapabilityFlags(CORJIT_FLAGS *flags) flags->Set(InstructionSet_AdvSimd); // flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FP); #endif // HAVE_AUXV_HWCAP_H -#elif defined(TARGET_ARM64) - // Enable ARM64 based flags by default so we always crossgen - // ARM64 intrinsics for Linux - flags->Set(InstructionSet_ArmBase); - flags->Set(InstructionSet_AdvSimd); -#endif // defined(HOST_ARM64) } +#endif // HOST_ARM64 && TARGET_ARM64