Skip to content

Commit 7c3603e

Browse files
committed
[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".
1 parent 343eb4b commit 7c3603e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lldb/test/Shell/helper/build.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,10 @@ def _get_compilation_command(self, source, obj):
747747
args = []
748748

749749
args.append(self.compiler)
750-
args.append("-m" + self.arch)
750+
751+
uname = platform.uname().machine.lower()
752+
if not "arm" in uname and not "aarch64" in uname:
753+
args.append("-m" + self.arch)
751754

752755
args.append("-g")
753756
if self.opt == "none":
@@ -784,7 +787,11 @@ def _get_compilation_command(self, source, obj):
784787
def _get_link_command(self):
785788
args = []
786789
args.append(self.compiler)
787-
args.append("-m" + self.arch)
790+
791+
uname = platform.uname().machine.lower()
792+
if not "arm" in uname and not "aarch64" in uname:
793+
args.append("-m" + self.arch)
794+
788795
if self.nodefaultlib:
789796
args.append("-nostdlib")
790797
args.append("-static")

0 commit comments

Comments
 (0)