From aa7b70efcedf16dee674deee4545ace5f2393004 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 24 Aug 2013 21:38:43 +0300 Subject: [PATCH] Some fixes for C++ cross compiler. --- environment.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/environment.py b/environment.py index af4e9d9fc..1625b444b 100644 --- a/environment.py +++ b/environment.py @@ -310,7 +310,14 @@ class CPPCompiler(CCompiler): pc.wait() if pc.returncode != 0: raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string()) - pe = subprocess.Popen(binary_name) + if self.is_cross: + if self.exe_wrapper is None: + # Can't check if the binaries run so we have to assume they do + return + cmdlist = self.exe_wrapper + [binary_name] + else: + cmdlist = [binary_name] + pe = subprocess.Popen(cmdlist) pe.wait() if pe.returncode != 0: raise EnvironmentException('Executables created by C++ compiler %s are not runnable.' % self.name_string()) @@ -839,7 +846,7 @@ class Environment(): continue out = p.communicate()[0] out = out.decode() - if (out.startswith('c++ ') or out.startswith('g++') or 'GCC' in out) and \ + if (out.startswith('c++ ') or 'g++' in out or 'GCC' in out) and \ 'Free Software Foundation' in out: return GnuCPPCompiler(ccache + [compiler], is_cross, exe_wrap) if 'apple' in out and 'Free Software Foundation' in out: