[llvm-bugs] [Bug 26622] New: libcxx cannot find libatomic and cstddef

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 15 06:35:18 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26622

            Bug ID: 26622
           Summary: libcxx cannot find libatomic and cstddef
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I am trying to install libcxx on a macosx 10.11.2 without installing libcxxabi
as explained in the libcxx website but cmake cannot find libatomic.

I am using a recently compiled and installed clang from source.

The command I am using is:

# Build libcxx without libcxxabi
cd ${LIBCXX_BUILD}
cmake ${LIBCXX_SRC} -DCMAKE_BUILD_TYPE=Release -DLIBCXX_ENABLE_ASSERTIONS=Off
-DLIT_EXECUTABLE=${LLVM_LIT} \
-DCMAKE_INSTALL_PREFIX=${PREFIX} -DLLVM_CONFIG=${PREFIX}/bin/llvm-config
make -j $POOL_JOBS
make install

The error I get is: 

-- Configuring for standalone build.
-- Found LLVM_CONFIG as /Users/name/pool/bin/llvm-config
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.11") 
-- Sphinx disabled.
-- The CXX compiler identification is Clang 3.9.0
-- The C compiler identification is Clang 3.9.0
-- Check for working CXX compiler: /Users/name/pool/bin/clang++
-- Check for working CXX compiler: /Users/name/pool/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler: /Users/name/pool/bin/clang
-- Check for working C compiler: /Users/name/pool/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Performing Test LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
-- Looking for __atomic_fetch_add_8 in atomic
-- Looking for __atomic_fetch_add_8 in atomic - not found
CMake Error at cmake/Modules/CheckLibcxxAtomic.cmake:39 (message):
  Host compiler appears to require libatomic, but cannot find it.
Call Stack (most recent call first):
  cmake/config-ix.cmake:3 (include)
  CMakeLists.txt:240 (include)

-- Configuring incomplete, errors occurred!
See also "/Users/name/pool/build/libcxx/CMakeFiles/CMakeOutput.log".
See also "/Users/name/pool/build/libcxx/CMakeFiles/CMakeError.log".

Basically from CMakeError.log I found that the problem was that #include
<cstddef> could not be found. That is why the atomic tests failed to compile,
but this is werid since cstddef is provided by libc++ itself.

I "fixed" this by just adding a path to libc++'s include directory to my
install command:

# Build libcxx without libcxxabi
cd ${LIBCXX_BUILD}
cmake ${LIBCXX_SRC} -DCMAKE_BUILD_TYPE=Release -DLIBCXX_ENABLE_ASSERTIONS=Off
-DLIT_EXECUTABLE=${LLVM_LIT} \
      -DCMAKE_INSTALL_PREFIX=${PREFIX} -DLLVM_CONFIG=${PREFIX}/bin/llvm-config
-DCMAKE_CXX_FLAGS="-I${LIBCXX_SRC}/include"
make -j $POOL_JOBS
make install

Still it looks that I am missing something, why should this be necessary?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160215/2455afe8/attachment-0001.html>


More information about the llvm-bugs mailing list