$ poudriere jail -cj head-aarch64 -x -a arm64.aarch64 -v head -m svn+https $ poudriere testport -j head-aarch64 java/openjdk8 [...] Compiling /usr/ports/java/openjdk8/work/openjdk/hotspot/src/share/vm/oops/instanceKlass.cpp Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /usr/src/contrib/llvm/include/llvm/Support/Casting.h, line 255. c++: error: unable to execute command: Abort trap (core dumped) c++: error: clang frontend command failed due to signal (use -v to see invocation) FreeBSD clang version 8.0.0 (branches/release_80 355677) (based on LLVM 8.0.0) Target: aarch64-unknown-freebsd13.0 Thread model: posix InstalledDir: /usr/bin http://thunderx1.nyi.freebsd.org/data/head-arm64-default/p495404_s345044/logs/errors/openjdk8-8.202.8.log
Created attachment 202897 [details] instanceKlass.cpp (compressed, preprocessed)
Created attachment 202898 [details] command line args (for clang 8)
Ditto armv7. $ poudriere jail -cj head-armv7 -x -a arm.armv7 -v head -m svn+https $ poudriere testport -j head-armv7 java/openjdk8 [...] Compiling /usr/ports/java/openjdk8/work/openjdk/hotspot/src/share/vm/oops/instanceKlass.cpp Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /usr/src/contrib/llvm/include/llvm/Support/Casting.h, line 255. c++: error: unable to execute command: Abort trap (core dumped) c++: error: clang frontend command failed due to signal (use -v to see invocation) FreeBSD clang version 8.0.0 (branches/release_80 355677) (based on LLVM 8.0.0) Target: armv7-unknown-freebsd13.0-gnueabihf Thread model: posix InstalledDir: /usr/bin http://www.ipv6proxy.net/go.php?u=http://beefy16.nyi.freebsd.org/data/head-armv7-default/p495681_s345110/logs/errors/openjdk8-8.202.8.log
Reproduced, minimized and submitted upstream here: https://bugs.llvm.org/show_bug.cgi?id=41117
Created attachment 203870 [details] jdk-use-ports-clang.patch For now it's possible to use clang from ports, which has assertions disabled (as it should be — LLVM officially does not enable them in production). I tested the resulting build with the Clojure REPL, works fine.
Comment on attachment 203870 [details] jdk-use-ports-clang.patch devel/llvm* bypass native-xtools which makes cross-builds (via qemu-user-static) very slow. I'd prefer __attribute__((optnone)) limited to the affected function or -O1 limited to the affected file. Besides, armv7 needs the workaround as well.
(In reply to Jan Beich from comment #6) Only the jvm and a small part of the jdk needs a c++ compiler, qemu won't add much time to the build.
Any chance we can come up with a reasonable workaround for this based on what's done? This did not get fixed for clang9.
(In reply to Kyle Evans from comment #8) I've found that upstream's https://reviews.llvm.org/rL370114 appears to fix this, but I'm waiting for a little while for confirmation from the author.
A commit references this bug: Author: dim Date: Fri Nov 15 06:56:25 UTC 2019 New revision: 354724 URL: https://svnweb.freebsd.org/changeset/base/354724 Log: Merge commit 5bbb604bb from llvm git (by Craig Topper): [InstCombine] Disable some portions of foldGEPICmp for GEPs that return a vector of pointers. Fix other portions. llvm-svn: 370114 This should fix instances of 'Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /usr/src/contrib/llvm/include/llvm/Support/Casting.h, line 255', when building openjdk8 for aarch64 and armv7. Reported by: jbeich PR: 236566 MFC after: 3 days Changes: head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
A commit references this bug: Author: dim Date: Mon Nov 18 07:04:59 UTC 2019 New revision: 354803 URL: https://svnweb.freebsd.org/changeset/base/354803 Log: MFC r354724: Merge commit 5bbb604bb from llvm git (by Craig Topper): [InstCombine] Disable some portions of foldGEPICmp for GEPs that return a vector of pointers. Fix other portions. llvm-svn: 370114 This should fix instances of 'Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /usr/src/contrib/llvm/include/llvm/Support/Casting.h, line 255', when building openjdk8 for aarch64 and armv7. Reported by: jbeich PR: 236566 Changes: _U stable/11/ stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp _U stable/12/ stable/12/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
^Triage: Re-classify (base), track merges, assign to committer that resolved