Re: Understanding lvalues and rvalues in C and C++
by nitrogen on Thursday December 15, 2011 @05:43PM
(#3358409)
On your large projects that must support Oracle, IBM, and HP's compilers, what prevents you from compiling your C++11 code with gcc and linking it in? Is it to difficult to maintain a consistent external ABI? Does gcc not support the other ABIs and/or mangling conventions?
[ Parent
| on HN ]
Re: Understanding lvalues and rvalues in C and C++
by apaprocki on Thursday December 15, 2011 @06:58PM
(#3358676)
The generated code is not compatible and there are other issues. We have some stubs vs dwarf debug information issues with gcc. The code generated by gcc is not as optimized as the vendor supplied compilers. This is if you are telling the compiler that you only want to support sparcv8+ or pwr5+ so it can take advantage of the newer CPUs. And even if gcc was the same or better, there is the issue of support. We only use the vendor compilers because we meet with them regularly and they will fix any bugs immediately (at least start working on them) and are open to enhancement requests. I'm not aware of any company willing to provide awesome service for gcc on these platforms.
Edit: Not to say we don't use gcc. The entire codebase does of course build using gcc on all of the platforms.. it is mainly the support issue and tweaks needed to build the binaries the way we want on each architecture.
Re: Understanding lvalues and rvalues in C and C++
by lysium on Thursday December 15, 2011 @06:07PM
(#3358501)
Mangling is not standardized and every compiler does it differently. In general, you can't link files compiled by different C++ compilers.
Re: Understanding lvalues and rvalues in C and C++
by apaprocki on Thursday December 15, 2011 @07:07PM
(#3358697)
And to make things even more fun, each individual compiler usually comes with baggage it has collected over the years. In xlC alone the -qnamemangling option can be set to: ansi (don't let it fool you), v11, v10, v9, v8, v7, v6, v5, v4, v3, or compat so even code build with the same compiler isn't always compatible.