[oi-dev] g++ 4.7 headers issue

Alexander Pyhalov alp at rsu.ru
Fri May 31 18:21:24 UTC 2013


On 05/29/2013 11:40, Alexander Pyhalov wrote:
> Hello.
> I need some advice and possibly help.
> We have an issue (https://www.illumos.org/issues/3787) related to GCC
> 4.6 change which affects building of several components in oi-userland
> gate with default gcc 4.7 compiler.
> We have a patch from Igor Kozhuhov
> https://www.illumos.org/attachments/908/3787_il.patch  and suggestion
> from Rich Lowe to rework it in so way that it will be not "if not GCC"
> but "if is Studio".
> The problem is that I'm not in any way confident in C++ and even less
> familiar with  Sun Studio. Will it be enough to just turn on the
> opposite logic for #ifdef _sun or some more work is needed?

So, I created patch that changed  __cplusplus >= 199711L logic to 
__cplusplus >= 199711L && defined(__SUNPRO_CC).
As it was expected, it didn't influence Illumos building - it uses gcc 
4.4 and its behavior is not affected by this patch. It unlikely  breaks 
Sun Studio behavior - for Studio everything stays the same. However, it 
also breaks G++ 4.7. So, some these defines are necessary.

At least, one in iso/stdio_iso.h :

#if !defined(_FILEDEFED) ||  __cplusplus >= 199711L
#define _FILEDEFED
typedef __FILE FILE;
#endif

 From this point, I'm not sure in anything. If this one is necessary, 
how can I determine unnecessary ones? I don't have enough knowledge. The 
last patch attached to https://www.illumos.org/issues/3787 is incomplete 
(and in fact, was tested on /usr/include rather then on /usr/src/head), 
but it didn't break compilation of several c++ programs which I tried.
Need some advice on what to do further...

In summary:
for recent g++ to work we at least should patch include/stdlib.h and 
include/iso/stdlib_iso.h. I'm not sure about other places, but it seems, 
namespace-related patches are necessary.
-- 
Best regards,
Alexander Pyhalov,
system administrator of Computer Center of Southern Federal University




More information about the oi-dev mailing list