How to generate gdb compatible .o for CMT using Sun Studio C compiler?
Hello,
we've been working on a joint project for telco bearer plane applications on CMT.
We started the project using gcc for Sparc and we switched to Sun Studio compiler when we hit some bugs in gcc (optimized mode was not completely stable). The switch took a few weeks due to syntax differences and toolchain option changes.
With Sun Studio we got a double digit percent performance improvement, so Sun Studio proved more stable and faster than gcc.
To debug programs we require gdb, because the Telco customers are more familiar with it. The problem is that Sun Studio generates object files which are not compatible with gdb.
Our main requirement is to be able to generate gdb compatible object files using Sun Studio compiler.
We checked this link:
http://cooltools.sunsource.net/gcc/ReleaseNotes.html
but this seems to be a variant of gcc. At this point we cannot switch compiler because of the performance and stability issues mentioned above and because it will take a few weeks to months to switch.
We have two questions:
1) Is there a way to generate gdb compatible object files using Sun Studio 11?
2) If not, is this funcionality going to be available in a future release of Sun Studio and what is the time frame?
Thanks for your help.
Marco Zandonadi
Teja Technologies
[1374 byte] By [
marcoz] at [2007-11-26 8:51:31]

# 1
> With Sun Studio we got a double digit percent
> performance improvement, so Sun Studio proved more
> stable and faster than gcc.
What GCC version have you used?
GCCfss is using patched Studio 11 backend. So you should see similar performance
benefit. That way your flags/source syntax will be kept the same.
> Our main requirement is to be able to generate gdb
> compatible object files using Sun Studio compiler.
What kind of incompatiblity do you see?
Studio 11 backend that went with GCCfss is capable to generate gdb compatible debug
information.
Some debug related enhancements are coming in the next version of GCCfss 4.0.3 and are already available in Studio 12 (Studio express).
> We checked this link:
> http://cooltools.sunsource.net/gcc/ReleaseNotes.html
>
> but this seems to be a variant of gcc. At this point
> we cannot switch compiler because of the performance
> and stability issues mentioned above and because it
> will take a few weeks to months to switch.
GCCfss is GCC that uses Sun Studio backend to optimize and generate code.
You could expect Studio like reliability from it.
> We have two questions:
> 1) Is there a way to generate gdb compatible object
> files using Sun Studio 11?
> 2) If not, is this funcionality going to be available
> in a future release of Sun Studio and what is the
> time frame?
Please send us few examples with incompatibility issues and version of gdb that you're using.
As you probalby know even plain gcc requires gdb to match.
For example you need to use gdb 6.1 or newer if you use gcc 4.0
We also seen few bugs in gdb 6.2.
So I'd recommend to try gdb 6.3 or 6.4
Alexey.
# 2
Hi Alexey,
thanks for the fast reply. The gcc version we used was 3.3.3, which we compiled from vanilla GNU sources without any patch.
What you are saying about GCCfss is interesting and we should evaluate the tool. The problem for us remains that now our code has been moved to Sun Studio syntax and options, so moving it back to gcc would take some time. Or does GCCfss support Studio 11 syntax and compiler switches, so that code doesn't need to be ported to gcc syntax?
Also you mentioned "debug related enhancements" in Studion 12: do these include object compatibility with some version of gdb?
One more question: do you plan to support future Sun Studio releases for the backend of GCCfss?
Thanks and regards.
Marco
# 3
> Hi Alexey,
> thanks for the fast reply. The gcc version we used
> was 3.3.3, which we compiled from vanilla GNU sources
> without any patch.
This version was 'depreciated' by gcc steering more than a year ago.
> What you are saying about GCCfss is interesting and
> we should evaluate the tool. The problem for us
> remains that now our code has been moved to Sun
> Studio syntax and options, so moving it back to gcc
> would take some time. Or does GCCfss support Studio
> 11 syntax and compiler switches, so that code doesn't
> need to be ported to gcc syntax?
GCCfss that is avaliable now is version 4.0.2.
It is 100% compatible with plain GCC 4.0.2
It understands all gcc flags and most of the studio flags that are not in conflict.
Since you managed to move from gcc to studio your C code seems to be pretty ANSI.
So you should have no problems trying different C compilers.
> Also you mentioned "debug related enhancements" in
> Studion 12: do these include object compatibility
> with some version of gdb?
Studio 11 backend from GCCfss 4.0.2 works fine with gdb 6.3 and 6.4.
We saw some issues with gdb 6.1 and 6.2
I expect Studio 11 to exhibit similar behaviour.
I'm still not clear on what you call 'incompatibility'. Please provide an example.
> One more question: do you plan to support future Sun
> Studio releases for the backend of GCCfss?
Yes. That's exactly what we're doing.
Upcoming GCCfss 4.0.3 release is going to use Studio 12 backend that was used in Studio express (released about a month ago).
Alexey.
