]> git.tdb.fi Git - builder.git/blobdiff - source/gnucompiler.cpp
More sophisticated handling of language standards
[builder.git] / source / gnucompiler.cpp
index b3f56175c034790d427cec316b12f3a7b2680773..a6e838d1e49ea160bf6d320d647fe44ed9be7381 100644 (file)
@@ -150,7 +150,7 @@ void GnuCompiler::prepare_syspath()
                                start = newline+1;
                        }
                }
-               catch(const runtime_error &e)
+               catch(const runtime_error &)
                { }
        }
 
@@ -210,9 +210,9 @@ Task *GnuCompiler::run(const Target &target) const
 
        string tag_for_std = (tag=="OBJC" ? "CC" : tag);
        if(binfo.standards.count(tag_for_std))
-               argv.push_back("-std="+get_item(binfo.standards, tag_for_std));
+               argv.push_back("-std="+get_item(binfo.standards, tag_for_std).str());
        if(tag=="OBJC" && binfo.standards.count(tag))
-               argv.push_back("-fobjc-std="+get_item(binfo.standards, tag));
+               argv.push_back("-fobjc-std="+get_item(binfo.standards, tag).str());
 
        if(binfo.warning_level>=1)
        {
@@ -278,14 +278,15 @@ Task *GnuCompiler::run(const Target &target) const
                        argv.push_back("-Os");
                else
                        argv.push_back(format("-O%d", binfo.optimize));
+               if(binfo.debug)
+                       argv.push_back("-fno-omit-frame-pointer");
        }
        if(binfo.threads && architecture->get_system()!="windows" && architecture->get_system()!="darwin")
                argv.push_back("-pthread");
        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();