Bug 217226 - devel/llvm40: Assertion failed: (it != OpaqueRValues.end() && "no mapping for opaque value!"), function getOpaqueRValueMapping, file /tmp/usr/ports/devel/llvm40/work/llvm-4.0.0rc1.src/tools/clang/lib/CodeGen/CodeGenFunction.h, line 2008.
Summary: devel/llvm40: Assertion failed: (it != OpaqueRValues.end() && "no mapping for...
Status: Closed Overcome By Events
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:
Depends on:
Blocks:
 
Reported: 2017-02-19 11:29 UTC by Laurence 'GreenReaper' Parry
Modified: 2017-02-19 16:23 UTC (History)
0 users

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


Attachments
Failed build output (5.04 KB, text/plain)
2017-02-19 11:29 UTC, Laurence 'GreenReaper' Parry
no flags Details
Configure step (was compiling with llvm40 r1) (17.29 KB, text/plain)
2017-02-19 11:34 UTC, Laurence 'GreenReaper' Parry
no flags Details
AsmParser cpp intermediate file (7z compressed) (498.67 KB, application/octet-stream)
2017-02-19 11:37 UTC, Laurence 'GreenReaper' Parry
no flags Details
AsmParser sh intermediate file (7.48 KB, text/plain)
2017-02-19 11:37 UTC, Laurence 'GreenReaper' Parry
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurence 'GreenReaper' Parry 2017-02-19 11:29:58 UTC
Created attachment 180138 [details]
Failed build output

Compilation of llvm40-4.0.0.r2 (CLANG, GOLD, OPENMP) failed in a jail on FreeBSD 10.3-RELEASE-p11 with an assertion, along with other warnings:
---

 /tmp/usr/ports/devel/llvm40/work/llvm-4.0.0rc2.src/lib/MC/MCParser/AsmParser.cpp:2043:25: warning: variable 'CppHashLocLineNo' is uninitialized when used here [-Wuninitialized]
        LastQueryLine = CppHashLocLineNo;
                        ^~~~~~~~~~~~~~~~
 /tmp/usr/ports/devel/llvm40/work/llvm-4.0.0rc2.src/lib/MC/MCParser/AsmParser.cpp:2036:32: note: initialize the variable 'CppHashLocLineNo' to silence this warning
      unsigned CppHashLocLineNo;
                               ^
                                = 0
 /tmp/usr/ports/devel/llvm40/work/llvm-4.0.0rc2.src/lib/MC/MCParser/AsmParser.cpp:2155:71: warning: variable 'LineNo' is uninitialized when used here [-Wuninitialized] 
  SMDiagnostic NewDiag(*Diag.getSourceMgr(), Diag.getLoc(), Filename, LineNo,
                                                                      ^~~~~~
 /tmp/usr/ports/devel/llvm40/work/llvm-4.0.0rc2.src/lib/MC/MCParser/AsmParser.cpp:2152:13: note: initialize the variable 'LineNo' to silence this warning
  int LineNo =
            ^
             = 0
 Assertion failed: (it != OpaqueRValues.end() && "no mapping for opaque value!"), function getOpaqueRValueMapping, file /tmp/usr/ports/devel/llvm40/work/llvm-4.0.0rc1.src/tools/clang/lib/CodeGen/CodeGenFunction.h, line 2008.

---

The error messages seem similar to those mentioned in:
https://bugs.llvm.org//show_bug.cgi?id=31723
https://bugs.llvm.org//show_bug.cgi?id=31692

That was apparently fixed in this revision, which occurred several weeks before rc2 (but perhaps it has not been cherry-picked for 4.0 yet?)
http://llvm.org/viewvc/llvm-project?view=revision&revision=291318
Comment 1 Laurence 'GreenReaper' Parry 2017-02-19 11:34:27 UTC
Created attachment 180139 [details]
Configure step (was compiling with llvm40 r1)

Will also try to build with base system llvm.
Comment 2 Laurence 'GreenReaper' Parry 2017-02-19 11:37:05 UTC
Created attachment 180140 [details]
AsmParser cpp intermediate file (7z compressed)
Comment 3 Laurence 'GreenReaper' Parry 2017-02-19 11:37:24 UTC
Created attachment 180141 [details]
AsmParser sh intermediate file
Comment 4 Laurence 'GreenReaper' Parry 2017-02-19 16:23:59 UTC
The port compiles and installs with base llvm. Once it is installed, recompiling with llvm 4.0 r2 also works, albeit with a few of these warnings on install 

--->  Installing the new version via the port
clang40: not found
make: "/usr/ports/Mk/Uses/compiler.mk" line 69: warning: "clang40 --version" returned non-zero status
make: "/usr/ports/Mk/Uses/compiler.mk" line 120: warning: "clang++40 -### /dev/null 2>&1" returned non-zero status
Hopefully the above warnings - which I'm guessing indicate that COMPILER_VERSION has been misdefined and COMPILER_FEATURES has been set to libstdc++ rather than libc++ - are not causing any other issues.

Presumably the main issue was merely in the previous rc1 and only occurs when compiling with it.

I guess I had the misconception from GCC that llvm port bootstraps itself, but either it does not or a portion of the resulting code was non-viable in this case.