Bug 228320 - lang/v8 fails to build on 11.2-BETA1
Summary: lang/v8 fails to build on 11.2-BETA1
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: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-17 17:15 UTC by mgrooms
Modified: 2018-06-19 21:47 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mgrooms 2018-05-17 17:15:12 UTC
I believe this is due to 11.2 containing a newer version of LLVM. If I add the following to the Makefile, the build completes successfully.

Makefile Diff ...

--- Makefile.old        2018-05-17 11:45:28.661295000 -0500
+++ Makefile    2018-05-17 11:45:45.353226000 -0500
@@ -39,6 +39,9 @@
 CXXFLAGS+=     -Wno-tautological-undefined-compare
 .if ${COMPILER_VERSION} >= 36
 CXXFLAGS+=     -Wno-unused-local-typedef
+.if ${COMPILER_VERSION} >= 60
+CXXFLAGS+=     -Wno-null-pointer-arithmetic -Wno-vexing-parse
+.endif
 .endif
 .endif
 .endif


Source code diff ( not sure how to make that conditional on clang 6.0 ) ...

--- src/stub-cache.cc.old       2018-05-17 12:13:38.104285000 -0500
+++ src/stub-cache.cc   2018-05-17 12:13:53.180471000 -0500
@@ -1474,7 +1474,7 @@
                                             Handle<Name> name) {
   return (FLAG_print_code_stubs && !name.is_null() && name->IsString())
       ? GetCodeWithFlags(flags, *Handle<String>::cast(name)->ToCString())
-      : GetCodeWithFlags(flags, reinterpret_cast<char*>(NULL));
+      : GetCodeWithFlags(flags, static_cast<char*>(NULL));
 }
Comment 1 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-06-18 14:18:22 UTC
Please try https://people.FreeBSD.org/~sunpoet/patch/lang-v8.txt
Comment 2 mgrooms 2018-06-18 19:23:37 UTC
Yes. After applying that diff to the ports tree, it appears to build correctly on 11.2-RC3. Thanks for putting that together. Note: I posted a similar patch for mongodb which also fails to build with a newer version of clang.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-06-19 21:47:15 UTC
A commit references this bug:

Author: sunpoet
Date: Tue Jun 19 21:46:27 UTC 2018
New revision: 472824
URL: https://svnweb.freebsd.org/changeset/ports/472824

Log:
  Fix build with Clang 6

  PR:		228320
  Submitted by:	Matthew Grooms <mgrooms@shrew.net>

Changes:
  head/lang/v8/Makefile
  head/lang/v8/files/extra-patch-src-stub-cache.cc
Comment 4 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-06-19 21:47:20 UTC
Committed. Thanks!