Bug 230464 - www/webkit2-gtk3: fails to build with libc++ 7
Summary: www/webkit2-gtk3: fails to build with libc++ 7
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gnome mailing list
URL:
Keywords: needs-patch
Depends on:
Blocks: 230355
  Show dependency treegraph
 
Reported: 2018-08-08 17:28 UTC by Jan Beich
Modified: 2018-08-23 17:34 UTC (History)
1 user (show)

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


Attachments
Stop Optional.h from defining its own bad_optional_access (1.24 KB, patch)
2018-08-22 06:00 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 Jan Beich freebsd_committer 2018-08-08 17:28:54 UTC
$ poudriere jail -cj clang7 -a amd64 -v projects/clang700-import -m svn+https
$ poudriere testport -j clang7 www/webkit2-gtk3
[...]
In file included from Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
In file included from Source/JavaScriptCore/bytecode/ArrayProfile.h:29:
In file included from Source/JavaScriptCore/runtime/Structure.h:28:
In file included from Source/JavaScriptCore/runtime/ClassInfo.h:25:
In file included from Source/JavaScriptCore/interpreter/CallFrame.h:30:
In file included from Source/JavaScriptCore/runtime/VM.h:40:
In file included from Source/JavaScriptCore/runtime/FunctionHasExecutedCache.h:28:
In file included from /usr/include/c++/v1/unordered_map:385:
In file included from /usr/include/c++/v1/__node_handle:16:
/usr/include/c++/v1/optional:171:29: error: redefinition of 'bad_optional_access'
class _LIBCPP_EXCEPTION_ABI bad_optional_access
                            ^
DerivedSources/ForwardingHeaders/wtf/Optional.h:295:7: note: previous definition is here
class bad_optional_access : public std::logic_error {
      ^

build log: https://ptpb.pw/GBGh
Comment 1 Jan Beich freebsd_committer 2018-08-08 17:33:36 UTC
Regressed by https://reviews.llvm.org/rL338472 likely due to #include <optional>
Comment 2 Dimitry Andric freebsd_committer 2018-08-22 06:00:07 UTC
Created attachment 196436 [details]
Stop Optional.h from defining its own bad_optional_access

I tried making webkit use libc++'s <optional> header, but it is too reliant on internal details of its own implementation.  Maybe that will be fixed by upstream at some later point, and when they switch to C++17. :)

In any case, I've attempted to work around the error by simply not defining bad_optional_access in Optional.h, if libc++ 7.0.0 is used.  This makes the port build for me.
Comment 3 commit-hook freebsd_committer 2018-08-22 19:38:22 UTC
A commit references this bug:

Author: jbeich
Date: Wed Aug 22 19:38:09 UTC 2018
New revision: 477812
URL: https://svnweb.freebsd.org/changeset/ports/477812

Log:
  www/webkit2-gtk3, java/openjfx8-devel: unbreak with libc++ 7

  In file included from Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
  In file included from Source/JavaScriptCore/bytecode/ArrayProfile.h:29:
  In file included from Source/JavaScriptCore/runtime/Structure.h:28:
  In file included from Source/JavaScriptCore/runtime/ClassInfo.h:25:
  In file included from Source/JavaScriptCore/interpreter/CallFrame.h:30:
  In file included from Source/JavaScriptCore/runtime/VM.h:40:
  In file included from Source/JavaScriptCore/runtime/FunctionHasExecutedCache.h:28:
  In file included from /usr/include/c++/v1/unordered_map:385:
  In file included from /usr/include/c++/v1/__node_handle:16:
  /usr/include/c++/v1/optional:171:29: error: redefinition of 'bad_optional_access'
  class _LIBCPP_EXCEPTION_ABI bad_optional_access
                              ^
  DerivedSources/ForwardingHeaders/wtf/Optional.h:295:7: note: previous definition is here
  class bad_optional_access : public std::logic_error {
        ^

  PR:		230464 230600
  Submitted by:	dim

Changes:
  head/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_Optional.h
  head/www/webkit2-gtk3/files/patch-Source_WTF_wtf_Optional.h