Bug 208270 - www/node: Fix build with libc++ 3.8.0
Summary: www/node: Fix build with libc++ 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 208158
  Show dependency treegraph
 
Reported: 2016-03-24 22:50 UTC by Dimitry Andric
Modified: 2016-04-02 15:52 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (linpct)


Attachments
Fix several std::map declarations in www/node (4.17 KB, patch)
2016-03-24 22:50 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2016-03-24 22:50:59 UTC
Created attachment 168585 [details]
Fix several std::map declarations in www/node

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.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/node-5.9.0.log
Comment 1 linpct 2016-03-27 06:11:49 UTC
Comment on attachment 168585 [details]
Fix several std::map declarations in www/node

Maintainer approved.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-04-02 15:51:23 UTC
A commit references this bug:

Author: dim
Date: Sat Apr  2 15:51:19 UTC 2016
New revision: 412412
URL: https://svnweb.freebsd.org/changeset/ports/412412

Log:
  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

Changes:
  head/www/node/files/patch-deps_v8_src_compiler_instruction.h
  head/www/node/files/patch-deps_v8_src_compiler_js-type-feedback.h
  head/www/node/files/patch-deps_v8_src_zone-containers.h