<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 --- - clang: building cross compiler for Mac results in incorrect Darwin kernel version"
   href="http://llvm.org/bugs/show_bug.cgi?id=19945">19945</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang: building cross compiler for Mac results in incorrect Darwin kernel version
          </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>inkscapebrony@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>I'm building a cross-compiling toolchain for OS X. This sounds ridiculous, but
I'm on an iMac that can no longer run OS X. It can only boot Linux, and I can't
use any "good" GPU functionality as it immediately corrupts the screen.
nomodeset it stays.

I configured llvm in my chroot like this:
../configure --prefix=/usr/clang_3_4 --enable-optimized
--enable-targets=x86_64,x86 --disable-compiler-version-checks
--host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu
--target=x86_64-apple-darwin11.4.0

Whenever I run clang, I get this message:
# /usr/clang_3_4/bin/x86_64-apple-darwin11.4.2-clang++
x86_64-apple-darwin11.4.0-clang: error: invalid Darwin version number:
darwin3.13.0
x86_64-apple-darwin11.4.0-clang: error: invalid version number in
'-mmacosx-version-min=3.13.0'

Darwin version number? Let's check uname:
# uname -a
Linux liam-iMac 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014
x86_64 x86_64 x86_64 GNU/Linux
"3.13.0" is the important part there. It perfectly matches my kernel version.
Output from uname on a real Mac machine might be something like
# uname -a
Darwin liams-mac-pro.home 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr  9
19:32:15 PDT 2014; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64

Here is a (somewhat) related MacPorts bug which also affects me:
<a href="https://trac.macports.org/ticket/42291">https://trac.macports.org/ticket/42291</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>