[Lldb-commits] [lldb] cbd215d - [LIT] Add win32 PLATFORM env var to test config

Muhammad Omair Javaid via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 4 05:44:11 PDT 2021


Author: Muhammad Omair Javaid
Date: 2021-11-04T17:42:43+05:00
New Revision: cbd215dfe51df47e020c676a32c2672c573641a8

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

LOG: [LIT] Add win32 PLATFORM env var to test config

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.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D113165

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py
index 5689373d37a51..005f12bc09cf8 100755
--- a/lldb/test/Shell/helper/build.py
+++ b/lldb/test/Shell/helper/build.py
@@ -277,7 +277,10 @@ class MsvcBuilder(Builder):
     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

diff  --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py
index 7bc4b445b75e0..5231271f8fef9 100644
--- a/llvm/utils/lit/lit/llvm/config.py
+++ b/llvm/utils/lit/lit/llvm/config.py
@@ -38,7 +38,7 @@ def __init__(self, lit_config, config):
             # 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


        


More information about the lldb-commits mailing list