From e33cf3134768e180ab76df91d9a00c28f1915231 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 22 Nov 2015 14:50:52 +0200 Subject: [PATCH] Do not use the linker in cross C++ sanity check to make bare metal projects work. --- compilers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compilers.py b/compilers.py index f2117607f797..46797c96ba3f 100644 --- a/compilers.py +++ b/compilers.py @@ -553,7 +553,13 @@ def sanity_check(self, work_dir): ofile = open(source_name, 'w') ofile.write('class breakCCompiler;int main(int argc, char **argv) { return 0; }\n') ofile.close() - cmdlist = self.exelist + [source_name, '-o', binary_name] + if self.is_cross and self.exe_wrapper is None: + # Skipping link because of the same reason as for C. + # The comment in CCompiler explains why this is done. + extra_flags = ['-c'] + else: + extra_flags = [] + cmdlist = self.exelist + extra_flags + [source_name, '-o', binary_name] pc = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdo, stde) = pc.communicate() stdo = stdo.decode()