<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Compiler crash when cross-compiling lz4"
   href="https://bugs.llvm.org/show_bug.cgi?id=36487">36487</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Compiler crash when cross-compiling lz4
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gk@torproject.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19934" name="attach_19934" title="lz4-preprocessed source">attachment 19934</a> <a href="attachment.cgi?id=19934&action=edit" title="lz4-preprocessed source">[details]</a></span>
lz4-preprocessed source

Over at Mozilla's <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1390583">https://bugzilla.mozilla.org/show_bug.cgi?id=1390583</a> we are
trying to get Firefox cross-compiled for Windows using clang. This works thanks
to the efforts by Martin Storsjö and others if I compile Firefox 52 ESR (the
current long-term support version of Firefox). However, clang crashes during
compilation of the latest Mozilla code after lz4 got updated to version 1.8.0.

Here is the stack trace and bit of info and attached is the preprocessed source
and the associated run script.

 1:21.66 #0 0x000055d9043c9b9a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1614b9a)
 1:21.66 #1 0x000055d9043c7a3e llvm::sys::RunSignalHandlers()
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1612a3e)
 1:21.66 #2 0x000055d9043c7b8c SignalHandler(int)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1612b8c)
 1:21.66 #3 0x00007fb418711180 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12180)
 1:21.66 #4 0x00007fb41724c6a0 gsignal
(/lib/x86_64-linux-gnu/libc.so.6+0x346a0)
 1:21.66 #5 0x00007fb41724dcf7 abort (/lib/x86_64-linux-gnu/libc.so.6+0x35cf7)
 1:21.66 #6 0x00007fb417244fca (/lib/x86_64-linux-gnu/libc.so.6+0x2cfca)
 1:21.66 #7 0x00007fb417245042 (/lib/x86_64-linux-gnu/libc.so.6+0x2d042)
 1:21.66 #8 0x000055d90379fd65
llvm::X86FrameLowering::emitPrologue(llvm::MachineFunction&,
llvm::MachineBasicBlock&) const
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x9ead65)
 1:21.66 #9 0x000055d903d97df8 (anonymous
namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0xfe2df8)
 1:21.66 #10 0x000055d903b9aa35
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0xde5a35)
 1:21.66 #11 0x000055d903f4d563
llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1198563)
 1:21.66 #12 0x000055d903f4d624 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1198624)
 1:21.66 #13 0x000055d903f4e241
llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1199241)
 1:21.66 #14 0x000055d904597e0e (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x17e2e0e)
 1:21.66 #15 0x000055d90459956c
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions
const&, clang::CodeGenOptions const&, clang::TargetOptions const&,
clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*,
clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x17e456c)
 1:21.66 #16 0x000055d904cfc104
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1f47104)
 1:21.66 #17 0x000055d9051c7340 clang::ParseAST(clang::Sema&, bool, bool)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x2412340)
 1:21.66 #18 0x000055d904cfb2b9 clang::CodeGenAction::ExecuteAction()
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1f462b9)
 1:21.66 #19 0x000055d904985236 clang::FrontendAction::Execute()
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1bd0236)
 1:21.67 #20 0x000055d90494d586
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1b98586)
 1:21.67 #21 0x000055d904a1ba91
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x1c66a91)
 1:21.67 #22 0x000055d903732440 cc1_main(llvm::ArrayRef<char const*>, char
const*, void*)
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x97d440)
 1:21.67 #23 0x000055d9036e94b5 main
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x9344b5)
 1:21.67 #24 0x00007fb417238f2a __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20f2a)
 1:21.67 #25 0x000055d90372e55a _start
(/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0+0x97955a)
 1:21.67 Stack dump:
 1:21.67 0.     Program arguments:
/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/bin/clang-7.0 -cc1
-triple x86_64-w64-windows-gnu -emit-obj -disable-free -main-file-name lz4.c
-mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim
-relaxed-aliasing -masm-verbose -mconstructor-aliases -mms-bitfields
-munwind-tables -target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited
-dwarf-version=4 -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file
/home/thomas/Arbeit/Tor/debugging/21777/obj-mingw/mfbt/lz4.gcno -resource-dir
/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/lib/clang/7.0.0
-dependency-file .deps/lz4.o.pp -MT lz4.o -sys-header-deps -MP -include
/home/thomas/Arbeit/Tor/debugging/21777/obj-mingw/mozilla-config.h -D NDEBUG=1
-D TRIMMED=1 -D IMPL_MFBT -D LZ4LIB_VISIBILITY= -I
/home/thomas/Arbeit/Tor/debugging/21777/mfbt -I
/home/thomas/Arbeit/Tor/debugging/21777/obj-mingw/mfbt -I
/home/thomas/Arbeit/Tor/debugging/21777/mfbt/double-conversion -I
/home/thomas/Arbeit/Tor/debugging/21777/obj-mingw/dist/include -I
/home/thomas/Arbeit/Tor/debugging/21777/obj-mingw/dist/include/nspr -I
/home/thomas/Arbeit/Tor/debugging/21777/obj-mingw/dist/include/nss -D
MOZILLA_CLIENT -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -U _FORTIFY_SOURCE -D
_FORTIFY_SOURCE=2 -isysroot
/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/x86_64-w64-mingw32
-internal-isystem
/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/lib/clang/7.0.0/include
-internal-isystem
/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include
-internal-isystem
/home/thomas/Arbeit/Tor/debugging/win59/clang_toolchain/x86_64-w64-mingw32/include
-O2 -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare
-Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wclass-varargs
-Wloop-analysis -Wstring-conversion -Wno-error=deprecated-declarations
-Wno-error=array-bounds -Wno-unknown-pragmas -Wno-unused-function
-Wno-conversion-null -Wno-switch -Wno-enum-compare
-Wno-gnu-zero-variadic-macro-arguments -std=gnu99 -fdebug-compilation-dir
/home/thomas/Arbeit/Tor/debugging/21777/obj-mingw/mfbt -ferror-limit 19
-fmessage-length 0 -fno-use-cxa-atexit -fobjc-runtime=gcc -fdwarf-exceptions
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o lz4.o -x c
/home/thomas/Arbeit/Tor/debugging/21777/mfbt/lz4.c
 1:21.67 1.     <eof> parser at end of file
 1:21.67 2.     Code generation
 1:21.67 3.     Running pass 'Function Pass Manager' on module
'/home/thomas/Arbeit/Tor/debugging/21777/mfbt/lz4.c'.
 1:21.67 4.     Running pass 'Prologue/Epilogue Insertion & Frame Finalization'
on function '@LZ4_compress'
 1:21.67 clang-7.0: error: unable to execute command: Aborted
 1:21.67 clang-7.0: error: clang frontend command failed due to signal (use -v
to see invocation)
 1:21.67 clang version 7.0.0 (<a href="https://git.llvm.org/git/clang">https://git.llvm.org/git/clang</a>
0972dc790621cb6c6718ef9a5090a993cc0724c2) (<a href="https://github.com/llvm-mirror/llvm">https://github.com/llvm-mirror/llvm</a>
d5784797c6647bd72ab37232ab432785a04a71df)
 1:21.67 Target: x86_64-w64-windows-gnu
 1:21.67 Thread model: posix</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>