From 7c86449343bab284071716f1d0606d67e720b8ad Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 3 Oct 2014 23:40:44 +0300 Subject: [PATCH] Only use the -m flag on native arch Better yet would be to figure out whether the target arch supports it, but that's not trivial. --- source/gnucompiler.cpp | 2 +- source/gnulinker.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index bff5f8c..9fcdaf0 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -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(); diff --git a/source/gnulinker.cpp b/source/gnulinker.cpp index 837e7c7..93eadf6 100644 --- a/source/gnulinker.cpp +++ b/source/gnulinker.cpp @@ -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"); -- 2.45.2