On 03/13/2012 02:10 PM, Ian Lance Taylor wrote:
Manjunath Matti<manjunath81@xxxxxxxxx> writes:
In glibc the following commit adds support for backtrace in MIPS port.
commit 04d450263622ae7c37cb841f93b3bcf4e9397a88
Link: http://repo.or.cz/w/glibc-ports.git/commit/04d450263622ae7c37cb841f93b3bcf4e9397a88
But during compilations of any program the user needs to provide/pass
-funwind-tables to GCC, to be able to do a backtrace.
I am proposing why not the option be made the default one! it would be
useful to all.
Please let me know if its ok, I have a patch which will enable
-funwind-tables as a default option.
The -funwind-tables option takes up space in the program. That is
undesirable for programs running on embedded systems that do not need to
call backtrace or throw exceptions. Given this, each programmer has to
decide whether to use the option, and GCC has to pick a sensible
default. The default GCC has chosen is to turn off -funwind-tables
unless the language requires it (e.g., C++, Java, Go) or the processor
ABI requires it (x86_64).
You are proposing to change the default for MIPS. That would not be the
normal default for GCC. However, it's fine by me if the MIPS
maintainers want to make that change. Those are the people you have to
convince. Search for "mips" in the top-level MAINTAINERS file in the
gcc source code.
I am not a maintainer, but I suspect that we don't want to do this just yet.
A lot of mips code is run on resource constrained systems, where this
will not be welcome.
mips64 on the other hand might be a different question, although there
is a lot of legacy code out there that doesn't do it, so you might still
end up with a broken backtrace().
But really how hard is it to manually supply -funwind-tables for objects
that you care about?
David Daney