Index: lldb/packages/Python/lldbsuite/test/builders/builder.py =================================================================== --- lldb/packages/Python/lldbsuite/test/builders/builder.py +++ lldb/packages/Python/lldbsuite/test/builders/builder.py @@ -21,6 +21,10 @@ compiler = lldbutil.which(compiler) return os.path.abspath(compiler) + def getTriple(self, arch): + """Returns the triple for the given architecture or an empty string.""" + return "" + def getExtraMakeArgs(self): """ Helper function to return extra argumentsfor the make system. This Index: lldb/packages/Python/lldbsuite/test/builders/darwin.py =================================================================== --- lldb/packages/Python/lldbsuite/test/builders/darwin.py +++ lldb/packages/Python/lldbsuite/test/builders/darwin.py @@ -55,6 +55,12 @@ class BuilderDarwin(Builder): + def getTriple(self, arch): + vendor, os, version, env = get_triple() + if arch is None or vendor is None or os is None or version is None or env is None: + return "" + return '-'.join([arch, vendor, os, version, env]) + def getExtraMakeArgs(self): """ Helper function to return extra argumentsfor the make system. This Index: lldb/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -1347,15 +1347,19 @@ return str(configuration.dwarf_version) if 'clang' in self.getCompiler(): try: + module = builder_module() + triple = module.getTriple(self.getArchitecture()) + target = ['-target', triple] if triple else [] driver_output = check_output( - [self.getCompiler()] + '-g -c -x c - -o - -###'.split(), + [self.getCompiler()] + target + '-g -c -x c - -o - -###'.split(), stderr=STDOUT) driver_output = driver_output.decode("utf-8") for line in driver_output.split(os.linesep): m = re.search('dwarf-version=([0-9])', line) if m: return m.group(1) - except: pass + except CalledProcessError: + pass return '0' def platformIsDarwin(self):