oizma / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Failed to compile Intermediate.cpp with SunStudio 12 #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.compile angle trunk code with SunStudio 12

What is the expected output? What do you see instead?
Expected:
Intermediate.cpp should be compiled with SunStudio 12.
But actually, it doesn't

What version of the product are you using? On what operating system?
I saw this problem when building firefox trunk code.
I use OpenSolaris build 142.

The attachment is a patch.

Original issue reported on code.google.com by Eagle...@gmail.com on 21 Jul 2010 at 2:02

Attachments:

GoogleCodeExporter commented 9 years ago
patch combined with other fixes to make angle compile with Sun Studio on Solaris

Original comment by ginnc...@gmail.com on 21 Jul 2010 at 9:13

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by alokp@chromium.org on 5 Aug 2010 at 10:05

GoogleCodeExporter commented 9 years ago
I have submitted a portion of your patch in r373 and r374. However I am 
hesitant in submitting changes to support non-standard STL allocator in 
PoolAlloc.h. Is the compiler in question (sunstudio 12) really old? Is the 
problem fixed in the new version of the compiler?

Original comment by alokp@chromium.org on 9 Aug 2010 at 5:21

GoogleCodeExporter commented 9 years ago
The lastest sunstudio is 12.1, the problem is the same.
AFAIK there's no plan to update the interface of libCStd.
Instead, stdcxx is supplied with the standard STL allocator.
But we can't use stdcxx in Firefox, because libCStd and stdcxx cannot be mixed 
in the same process space and libflashplayer.so uses libCStd.

Original comment by ginnc...@gmail.com on 9 Aug 2010 at 6:43

GoogleCodeExporter commented 9 years ago
I'm not so sure that this is correct, though I don't have the SunStudio headers 
to reference.

I think that the 'allocate' function called here should be 
TPoolAllocator::allocate, which takes a size_t parameter with the number of 
bytes to allocate, and is defined just above. Without the sizeof(T) parameter, 
I don't think that you'll be allocating enough bytes.

Can you post the SunStudio definition that this seems to conflict with?

Original comment by gavriels...@gmail.com on 9 Aug 2010 at 9:27

GoogleCodeExporter commented 9 years ago
Hi Gav, Please review the patch here: http://codereview.appspot.com/1913048/show

Original comment by alokp@chromium.org on 9 Aug 2010 at 9:31

GoogleCodeExporter commented 9 years ago
#ifdef _RWSTD_ALLOCATOR
....
    pointer allocate(size_type n, allocator<void>::const_pointer = 0)
    {
      pointer tmp =
      _RWSTD_STATIC_CAST(pointer,(::operator
                                  new(_RWSTD_STATIC_CAST(size_t,(n * sizeof(value_type))))));
      _RWSTD_THROW_NO_MSG(tmp == 0, bad_alloc);
      return tmp;
    }
....
#else
....
    void * allocate (size_type n, void *  = 0)
    {         void * tmp = _RWSTD_STATIC_CAST(void*,(::operator new(_RWSTD_STATIC_CAST(size_t,(n)))));
      _RWSTD_THROW_NO_MSG(tmp == 0, bad_alloc);
      return tmp;
    }
....
#endif

See the discussion at
http://forums.sun.com/thread.jspa?messageID=10210406#10210406

Original comment by ginnc...@gmail.com on 9 Aug 2010 at 9:48

GoogleCodeExporter commented 9 years ago
Got it now - it's the caller interface that's different. I'm good with this 
change provided that the comment reflects what's going on better.

Original comment by gavriels...@gmail.com on 9 Aug 2010 at 10:07

GoogleCodeExporter commented 9 years ago
Final patch submitted in r380.

Original comment by alokp@chromium.org on 9 Aug 2010 at 10:33