summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-04-02 15:51:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-04-02 15:51:18 +0000
commit1a5396aa84586461ffe07ae43e599bf385673698 (patch)
treee67e6bdd9a2fc215c6b6cafca8eee1b0978fca24
parentUpdate to 1.2.0 (diff)
During the exp-run in bug 208158, it was found that www/node gives
errors with libc++ 3.8.0 [1]: /usr/include/c++/v1/map:837:5: error: static_assert failed "Allocator::value_type must be same type as value_type" static_assert((is_same<typename allocator_type::value_type, value_type>::value), ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../deps/v8/src/compiler/js-type-feedback.h:41:21: note: in instantiation of template class 'std::__1::map<unsigned int, v8::internal::TypeFeedbackId, std::__1::less<unsigned int>, v8::internal::zone_allocator<v8::internal::TypeFeedbackId> >' requested here TypeFeedbackIdMap type_feedback_id_map_; ^ This is because libc++ 3.8.0 has added these sanity checks for custom std::map allocators, which *must* be of the type std::pair<const Key, Value>. I fixed the few std::map instances in the node source by adding this to their allocator types. Approved by: linpct@gmail.com (maintainer) PR: 208270 MFH: 2016Q2
-rw-r--r--www/node/files/patch-deps_v8_src_compiler_instruction.h11
-rw-r--r--www/node/files/patch-deps_v8_src_compiler_js-type-feedback.h15
-rw-r--r--www/node/files/patch-deps_v8_src_zone-containers.h18
3 files changed, 44 insertions, 0 deletions
diff --git a/www/node/files/patch-deps_v8_src_compiler_instruction.h b/www/node/files/patch-deps_v8_src_compiler_instruction.h
new file mode 100644
index 000000000000..9868d91d7b47
--- /dev/null
+++ b/www/node/files/patch-deps_v8_src_compiler_instruction.h
@@ -0,0 +1,11 @@
+--- deps/v8/src/compiler/instruction.h.orig 2016-03-16 21:22:58.000000000 +0100
++++ deps/v8/src/compiler/instruction.h 2016-03-24 23:27:23.004854000 +0100
+@@ -1011,7 +1011,7 @@ class InstructionBlock final : public Zo
+
+ typedef ZoneDeque<Constant> ConstantDeque;
+ typedef std::map<int, Constant, std::less<int>,
+- zone_allocator<std::pair<int, Constant> > > ConstantMap;
++ zone_allocator<std::pair<const int, Constant> > > ConstantMap;
+
+ typedef ZoneDeque<Instruction*> InstructionDeque;
+ typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque;
diff --git a/www/node/files/patch-deps_v8_src_compiler_js-type-feedback.h b/www/node/files/patch-deps_v8_src_compiler_js-type-feedback.h
new file mode 100644
index 000000000000..a203b901872a
--- /dev/null
+++ b/www/node/files/patch-deps_v8_src_compiler_js-type-feedback.h
@@ -0,0 +1,15 @@
+--- deps/v8/src/compiler/js-type-feedback.h.orig 2016-03-16 21:22:58.000000000 +0100
++++ deps/v8/src/compiler/js-type-feedback.h 2016-03-24 22:54:54.529827000 +0100
+@@ -33,9 +33,10 @@ class JSTypeFeedbackTable : public ZoneO
+ private:
+ friend class JSTypeFeedbackSpecializer;
+ typedef std::map<NodeId, TypeFeedbackId, std::less<NodeId>,
+- zone_allocator<TypeFeedbackId> > TypeFeedbackIdMap;
++ zone_allocator<std::pair<const NodeId, TypeFeedbackId> > >
++ TypeFeedbackIdMap;
+ typedef std::map<NodeId, FeedbackVectorICSlot, std::less<NodeId>,
+- zone_allocator<FeedbackVectorICSlot> >
++ zone_allocator<std::pair<const NodeId, FeedbackVectorICSlot> > >
+ FeedbackVectorICSlotMap;
+
+ TypeFeedbackIdMap type_feedback_id_map_;
diff --git a/www/node/files/patch-deps_v8_src_zone-containers.h b/www/node/files/patch-deps_v8_src_zone-containers.h
new file mode 100644
index 000000000000..4724e794376e
--- /dev/null
+++ b/www/node/files/patch-deps_v8_src_zone-containers.h
@@ -0,0 +1,18 @@
+--- deps/v8/src/zone-containers.h.orig 2016-03-16 21:22:58.000000000 +0100
++++ deps/v8/src/zone-containers.h 2016-03-24 23:34:37.741885000 +0100
+@@ -114,12 +114,12 @@ class ZoneSet : public std::set<K, Compa
+ // a zone allocator.
+ template <typename K, typename V, typename Compare = std::less<K>>
+ class ZoneMap
+- : public std::map<K, V, Compare, zone_allocator<std::pair<K, V>>> {
++ : public std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>> {
+ public:
+ // Constructs an empty map.
+ explicit ZoneMap(Zone* zone)
+- : std::map<K, V, Compare, zone_allocator<std::pair<K, V>>>(
+- Compare(), zone_allocator<std::pair<K, V>>(zone)) {}
++ : std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
++ Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
+ };
+
+