diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index bcc18f8387..7d9e91e758 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1841,9 +1841,9 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept } #if defined(ARCH_X64) - const exec_addr = pExp->ContextRecord->Rip; + const auto exec_addr = pExp->ContextRecord->Rip; #elif defined(ARCH_ARM64) - const exec_addr = pExp->ContextRecord->Pc; + const auto exec_addr = pExp->ContextRecord->Pc; #else #error "Unimplemented exception handling for this architecture" #endif diff --git a/buildfiles/cmake/ConfigureCompiler.cmake b/buildfiles/cmake/ConfigureCompiler.cmake index e7efd5ba13..8a32b5ce5b 100644 --- a/buildfiles/cmake/ConfigureCompiler.cmake +++ b/buildfiles/cmake/ConfigureCompiler.cmake @@ -113,7 +113,10 @@ else() # Increase stack limit to 8 MB add_link_options(-Wl,--stack -Wl,8388608) - add_link_options(-Wl,--image-base,0x10000) + # For arm64 windows, the image base cannot be below 4GB or the OS rejects the binary without much explanation. + if(COMPILER_X86) + add_link_options(-Wl,--image-base,0x10000) + endif() endif() # Specify C++ library to use as standard C++ when using clang