Open 1b2719f9-fd5c-4fac-b091-4efad0235ed7 opened 4 years ago
Note that the attached failure isn't useful (or possibly correct) C code.
The code is a heavy reduction of the code created when using the STAP_PROBE macros found in /usr/include/aarch64-linux-gnu/sys/sdt.h. These macros create a large block of asm volatile code. When used they create exactly the same error as my 1 line attached file.
An alternative, more real-world way of producing the same error is by simply using:
void func() { STAP_PROBE1("a","b","c"); };
Ok, I've reduced this down to a single line!
$ cat volatile.cpp void func() { asm volatile ("\n" :: "nop" ("")); }
$ /home/alahay01/llvm/clang-2020-01-17_14-50-39-b21031/bin/clang-11 -c volatile.cpp clang-11: /home/buildslave/buildslave/clang-aarch64-linux-build-cache/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8383: void llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite): Assertion `ConstraintID != InlineAsm::Constraint_Unknown && "Failed to convert memory constraint code to constraint id."' failed. Stack dump:
clang-11: error: clang frontend command failed due to signal (use -v to see invocation) clang version 11.0.0 (/home/buildslave/buildslave/clang-aarch64-linux-build-cache/llvm/clang 8eb4d25a0943bce6e8a4859825dce4f67a4f6384) Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /home/alahay01/llvm/clang-2020-01-17_14-50-39-b21031/bin clang-11: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. clang-11: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-11: note: diagnostic msg: /tmp/volatile-f5dca4.cpp clang-11: note: diagnostic msg: /tmp/volatile-f5dca4.sh clang-11: note: diagnostic msg:
LLVM ERROR: out of memory Aborted
the produced cpp file is 274001 lines / 11M. I'll try and reduce this down a little and update next week.
CPP file is too big to attach. Finding a way to work around.
Extended Description
Using this build: http://lab.llvm.org:8011/builders/clang-aarch64-linux-build-cache/builds/21031 On Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-45-generic aarch64)
Building OpenJDK recent HEAD (Fri Jan 17 16:17:22 2020 +0100) from http://hg.openjdk.java.net/jdk/jdk
Firstly, I needed to add extra Cflags to prevent new warnings. See the attached flag.diff
I then configure and built with: JAVA_HOME=/usr/java/jdk-12.0.1+12/ CC=clang CXX=clang++ bash ../../configure --with-toolchain-type=clang --with-debug-level=release; make images JOBS=55
The following error occurs part way through the build.
clang++: /home/buildslave/buildslave/clang-aarch64-linux-build-cache/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8383: void llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite): Assertion `ConstraintID != InlineAsm::Constraint_Unknown && "Failed to convert memory constraint code to constraint id."' failed. Stack dump:
0 0x00000000019e9cec PrintStackTraceSignalHandler(void*) (/home/alahay01/llvm/clang-2020-01-17_14-50-39-b21031/bin//clang+++0x19e9cec)
clang-11: error: clang frontend command failed due to signal (use -v to see invocation) clang version 11.0.0 (/home/buildslave/buildslave/clang-aarch64-linux-build-cache/llvm/clang 8eb4d25a0943bce6e8a4859825dce4f67a4f6384) Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /home/alahay01/llvm/clang-2020-01-17_14-50-39-b21031/bin clang-11: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. clang-11: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-11: note: diagnostic msg: /tmp/compileBroker-123210.cpp clang-11: note: diagnostic msg: /tmp/compileBroker-123210.sh clang-11: note: diagnostic msg:
Running the newly created script reproduced the error.