From 777c1e9c199fe641c5b9b3111d558f1cc9770288 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 15 Jun 2016 10:48:53 +0530 Subject: [PATCH] compilers: Fix usage of cross tools args in sanity checks The cross-extra-flags were being overwritten and ignored. Also, we don't link while doing a cross-compiled sanity check even with ObjC++ --- mesonbuild/compilers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 47560135c..ca9d2feb0 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -451,7 +451,7 @@ class CCompiler(Compiler): # a ton of compiler flags to differentiate between # arm and x86_64. So just compile. extra_flags += self.get_cross_extra_flags(environment, compile=True, link=False) - extra_flags = self.get_compile_only_args() + extra_flags += self.get_compile_only_args() else: extra_flags += self.get_cross_extra_flags(environment, compile=True, link=True) # Is a valid executable output for all toolchains and platforms @@ -876,7 +876,7 @@ class ObjCCompiler(CCompiler): binary_name = os.path.join(work_dir, 'sanitycheckobjc') extra_flags = self.get_cross_extra_flags(environment, compile=True, link=False) if self.is_cross: - extra_flags = self.get_compile_only_args() + extra_flags += self.get_compile_only_args() ofile = open(source_name, 'w') ofile.write('#import\nint main(int argc, char **argv) { return 0; }\n') ofile.close() @@ -908,9 +908,9 @@ class ObjCPPCompiler(CPPCompiler): # TODO try to use sanity_check_impl instead of duplicated code source_name = os.path.join(work_dir, 'sanitycheckobjcpp.mm') binary_name = os.path.join(work_dir, 'sanitycheckobjcpp') - extra_flags = self.get_cross_extra_flags(environment, compile=True, link=True) + extra_flags = self.get_cross_extra_flags(environment, compile=True, link=False) if self.is_cross: - extra_flags = self.get_compile_only_args() + extra_flags += self.get_compile_only_args() ofile = open(source_name, 'w') ofile.write('#import\nclass MyClass;int main(int argc, char **argv) { return 0; }\n') ofile.close()