<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 --- - Specifying invalid architecture for Linux as target calls unreachable"
   href="https://llvm.org/bugs/show_bug.cgi?id=25648">25648</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Specifying invalid architecture for Linux as target calls unreachable
          </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>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dsabogal.ufl@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>Specifying invalid-linux as target calls unreachable

The issue arises when specifying the target with an invalid architecture for
Linux.

- invalid-*bsd issues the expected unknown target diagnostic
- invalid-linux results in the issue below


Output
======
$ clang -target invalid-linux test.c
Unexpected arch
UNREACHABLE executed at
/home/dsabogal/llvm/tools/clang/lib/Driver/Tools.cpp:8472!
0  clang           0x00000000026913de
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 46
1  clang           0x0000000002691859
2  clang           0x000000000268fac3 llvm::sys::RunSignalHandlers() + 131
3  clang           0x0000000002691ab4
4  libpthread.so.0 0x00007f800927cd60
5  libc.so.6       0x00007f800844f5f8 gsignal + 56
6  libc.so.6       0x00007f8008450a7a abort + 362
7  clang           0x0000000002621120 LLVMInstallFatalErrorHandler + 0
8  clang           0x0000000002d84eb5
9  clang           0x0000000002d83a45
10 clang           0x0000000002cf0b08
clang::driver::Driver::BuildJobsForAction(clang::driver::Compilation&,
clang::driver::Action const*, clang::driver::ToolChain const*, char const*,
bool, bool, char const*, clang::driver::InputInfo&) const + 4344
11 clang           0x0000000002ce8c52
clang::driver::Driver::BuildJobs(clang::driver::Compilation&) const + 1010
12 clang           0x0000000002ce3ca5
clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>) + 3989
13 clang           0x0000000000ac809b main + 5067
14 libc.so.6       0x00007f800843c610 __libc_start_main + 240
15 clang           0x0000000000ac6b79 _start + 41
Stack dump:
0.    Program arguments: /home/dsabogal/opt/llvm/bin/clang -target
invalid-linux test.c 
1.    Compilation construction
2.    Building compilation jobs
3.    Building compilation jobs
Aborted (core dumped)


Version
=======
This issue occurs on the few compilers that I've tried (3.7.0 and 3.8.0).

clang version 3.8.0 (trunk 253895)
Target: x86_64-unknown-linux-gnu
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>