<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 - clang 5.0 segfaults compiling ghostscript"
   href="https://bugs.llvm.org/show_bug.cgi?id=33957">33957</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang 5.0 segfaults compiling ghostscript
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>5.0
          </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>raj.khem@gmail.com
          </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=18855" name="attach_18855" title="testcase">attachment 18855</a> <a href="attachment.cgi?id=18855&action=edit" title="testcase">[details]</a></span>
testcase

clang 5.0 when compiled for cross compiling for x86_64 -> armv7-a, it ends up
with a segfault. It works ok with 4.x

here is compiler cmdline to see this error. If -O is removed it works ok. and
secondly if -march=armv7a is removed it works ok again.

arm-bec-linux-gnueabi-clang
--sysroot=/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-gnueabi/ghostscript/9.21-r0/recipe-sysroot
/tmp/tmp.jrBJh4IskD/mediasize-36707b.c -c -mlittle-endian -march=armv7a -O

clang-5.0: error: unable to execute command: Segmentation fault (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (git://github.com/llvm-mirror/clang.git
4c3e691e191e1bef23ee65d4c8d8a640a51c6733)
(git://github.com/llvm-mirror/llvm.git
d175f9addcfa01156feb0711fabc70e7bb72b7cb)
Target: arm-bec-linux-gnueabi
Thread model: posix
InstalledDir:
/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-gnueabi/ghostscript/9.21-r0/build/../recipe-sysroot-native/usr/bin/arm-bec-linux-gnueabi
clang-5.0: 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-5.0: note: diagnostic msg:</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>