<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 --- - libc++ fails to build with cmake on Leopard (works with buildit script)"
   href="https://llvm.org/bugs/show_bug.cgi?id=25680">25680</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>libc++ fails to build with cmake on Leopard (works with buildit script)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Build scripts
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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>cmake
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jeremyhu@apple.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>libc++ builds on Leopard using the legacy buildit shell script, but it fails
when using cmake.  Due to our inability to skip building libc++ with cmake
options (<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - cmake build system lacks a way to build libclang_rt without building libc++"
   href="show_bug.cgi?id=25665">bug #25665</a>), this also impacts our ability to just build clang using
cmake.

The buildit script compiles algorithm.cpp successfully with:

/opt/local/bin/clang++-mp-3.7 -c -g -Os -arch x86_64 -arch i386 -nostdinc++
-std=c++11 -U__STRICT_ANSI__ -I../include ../src/algorithm.cpp

The cmake build fails with:

/opt/local/bin/clang++-mp-3.7   -D_DEBUG -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-I/opt/local/var/macports/build/_Users_jeremy_src_macports_dports_jeremyhu_lang_llvm-3.8/clang-3.8/work/build/projects/libcxx/lib
-I/opt/local/var/macports/build/_Users_jeremy_src_macports_dports_jeremyhu_lang_llvm-3.8/clang-3.8/work/trunk/projects/libcxx/lib
-I/opt/local/var/macports/build/_Users_jeremy_src_macports_dports_jeremyhu_lang_llvm-3.8/clang-3.8/work/build/include
-I/opt/local/var/macports/build/_Users_jeremy_src_macports_dports_jeremyhu_lang_llvm-3.8/clang-3.8/work/trunk/include
-I/opt/local/var/macports/build/_Users_jeremy_src_macports_dports_jeremyhu_lang_llvm-3.8/clang-3.8/work/trunk/projects/libcxx/include
 -pipe -Os -std=c++11  -arch x86_64 -arch i386  -fPIC
-fvisibility-inlines-hidden -arch x86_64 -arch i386   -UNDEBUG -std=c++11
-nostdinc++ -Wall -W -Wwrite-strings -Wno-unused-parameter -Wno-long-long
-Werror=return-type -Wno-error -fPIC -o
CMakeFiles/cxx.dir/__/src/algorithm.cpp.o -c
/opt/local/var/macports/build/_Users_jeremy_src_macports_dports_jeremyhu_lang_llvm-3.8/clang-3.8/work/trunk/projects/libcxx/src/algorithm.cpp

In file included from .../projects/libcxx/src/algorithm.cpp:11:
In file included from .../projects/libcxx/include/random:1638:
In file included from .../projects/libcxx/include/cmath:301:
.../projects/libcxx/include/math.h:1199:91: error: use of undeclared identifier
'llrintf'
inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT    
  {return llrintf(__lcpp_x);}
                                                                               
          ^
---

Adding -U__STRICT_ANSI__ to the compilation line (like cmake does) results in a
successful compilation of algorithm.cpp.</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>