<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 crashes on autoconf test involving #pragma weak"
   href="https://llvm.org/bugs/show_bug.cgi?id=26040">26040</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crashes on autoconf test involving #pragma weak
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>fuzxxl@gmail.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>This bug has also been reported to the FreeBSD bug tracker [1] and could be
reproduced on amd64 Ubuntu 14.04. Further analysis (as described on the “how to
submit” page) shows that the bug occurs in the frontend.

The following very short C program triggers a bug in /usr/bin/cc (Clang 3.4.1)
on amd64 FreeBSD 10.2-RELEASE:

    extern int test2();
    #pragma weak test2 = test1
    int test1() {return 0;}
    int main() {
    return test2();
    ; return 0; }

This program is used as a configure test in the Schily utilities, it's supposed
to test if the compiler correctly supports SysV #pragma weak, though it's not
supposed to induce a compiler crash. The output of /usr/bin/cc is:


    Stack dump:
    0.    Program arguments: /usr/bin/cc -cc1 -triple
x86_64-unknown-freebsd10.2 -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name clang-bug.c -mrelocation-model static
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -coverage-file /tmp/clang-bug.o -resource-dir
/usr/bin/../lib/clang/3.4.1 -fdebug-compilation-dir /tmp -ferror-limit 19
-fmessage-length 0 -mstackrealign -fobjc-runtime=gnustep
-fdiagnostics-show-option -vectorize-slp -o clang-bug.o -x c clang-bug.c 
    1.    clang-bug.c:5:14: current parser token ')'
    2.    clang-bug.c:4:12: parsing function body 'main'
    3.    clang-bug.c:4:12: in compound statement ('{}')
    cc: error: unable to execute command: Segmentation fault (core dumped)
    cc: error: clang frontend command failed due to signal (use -v to see
invocation)
    FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
    Target: x86_64-unknown-freebsd10.2
    Thread model: posix
    cc: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.freebsd.org/submit/">https://bugs.freebsd.org/submit/</a> and include the crash backtrace, preprocessed
source, and associated run script.
    cc: note: diagnostic msg: 
    ********************

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

    ********************

[1]: <a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205934">https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205934</a></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>