Closed Bug 687268 Opened 14 years ago Closed 14 years ago

angle compile failure in compiler/Common.h on Visual Studio 2011

Categories

(Core :: Graphics, defect)

x86_64
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 694801

People

(Reporter: gps, Unassigned)

References

Details

When building on Windows 8 and Visual Studio 2011, I'm getting the following compilation error in angle: make.py[0]: Entering directory 'c:\dev\mozilla-central\obj-ff\gfx\angle' make.py[1]: Entering directory 'c:\dev\mozilla-central\obj-ff\gfx\angle' c:\dev\mozilla-central\config\rules.mk:766:0$ c:/mozilla-build/python/python2.6. exe c:/dev/mozilla-central/config/buildlist.py ../../config/final-link-libs angl e evaluation from c:\dev\mozilla-central\config\rules.mk:1385:42:3:0$ c:/dev/mozil la-central/obj-ff/config/nsinstall.exe -m 644 c:/dev/mozilla-central/gfx/angle/i nclude/GLSLANG/ShaderLang.h c:/dev/mozilla-central/gfx/angle/include/GLSLANG/Res ourceLimits.h ../../dist/include/angle make.py[1]: Leaving directory 'c:\dev\mozilla-central\obj-ff\gfx\angle' make.py[1]: Entering directory 'c:\dev\mozilla-central\obj-ff\gfx\angle' Compiler.cpp c:\dev\mozilla-central\config\rules.mk:1212:0$ c:/mozilla-build/python/python2.6 .exe -O c:/dev/mozilla-central/build/cl.py cl -FoCompiler.obj -c -D_HAS_EXCEPTIO NS=0 -I../../dist/stl_wrappers -DANGLE_USE_NSPR -DANGLE_BUILD -DMOZILLA_INTERNA L_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_N S_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DOSTYPE=\"WINNT6.2\" -DOSAR CH=WINNT -Ic:/dev/mozilla-central/gfx/angle/include -Ic:/dev/mozilla-central/gfx /angle/src -Ic:/dev/mozilla-central/gfx/angle -I. -I../../dist/include -I../../d ist/include/nsprpub -Ic:/dev/mozilla-central/obj-ff/dist/include/nspr -Ic:/dev/ mozilla-central/obj-ff/dist/include/nss -TP -nologo -W3 -Gy -Fdgenerated.p db -wd4800 -we4553 -DNDEBUG -DTRIMMED -Zi -Zi -UDEBUG -DNDEBUG -O1 -Oy -MD -FI ../../dist/include/mozilla-config.h -DMOZILLA_CLIENT c:/dev/mozilla-ce ntral/gfx/angle/src/compiler/Compiler.cpp Compiler.cpp C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(774) : e rror C2039: '=' : is not a member of 'pool_allocator<T>' with [ T=char ] C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0( 773) : while compiling class template member function 'std::_Wrap_alloc<_Alloc> &std::_Wrap_alloc<_Alloc>::operator =(const std::_Wrap_alloc<_Alloc> &)' with [ _Alloc=pool_allocator<char> ] C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xstring(4 54) : see reference to class template instantiation 'std::_Wrap_alloc<_Alloc>' b eing compiled with [ _Alloc=pool_allocator<char> ] C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xstring(5 40) : see reference to class template instantiation 'std::_String_base_types<_Ty ,_Alloc0>' being compiled with [ _Ty=char, _Alloc0=TStringAllocator ] C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xstring(6 98) : see reference to class template instantiation 'std::_String_alloc<_Al_has_ storage,_Alloc_types>' being compiled with [ _Al_has_storage=true, _Alloc_types=std::_String_base_types<char,TStringAllocator> ] c:\dev\mozilla-central\gfx\angle\src\compiler/Common.h(57) : see referen ce to class template instantiation 'std::basic_string<_Elem,_Traits,_Alloc>' bei ng compiled with [ _Elem=char, _Traits=std::char_traits<char>, _Alloc=TStringAllocator ] c:\dev\mozilla-central\config\rules.mk:1212:0: command 'c:/mozilla-build/python/ python2.6.exe -O c:/dev/mozilla-central/build/cl.py cl -FoCompiler.obj -c -D_HAS _EXCEPTIONS=0 -I../../dist/stl_wrappers -DANGLE_USE_NSPR -DANGLE_BUILD -DMOZILL A_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DOSTYPE=\"WINNT6.2 \" -DOSARCH=WINNT -Ic:/dev/mozilla-central/gfx/angle/include -Ic:/dev/mozilla-ce ntral/gfx/angle/src -Ic:/dev/mozilla-central/gfx/angle -I. -I../../dist/include -I../../dist/include/nsprpub -Ic:/dev/mozilla-central/obj-ff/dist/include/nspr -Ic:/dev/mozilla-central/obj-ff/dist/include/nss -TP -nologo -W3 -Gy -Fdge nerated.pdb -wd4800 -we4553 -DNDEBUG -DTRIMMED -Zi -Zi -UDEBUG -DNDEBUG -O1 -Oy -MD -FI ../../dist/include/mozilla-config.h -DMOZILLA_CLIENT c:/dev/m ozilla-central/gfx/angle/src/compiler/Compiler.cpp' failed, return code 2 c:\dev\mozilla-central\config\rules.mk:709:0: command 'c:/mozilla-build/python/p ython.exe c:/dev/mozilla-central/build/pymake/pymake/../make.py libs' failed, re turn code 2 Digging into Common.h, we find the error is in code dealing with memory allocation. Bug 687229 is in the same vein, but is different. It looks like the new header files in MSVC 2011 and Windows 8 might have changed some things in the memory allocation headers.
It appears MSVC 2011 has introduced a new file, xmemory0. MSVC 2010 only had xmemory0. Furthermore, xmemory0 includes a lot of code that didn't previously exist in xmemory. I'm not sure if the new content was refactored from somewhere else or created for this release. But, the offending function in question, _Wrap_alloc() did not appear to exist in MSVC 2010. The implementation of this new function calls operator= on the base type, which isn't defined on pool_allocator<T>, hence the compiler error. For reference, the MSDN documentation for the STL allocator is at: http://msdn.microsoft.com/en-us/library/h8z741y5%28v=VS.100%29.aspx (VS2010) http://msdn.microsoft.com/en-us/library/h8z741y5%28v=VS.110%29.aspx (VS2011) Both have operator=() defined as a member (even VS2005 has it). Since we didn't have operator=() implemented all this time, I'm guessing we just got lucky since none of the compilation environments actually called it. It looks like VS2011 will force our hand.
Cross-linked this bug to the angle project: http://code.google.com/p/angleproject/issues/detail?id=222
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.