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

Marshall Clow mclow.lists at gmail.com
Tue Jul 15 07:31:27 PDT 2014


On Jul 10, 2014, at 3:36 PM, Jeff Kuskin <jk500500 at yahoo.com> wrote:

> 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?

Jeff —

Currently there is no workaround for this; libc++ is not set up to run on a system that does not have threading support.
However, Jon Roelofs, who did the “single threaded” work on libc++abi, is planning on working on that.

— Marshall






More information about the cfe-dev mailing list