[cfe-dev] [libc++] Support for systems lacking pthreads?

Jeff Kuskin jk500500 at yahoo.com
Thu Jul 10 15:36:20 PDT 2014


I'm trying to cross-compile libc++ for an embedded system that lacks any kind of threading support, meaning it has no pthread libraries, headers, etc.  I've got a working clang,compiler-rt, newlib, and libc++abi already built and installed.



For libc++, CMake seems to test for libpthread and (properly) not find it:

  -- Looking for pthread_create in pthread
  -- Looking for pthread_create in pthread - not found



But when I try to do the actual libc++ build, various source files that use pthreads are still part of the build, which causes the build to fail.  For example, condition_variable.cpp:

    In file included from /data0/jsk/llvm/llvm-svn/llvm/projects/libcxx/src/condition_variable.cpp:10:
    In file included from /data0/jsk/llvm/llvm-svn/llvm/projects/libcxx/include/condition_variable:111:
    /data0/jsk/llvm/llvm-svn/llvm/projects/libcxx/include/__mutex_base:27:5: error: unknowntype name 'pthread_mutex_t'
    pthread_mutex_t __m_;




Is there any workaround for this issue?

Thanks.




More information about the cfe-dev mailing list