From: Mikko Rasa Date: Mon, 3 Jun 2019 12:37:02 +0000 (+0300) Subject: Use a more appropriate check for adding -m flag X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=cb0be83edbfeea6c649705a045dc3a3b990e9ce3;p=builder.git 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. --- 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();