From cb0be83edbfeea6c649705a045dc3a3b990e9ce3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 3 Jun 2019 15:37:02 +0300 Subject: [PATCH] Use a more appropriate check for adding -m flag The bits check was redundant because it's already included in the native flag. On the other hand -m is not supported on all architectures, in particular on ARM. --- source/gnucompiler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index b3f5617..064b0a0 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -284,8 +284,7 @@ Task *GnuCompiler::run(const Target &target) const if(object.is_used_in_shared_library() && architecture->get_system()!="windows") argv.push_back("-fPIC"); - const Architecture &native_arch = builder.get_native_arch(); - if(architecture->is_native() && architecture->get_bits()!=native_arch.get_bits()) + if((architecture->get_type()=="x86" || architecture->get_type()=="ppc") && !architecture->is_native()) argv.push_back(format("-m%d", architecture->get_bits())); string cpu = architecture->get_cpu(); -- 2.43.0