<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - clang fails to compile ruby"
   href="https://llvm.org/bugs/show_bug.cgi?id=27502">27502</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang fails to compile ruby
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>krejzi@email.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Trying to build ruby-2.3.0 with clang 3.9.0 (trunk 267338). So far, I've been
unsucessful:

#0 0x00007fe0594a8fb5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/tools/bin/../lib/libLLVM-3.9svn.so+0x40bfb5)
#1 0x00007fe0594a6ccd llvm::sys::RunSignalHandlers()
(/tools/bin/../lib/libLLVM-3.9svn.so+0x409ccd)
#2 0x00007fe0594a6e96 SignalHandler(int)
(/tools/bin/../lib/libLLVM-3.9svn.so+0x409e96)
#3 0x00007fe0584942d0 __restore_rt (/tools/bin/../lib/libc.so.6+0x332d0)
#4 0x00007fe05a339554 (anonymous
namespace)::OptimizeLEAPass::runOnMachineFunction(llvm::MachineFunction&)
[clone .part.104] (/tools/bin/../lib/libLLVM-3.9svn.so+0x129c554)
#5 0x00007fe0596bf2b7 llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/tools/bin/../lib/libLLVM-3.9svn.so+0x6222b7)
#6 0x00007fe059562568 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/tools/bin/../lib/libLLVM-3.9svn.so+0x4c5568)
#7 0x00007fe0595628cb llvm::FPPassManager::runOnModule(llvm::Module&)
(/tools/bin/../lib/libLLVM-3.9svn.so+0x4c58cb)
#8 0x00007fe059562bea llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/tools/bin/../lib/libLLVM-3.9svn.so+0x4c5bea)
#9 0x000000000060b38b clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) (/tools/bin/clang-3.9+0x60b38b)
#10 0x0000000000974f07 (/tools/bin/clang-3.9+0x974f07)
#11 0x00000000009876ba clang::ParseAST(clang::Sema&, bool, bool)
(/tools/bin/clang-3.9+0x9876ba)
#12 0x00000000008f3739 clang::FrontendAction::Execute()
(/tools/bin/clang-3.9+0x8f3739)
#13 0x00000000008c7da6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/tools/bin/clang-3.9+0x8c7da6)
#14 0x0000000000973e6a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/tools/bin/clang-3.9+0x973e6a)
#15 0x00000000005cb038 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/tools/bin/clang-3.9+0x5cb038)
#16 0x00000000005c74d7 main (/tools/bin/clang-3.9+0x5c74d7)
#17 0x00007fe058481771 __libc_start_main (/tools/bin/../lib/libc.so.6+0x20771)
#18 0x00000000005c9179 _start (/tools/bin/clang-3.9+0x5c9179)
Stack dump:
0.      Program arguments: /tools/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name eval.c -mrelocation-model pic -pic-level 2
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu skylake -momit-leaf-frame-pointer
-dwarf-column-info -debugger-tuning=gdb -coverage-file
/sources/ruby-2.3.0/eval.o -resource-dir /tools/bin/../lib/clang/3.9.0 -D
_FORTIFY_SOURCE=2 -D RUBY_EXPORT -I . -I .ext/include/x86_64-linux -I ./include
-I . -internal-isystem /usr/local/include -internal-isystem
/tools/bin/../lib/clang/3.9.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Os -fdebug-compilation-dir
/sources/ruby-2.3.0 -ferror-limit 19 -fmessage-length 176 -fvisibility hidden
-fwrapv -stack-protector 1 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o eval.o -x c eval.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'eval.c'.
4.      Running pass 'X86 LEA Optimize' on function '@ruby_setup'
clang-3.9: error: unable to execute command: Segmentation fault (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 267338)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /tools/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/eval-bb65b5.c
clang-3.9: note: diagnostic msg: /tmp/eval-bb65b5.sh

Clang was compiled with cmake options which can be found at:

<a href="https://github.com/elkrejzi/system-management/blob/master/bootstrap/039-llvm#L13">https://github.com/elkrejzi/system-management/blob/master/bootstrap/039-llvm#L13</a>

It was compiled with GNU GCC version 6.0.1 20160421 (prerelease).

Ruby was compiled with ./configure --prefix=/usr --disable-static
--enable-shared --disable-install-capi, while also using CFLAGS="-march=skylake
-fomit-frame-pointer -Os -pipe" and clang as a compiler.

clang 3.8.0 works fine (with addition of -mno-avx512f to CFLAGS because 3.8 has
-march=skylake which targets AVX-512 systems which this CPU doesn't have).

Mentioned files are attached. Let me know if you need more info</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>