Bug 236193 - devel/llvm40: fails to build with clang 8 (blocks 4 ports)
Summary: devel/llvm40: fails to build with clang 8 (blocks 4 ports)
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: Brooks Davis
URL:
Keywords: needs-patch
Depends on:
Blocks: 236062
  Show dependency treegraph
 
Reported: 2019-03-04 05:36 UTC by Jan Beich
Modified: 2019-03-07 18:32 UTC (History)
1 user (show)

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


Attachments
Apply upstream r291939 to fix lambda issues (12.12 KB, patch)
2019-03-07 06:58 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 2019-03-04 05:36:28 UTC
$ poudriere jail -cj clang8 -v projects/clang800-import -m svn+https
$ poudriere testport -j clang8 devel/llvm40
[...]
tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6275:24: error: a lambda parameter cannot shadow an explicitly captured entity
      CodeGenFunction &CGF, PrePostActionTy &) {
                       ^
tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6321:62: error: a lambda parameter cannot shadow an explicitly captured entity
  auto &&EndThenGen = [&CGF, Device, &Info](CodeGenFunction &CGF,
                                                             ^
tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6400:56: error: a lambda parameter cannot shadow an explicitly captured entity
  auto &&ThenGen = [&D, &CGF, Device](CodeGenFunction &CGF, PrePostActionTy &) {
                                                       ^

http://package18.nyi.freebsd.org/data/headamd64PR236062-default/2019-03-01_06h42m53s/logs/errors/llvm40-4.0.1_12.log
Comment 1 Jan Beich freebsd_committer 2019-03-04 23:31:12 UTC
Reminder: Clang 8 was merged to 13.0-CURRENT in base r344779. Maintainers, expect pkg-fallout@ mail soon.
Comment 2 Dimitry Andric freebsd_committer 2019-03-06 19:27:13 UTC
I get totally different compile errors on this port, which seems to be compiled with g++5 by default?

FAILED: lib/Demangle/CMakeFiles/LLVMDemangle.dir/ItaniumDemangle.cpp.o
/usr/local/bin/g++5  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Demangle -I/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle -Iinclude -I/wrkdirs/share/dim/ports/deve
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp: In instantiation of 'const char* parse_floating_number(const char*, const char*, C&) [with Float = float; C = {anonymous}::Db]':
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:2422:51:   required from 'const char* parse_expr_primary(const char*, const char*, C&) [with C = {anonymous}::Db]'
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:2926:33:   required from 'const char* parse_expression(const char*, const char*, C&) [with C = {anonymous}::Db]'                 /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:1517:39:   required from 'const char* parse_array_type(const char*, const char*, C&) [with C = {anonymous}::Db]'
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:1702:31:   required from 'const char* parse_type(const char*, const char*, C&) [with C = {anonymous}::Db]'
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:4180:31:   required from 'void demangle(const char*, const char*, C&, int&) [with C = {anonymous}::Db]'
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:4242:65:   required from here
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:142:23: error: 'snprintf' was not declared in this scope
       int n = snprintf(num, sizeof(num), float_data<Float>::spec, value);
                       ^
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp: In instantiation of 'const char* parse_floating_number(const char*, const char*, C&) [with Float = double; C = {anonymous}::Db]'
/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:2427:52:   required from 'const char* parse_expr_primary(const char*, const char*, C&) [with C = {anonymous}::Db]'               /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:2926:33:   required from 'const char* parse_expression(const char*, const char*, C&) [with C = {anonymous}::Db]'                 /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:1517:39:   required from 'const char* parse_array_type(const char*, const char*, C&) [with C = {anonymous}::Db]'                 /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:1702:31:   required from 'const char* parse_type(const char*, const char*, C&) [with C = {anonymous}::Db]'                       /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:4180:31:   required from 'void demangle(const char*, const char*, C&, int&) [with C = {anonymous}::Db]'                          /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:4242:65:   required from here                                                                                                    /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:142:23: error: 'snprintf' was not declared in this scope                                                                         /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp: In instantiation of 'const char* parse_floating_number(const char*, const char*, C&) [with Float = long double; C = {anonymous}:/wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:2432:57:   required from 'const char* parse_expr_primary(const char*, const char*, C&) [with C = {anonymous}::Db]'               /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:2926:33:   required from 'const char* parse_expression(const char*, const char*, C&) [with C = {anonymous}::Db]'                 /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:1517:39:   required from 'const char* parse_array_type(const char*, const char*, C&) [with C = {anonymous}::Db]'                 /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:1702:31:   required from 'const char* parse_type(const char*, const char*, C&) [with C = {anonymous}::Db]'                       /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:4180:31:   required from 'void demangle(const char*, const char*, C&, int&) [with C = {anonymous}::Db]'                          /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:4242:65:   required from here                                                                                                    /wrkdirs/share/dim/ports/devel/llvm40/work/llvm-4.0.1.src/lib/Demangle/ItaniumDemangle.cpp:142:23: error: 'snprintf' was not declared in this scope
Comment 3 Dimitry Andric freebsd_committer 2019-03-06 19:27:53 UTC
Oh I see, there is this horrid hack in the port Makefile:

# Force GCC 5 on non-clang systems because GCC 8 won't compile this code.                                                                                                                                                   .if exists(/usr/lib/libstdc++.so)
USE_GCC=        5
.endif

Apparently gcc 8 also doesn't like the code :)
Comment 4 Jan Beich freebsd_committer 2019-03-06 21:34:28 UTC
(In reply to Dimitry Andric from comment #2)
> lib/Demangle/ItaniumDemangle.cpp:142:23: error: 'snprintf' was not declared in this scope
>        int n = snprintf(num, sizeof(num), float_data<Float>::spec, value);
                       ^

Maybe caused by bug 193528. Can you reproduce with later GCC versions?
Comment 5 Dimitry Andric freebsd_committer 2019-03-07 06:58:39 UTC
Created attachment 202672 [details]
Apply upstream r291939 to fix lambda issues

Here's a patch which fixes the compilation issues, adapted from upstream <https://reviews.llvm.org/rL291939>.
Comment 6 commit-hook freebsd_committer 2019-03-07 17:25:44 UTC
A commit references this bug:

Author: brooks
Date: Thu Mar  7 17:25:30 UTC 2019
New revision: 494964
URL: https://svnweb.freebsd.org/changeset/ports/494964

Log:
  Apply upstream r291939 to fix lambda issues.

  This fixes build with clang 8.0.0.

  PR:		236193
  Submitted by:	dim

Changes:
  head/devel/llvm40/Makefile
  head/devel/llvm40/files/clang-patch-svn-r291939