]> git.tdb.fi Git - builder.git/commitdiff
Use a more appropriate check for adding -m<bits> flag
authorMikko Rasa <tdb@tdb.fi>
Mon, 3 Jun 2019 12:37:02 +0000 (15:37 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 3 Jun 2019 12:37:02 +0000 (15:37 +0300)
The bits check was redundant because it's already included in the native
flag.  On the other hand -m<bits> is not supported on all architectures,
in particular on ARM.

source/gnucompiler.cpp

index b3f56175c034790d427cec316b12f3a7b2680773..064b0a0f6e1faafc86d778c778afd4e6feae3573 100644 (file)
@@ -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();