[llvm] 81b96bb - [Aarch64] Fix assumption that Windows implies x86

David Truby via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 05:12:01 PDT 2020


Author: David Truby
Date: 2020-10-30T12:11:34Z
New Revision: 81b96bb6f1caee90ad64c9c7c80b55c163b1f6a8

URL: https://github.com/llvm/llvm-project/commit/81b96bb6f1caee90ad64c9c7c80b55c163b1f6a8
DIFF: https://github.com/llvm/llvm-project/commit/81b96bb6f1caee90ad64c9c7c80b55c163b1f6a8.diff

LOG: [Aarch64] Fix assumption that Windows implies x86

When compiling for Windows on Arm the amd64 debug interfce from the Visual
Studio SDK is used as the cmake currently only distinguishes between x86 and
amd64 by checking the pointer size. Instead we can get the target
architecture for the compilier and check that to distinguish between
architectures.

Added: 
    

Modified: 
    llvm/lib/DebugInfo/PDB/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/PDB/CMakeLists.txt b/llvm/lib/DebugInfo/PDB/CMakeLists.txt
index 9088bc86f668..21f8fa93acd5 100644
--- a/llvm/lib/DebugInfo/PDB/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/PDB/CMakeLists.txt
@@ -6,7 +6,12 @@ endmacro()
 if(LLVM_ENABLE_DIA_SDK)
   include_directories(${MSVC_DIA_SDK_DIR}/include)
   set(LIBPDB_LINK_FOLDERS "${MSVC_DIA_SDK_DIR}\\lib")
-  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+
+  if ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "arm64")
+    set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\arm64")
+  elseif ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "arm")
+    set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\arm")
+  elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
     set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\amd64")
   endif()
   file(TO_CMAKE_PATH "${LIBPDB_LINK_FOLDERS}\\diaguids.lib" LIBPDB_ADDITIONAL_LIBRARIES)


        


More information about the llvm-commits mailing list