<html>
    <head>
      <base href="http://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 --- - lld crashes when linking x86_64 Mach-O file"
   href="http://llvm.org/bugs/show_bug.cgi?id=20539">20539</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld crashes when linking x86_64 Mach-O file
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>alexchandel@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12857" name="attach_12857" title="test.c, a harmless C file">attachment 12857</a> <a href="attachment.cgi?id=12857&action=edit" title="test.c, a harmless C file">[details]</a></span>
test.c, a harmless C file

For some `test.o`, compiled with `clang -c test.c`, running the command,

  `lld -flavor darwin test.o`

fails with the following build output:

```
Unknown arch
UNREACHABLE executed at ArchHandler.cpp:46!
0  libLLVM-3.6svn.dylib     0x000000010ececf37
llvm::sys::PrintStackTrace(__sFILE*) + 40
1  libLLVM-3.6svn.dylib     0x000000010eced322 SignalHandler(int) + 248
2  libsystem_platform.dylib 0x00007fff975c95aa _sigtramp + 26
3  libsystem_platform.dylib 0x00007f9cfac00000 _sigtramp + 1667459696
4  libLLVM-3.6svn.dylib     0x000000010eced189 abort + 22
5  libLLVM-3.6svn.dylib     0x000000010ecdb673 LLVMInstallFatalErrorHandler + 0
6  lld                      0x000000010e064149
7  lld                      0x000000010e06a928
8  lld                      0x000000010e06cccb
9  lld                      0x000000010e04cca4
10 lld                      0x000000010e055315
11 lld                      0x000000010e04bbc0
12 libdyld.dylib            0x00007fff96afc5fd start + 1
13 libdyld.dylib            0x0000000000000004 start + 1766865416
Stack dump:
0.    Program arguments: /usr/local/opt/llvm/bin/lld -flavor darwin test.o 
Illegal instruction: 4
```

Only the flags `-flavor darwin` could be passed, because LLD did not recognize
the `-target` flag when it was passed, nor did it work without the `-flavor`
flag.

This is using the lld HEAD, llvm HEAD, and clang HEAD, 2014-07-05, (llvm
3.6.0pre). However I saw this same error at least a month ago.</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>