omjavaid created this revision.
omjavaid added reviewers: zturner, mstorsjo.
Herald added subscribers: pengfei, delcypher, kristof.beyls.
omjavaid requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

LIT skips various system environment variables while building test
config. It turns out that we require PLATFORM environment variable for
detection of x86 vs Arm windows platform.

      

This patch adds system environment variable PLATFORM into LIT test 
config for detection of win32 Arm platform.


https://reviews.llvm.org/D113165

Files:
  lldb/test/Shell/helper/build.py
  llvm/utils/lit/lit/llvm/config.py


Index: llvm/utils/lit/lit/llvm/config.py
===================================================================
--- llvm/utils/lit/lit/llvm/config.py
+++ llvm/utils/lit/lit/llvm/config.py
@@ -38,7 +38,7 @@
             # Many tools behave strangely if these environment variables aren't
             # set.
             self.with_system_environment(
-                ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP'])
+                ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP', 'PLATFORM'])
             self.use_lit_shell = True
 
             global lit_path_displayed
Index: lldb/test/Shell/helper/build.py
===================================================================
--- lldb/test/Shell/helper/build.py
+++ lldb/test/Shell/helper/build.py
@@ -277,7 +277,10 @@
     def __init__(self, toolchain_type, args):
         Builder.__init__(self, toolchain_type, args, '.obj')
 
-        self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64'
+        if os.getenv('PLATFORM') == 'arm64':
+            self.msvc_arch_str = 'arm' if self.arch == '32' else 'arm64'
+        else:
+            self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64'
 
         if toolchain_type == 'msvc':
             # Make sure we're using the appropriate toolchain for the desired


Index: llvm/utils/lit/lit/llvm/config.py
===================================================================
--- llvm/utils/lit/lit/llvm/config.py
+++ llvm/utils/lit/lit/llvm/config.py
@@ -38,7 +38,7 @@
             # Many tools behave strangely if these environment variables aren't
             # set.
             self.with_system_environment(
-                ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP'])
+                ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP', 'PLATFORM'])
             self.use_lit_shell = True
 
             global lit_path_displayed
Index: lldb/test/Shell/helper/build.py
===================================================================
--- lldb/test/Shell/helper/build.py
+++ lldb/test/Shell/helper/build.py
@@ -277,7 +277,10 @@
     def __init__(self, toolchain_type, args):
         Builder.__init__(self, toolchain_type, args, '.obj')
 
-        self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64'
+        if os.getenv('PLATFORM') == 'arm64':
+            self.msvc_arch_str = 'arm' if self.arch == '32' else 'arm64'
+        else:
+            self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64'
 
         if toolchain_type == 'msvc':
             # Make sure we're using the appropriate toolchain for the desired
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PAT... Muhammad Omair Javaid via Phabricator via lldb-commits

Reply via email to