Author: David Spickett
Date: 2023-11-10T12:52:36Z
New Revision: 7c3603e1c162382b5c038b99e482e0689e1505aa

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

LOG: [lldb][test] Only add -m(64|32) for GCC on non Arm/AArch64 platforms

This option is definitely needed for x86_64, and is valid for PowerPC
and s390x too.

I'm using "in" because on Armv8 Linux the uname is actually "armv8l"
not just "arm".

Added: 
    

Modified: 
    lldb/test/Shell/helper/build.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py
index 2a04967c89bc305..561d9ba2363c7ae 100755
--- a/lldb/test/Shell/helper/build.py
+++ b/lldb/test/Shell/helper/build.py
@@ -747,7 +747,10 @@ def _get_compilation_command(self, source, obj):
         args = []
 
         args.append(self.compiler)
-        args.append("-m" + self.arch)
+
+        uname = platform.uname().machine.lower()
+        if not "arm" in uname and not "aarch64" in uname:
+            args.append("-m" + self.arch)
 
         args.append("-g")
         if self.opt == "none":
@@ -784,7 +787,11 @@ def _get_compilation_command(self, source, obj):
     def _get_link_command(self):
         args = []
         args.append(self.compiler)
-        args.append("-m" + self.arch)
+
+        uname = platform.uname().machine.lower()
+        if not "arm" in uname and not "aarch64" in uname:
+            args.append("-m" + self.arch)
+
         if self.nodefaultlib:
             args.append("-nostdlib")
             args.append("-static")


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to