]> git.tdb.fi Git - builder.git/commitdiff
Only use the -m flag on native arch
authorMikko Rasa <tdb@tdb.fi>
Fri, 3 Oct 2014 20:40:44 +0000 (23:40 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 3 Oct 2014 20:40:44 +0000 (23:40 +0300)
Better yet would be to figure out whether the target arch supports it,
but that's not trivial.

source/gnucompiler.cpp
source/gnulinker.cpp

index bff5f8cd145106520005052184d04da274e4ae90..9fcdaf048cd50c23e0eb85e924dfa75d013ae87a 100644 (file)
@@ -142,7 +142,7 @@ Task *GnuCompiler::run(const Target &target) const
                argv.push_back("-fPIC");
 
        const Architecture &native_arch = builder.get_native_arch();
-       if(architecture->get_bits()!=native_arch.get_bits())
+       if(architecture->is_native() && architecture->get_bits()!=native_arch.get_bits())
                argv.push_back(format("-m%d", architecture->get_bits()));
 
        const string &cpu = architecture->get_cpu();
index 837e7c7e64ff5baed9926ab1db5006a8f924245f..93eadf6f1197fbff5992013ed4c43abbf2d9a423 100644 (file)
@@ -208,7 +208,7 @@ Task *GnuLinker::Linker::run(const Target &target) const
                argv.push_back("-pthread");
 
        const Architecture &native_arch = builder.get_native_arch();
-       if(architecture->get_bits()!=native_arch.get_bits())
+       if(architecture->is_native() && architecture->get_bits()!=native_arch.get_bits())
                argv.push_back(format("-m%d", architecture->get_bits()));
 
        argv.push_back("-o");