Closed Bug 1268816 Opened 9 years ago Closed 9 years ago

More errors as a result of the skia hacks around #defining std members to mozilla equivalents

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: lsalzman)

References

Details

Attachments

(1 file)

I pulled a new copy of m-c today after a few days and I'm getting build errors again in ways very similar to bug 1250196. These are the errors: 3:21.15 In file included from /Users/ehsan/moz/src/gfx/gl/SkiaGLGlue.cpp:8: 3:21.15 In file included from /Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/include/mozilla/gfx/2D.h:10: 3:21.16 In file included from /Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/include/mozilla/gfx/Point.h:13: 3:21.16 In file included from /Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/include/mozilla/gfx/BasePoint.h:10: 3:21.46 In file included from /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/ostream:140: 3:21.46 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/locale:230:9: error: no template named 'UniquePtr' in namespace 'std::__1'; did you mean simply 'UniquePtr'? 3:21.46 typedef _VSTD::unique_ptr<__locale_struct, decltype(&freelocale)> __locale_unique_ptr; 3:21.46 ^~~~~~~ 3:21.46 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__config:388:15: note: expanded from macro '_VSTD' 3:21.46 #define _VSTD std::_LIBCPP_NAMESPACE 3:21.46 ^ 3:21.46 /Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/include/mozilla/UniquePtr.h:188:7: note: 'UniquePtr' declared here 3:21.46 class UniquePtr 3:21.47 ^ 3:21.53 librdf_base.a.desc 3:22.86 libview.a.desc 3:22.87 In file included from /Users/ehsan/moz/src/gfx/gl/SkiaGLGlue.cpp:19: 3:22.87 In file included from /Users/ehsan/moz/src/gfx/gl/GLContext.h:15: 3:22.87 In file included from /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/queue:169: 3:22.88 In file included from /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:158: 3:22.97 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__split_buffer:130:10: error: no matching member function for call to '__destruct_at_begin' 3:22.97 {__destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());} 3:22.97 ^~~~~~~~~~~~~~~~~~~ 3:22.97 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__split_buffer:108:49: note: in instantiation of member function 'std::__1::__split_buffer<const mozilla::gl::GLContext::LocalErrorScope **, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope **> >::__destruct_at_begin' requested here 3:22.97 _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);} 3:22.97 ^ 3:22.97 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:2387:24: note: in instantiation of member function 'std::__1::__split_buffer<const mozilla::gl::GLContext::LocalErrorScope **, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope **> >::pop_front' requested here 3:22.98 __base::__map_.pop_front(); 3:22.98 ^ 3:22.98 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:1768:9: note: in instantiation of member function 'std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> >::__add_back_capacity' requested here 3:23.17 __add_back_capacity(); 3:23.17 ^ 3:23.17 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/stack:197:36: note: in instantiation of member function 'std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> >::push_back' requested here 3:23.17 void push(value_type&& __v) {c.push_back(_VSTD::move(__v));} 3:23.22 ^ 3:23.22 /Users/ehsan/moz/src/gfx/gl/GLContext.h:641:39: note: in instantiation of member function 'std::__1::stack<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> > >::push' requested here 3:23.22 mGL.mLocalErrorScopeStack.push(this); 3:23.22 ^ 3:23.22 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__split_buffer:131:14: note: candidate function not viable: no known conversion from 'is_trivially_destructible<value_type>' to 'FalseType' (aka 'IntegralConstant<bool, false>') for 2nd argument 3:23.22 void __destruct_at_begin(pointer __new_begin, false_type); 3:23.22 ^ 3:23.22 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__split_buffer:132:14: note: candidate function not viable: no known conversion from 'is_trivially_destructible<value_type>' to 'TrueType' (aka 'IntegralConstant<bool, true>') for 2nd argument 3:23.22 void __destruct_at_begin(pointer __new_begin, true_type); 3:23.22 ^ 3:23.22 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__split_buffer:129:36: note: candidate function not viable: requires single argument '__new_begin', but 2 arguments were provided 3:23.23 _LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin) 3:23.23 ^ 3:23.23 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__split_buffer:535:22: error: no matching function for call to 'Move' 3:23.23 __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d); 3:23.32 ^~~~~~~~~~~ 3:23.32 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__config:388:15: note: expanded from macro '_VSTD' 3:23.32 #define _VSTD std::_LIBCPP_NAMESPACE 3:23.32 ^ 3:23.33 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:2388:24: note: in instantiation of member function 'std::__1::__split_buffer<const mozilla::gl::GLContext::LocalErrorScope **, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope **> >::push_back' requested here 3:23.67 __base::__map_.push_back(__pt); 3:23.67 ^ 3:23.67 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:1768:9: note: in instantiation of member function 'std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> >::__add_back_capacity' requested here 3:24.31 __add_back_capacity(); 3:24.31 ^ 3:24.31 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/stack:197:36: note: in instantiation of member function 'std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> >::push_back' requested here 3:24.31 void push(value_type&& __v) {c.push_back(_VSTD::move(__v));} 3:24.32 ^ 3:24.32 /Users/ehsan/moz/src/gfx/gl/GLContext.h:641:39: note: in instantiation of member function 'std::__1::stack<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> > >::push' requested here 3:24.32 mGL.mLocalErrorScopeStack.push(this); 3:24.32 ^ 3:24.32 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__bit_reference:696:1: note: candidate template ignored: could not match '__bit_iterator<type-parameter-0-0, _IsConst, 0>' against 'const mozilla::gl::GLContext::LocalErrorScope ***' 3:24.32 move(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) 3:24.33 ^ 3:24.52 /Users/ehsan/moz/src/gfx/skia/skia/include/config/../private/SkTLogic.h:45:16: note: expanded from macro 'move' 3:24.52 #define move Move 3:24.52 ^ 3:24.52 /Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/include/mozilla/Move.h:201:1: note: candidate function template not viable: requires single argument 'aX', but 3 arguments were provided 3:24.52 Move(T&& aX) 3:24.52 ^ 3:24.53 In file included from /Users/ehsan/moz/src/gfx/gl/SkiaGLGlue.cpp:19: 3:24.53 In file included from /Users/ehsan/moz/src/gfx/gl/GLContext.h:15: 3:24.53 In file included from /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/queue:169: 3:24.53 In file included from /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:158: 3:25.86 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__split_buffer:566:22: error: no matching function for call to 'Move' 3:25.86 __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d); 3:25.86 ^~~~~~~~~~~ 3:25.86 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__config:388:15: note: expanded from macro '_VSTD' 3:25.86 #define _VSTD std::_LIBCPP_NAMESPACE 3:25.86 ^ 3:25.87 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:2396:28: note: in instantiation of member function 'std::__1::__split_buffer<const mozilla::gl::GLContext::LocalErrorScope **, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope **> >::push_back' requested here 3:25.87 __base::__map_.push_back(__alloc_traits::allocate(__a, __base::__block_size)); 3:25.87 ^ 3:25.87 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:1768:9: note: in instantiation of member function 'std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> >::__add_back_capacity' requested here 3:25.87 __add_back_capacity(); 3:25.87 ^ 3:25.87 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/stack:197:36: note: in instantiation of member function 'std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> >::push_back' requested here 3:25.87 void push(value_type&& __v) {c.push_back(_VSTD::move(__v));} 3:25.87 ^ 3:25.87 /Users/ehsan/moz/src/gfx/gl/GLContext.h:641:39: note: in instantiation of member function 'std::__1::stack<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> > >::push' requested here 3:25.87 mGL.mLocalErrorScopeStack.push(this); 3:25.87 ^ 3:25.87 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__bit_reference:696:1: note: candidate template ignored: could not match '__bit_iterator<type-parameter-0-0, _IsConst, 0>' against 'const mozilla::gl::GLContext::LocalErrorScope ***' 3:25.87 move(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) 3:25.87 ^ 3:26.12 /Users/ehsan/moz/src/gfx/skia/skia/include/config/../private/SkTLogic.h:45:16: note: expanded from macro 'move' 3:26.12 #define move Move 3:26.12 ^ 3:26.12 /Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/include/mozilla/Move.h:201:1: note: candidate function template not viable: requires single argument 'aX', but 3 arguments were provided 3:26.22 Move(T&& aX) 3:26.22 ^ 3:26.23 In file included from /Users/ehsan/moz/src/gfx/gl/SkiaGLGlue.cpp:19: 3:26.23 In file included from /Users/ehsan/moz/src/gfx/gl/GLContext.h:15: 3:26.23 In file included from /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/queue:169: 3:26.23 In file included from /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:158: 3:26.26 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__split_buffer:566:22: error: no matching function for call to 'Move' 3:26.26 __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d); 3:26.26 ^~~~~~~~~~~ 3:26.26 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__config:388:15: note: expanded from macro '_VSTD' 3:26.26 #define _VSTD std::_LIBCPP_NAMESPACE 3:26.26 ^ 3:26.26 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:2418:15: note: in instantiation of member function 'std::__1::__split_buffer<const mozilla::gl::GLContext::LocalErrorScope **, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope **> &>::push_back' requested here 3:26.26 __buf.push_back(__hold.get()); 3:26.26 ^ 3:26.26 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/deque:1768:9: note: in instantiation of member function 'std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> >::__add_back_capacity' requested here 3:26.26 __add_back_capacity(); 3:26.26 ^ 3:26.26 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/stack:197:36: note: in instantiation of member function 'std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> >::push_back' requested here 3:26.26 void push(value_type&& __v) {c.push_back(_VSTD::move(__v));} 3:26.27 ^ 3:26.27 /Users/ehsan/moz/src/gfx/gl/GLContext.h:641:39: note: in instantiation of member function 'std::__1::stack<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::deque<const mozilla::gl::GLContext::LocalErrorScope *, std::__1::allocator<const mozilla::gl::GLContext::LocalErrorScope *> > >::push' requested here 3:26.36 mGL.mLocalErrorScopeStack.push(this); 3:26.36 ^ 3:26.36 /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/../include/c++/v1/__bit_reference:696:1: note: candidate template ignored: could not match '__bit_iterator<type-parameter-0-0, _IsConst, 0>' against 'const mozilla::gl::GLContext::LocalErrorScope ***' 3:26.36 move(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) 3:26.36 ^ 3:26.36 /Users/ehsan/moz/src/gfx/skia/skia/include/config/../private/SkTLogic.h:45:16: note: expanded from macro 'move' 3:26.36 #define move Move 3:26.36 ^ 3:26.36 /Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/include/mozilla/Move.h:201:1: note: candidate function template not viable: requires single argument 'aX', but 3 arguments were provided 3:26.36 Move(T&& aX) 3:26.36 ^ 3:26.36 BUILDSTATUS OBJECT_FILE Unified_cpp_dom_svg1.o 3:26.36 5 errors generated. 3:26.36 I tried hard to fix these but I can't figure out what has changed that triggers these new issues. Lee, can you please look into this? As things stand I can't build Firefox any more. :( Thanks!
Flags: needinfo?(lsalzman)
It seems like at least one of the problems is caused by "move" in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:2697 being replaced with "Move" because of the macro. This is the code on that line: traits_type::move(__p + __pos, __s, __n); It would be *really* nice if we didn't use macros like this. This is really fragile.
Can we add proper configure checks that define the MOZ_SKIA macro only when your standard library doesn't support these features?
This patch is just a re-run of an older patch I was going to use. It just detects if we're using MSVC, libc++, or newer libstdc++. If so, it avoids all the Skia hacks I was doing. It also adds a header wrapper around type_traits for correctness. Builds on try seem to be looking healthy with it: https://treeherder.mozilla.org/#/jobs?repo=try&revision=0147a3a37755
Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Flags: needinfo?(lsalzman)
Attachment #8747171 - Flags: review?(nfroyd)
Attachment #8747171 - Flags: review?(nfroyd) → review+
Depends on: 1269171
Comment on attachment 8747171 [details] [diff] [review] allow Skia to use C++11 features on platforms that have them Review of attachment 8747171 [details] [diff] [review]: ----------------------------------------------------------------- Not sure why Treeherder accepted the typo. In file included from image/Unified_cpp_image0.cpp:83: In file included from image/ImageCacheKey.cpp:13: In file included from dist/include/mozilla/dom/workers/ServiceWorkerManager.h:13: In file included from dist/include/ipc/IPCMessageUtils.h:10: In file included from ipc/chromium/src/base/process_util.h:28: In file included from /usr/include/c++/v1/map:442: /usr/include/c++/v1/__tree:585:24: error: no template named 'Forward' in namespace 'std::__1'; did you mean simply 'Forward'? : __value_(_VSTD::forward<_Args>(__args)...) {} ^~~~~~~ /usr/include/c++/v1/__config:425:15: note: expanded from macro '_VSTD' #define _VSTD std::_LIBCPP_NAMESPACE ^ gfx/skia/skia/include/core/../private/../private/SkTLogic.h:31:18: note: 'Forward' declared here using mozilla::Forward; ^ ::: gfx/skia/skia/include/private/SkTLogic.h @@ +20,5 @@ > #include <memory> > #include <algorithm> > #include <functional> > > +#ifdef MOZ_SKIA_AVOID_CXX11 |#ifdef FOO| won't work with |#define FOO 0|, the value is discarded. Maybe replace use |#if FOO| instead.
Attachment #8747171 - Flags: feedback-
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Thanks a lot for the quick fix!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: