zhmu created this revision.
zhmu added a reviewer: jroelofs.
Herald added subscribers: cfe-commits, mgorny.
Herald added a reviewer: EricWF.

I'm trying to build libcxxabi as prerequisite for libcxx. The target doesn't 
yet support userland threads, so I set LIBCXXABI_ENABLE_THREADS to 'OFF' in 
CMake (also, LLVM_ENABLE_LIBCXX is set to 'on' andLIBCXXABI_USE_LLVM_UNWINDER 
is 'yes'). This fails to build:

  /home/rink/github/ananas/toolchain/x86_64-ananas-elf-clang 
--target=x86_64-ananas-elf --sysroot=/tmp/ananas-build  
-D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-I/home/rink/github/ananas/external/llvm/projects/libcxxabi/include 
-I/home/rink/github/ananas/external/llvm/projects/libcxx/include 
-fvisibility-inlines-hidden -Werror=date-time 
-Werror=unguarded-availability-new -std=c++11 -w -fcolor-diagnostics  -fPIC   
-nostdinc++ -Werror=return-type -W -Wall -Wchar-subscripts -Wconversion 
-Wmismatched-tags -Wmissing-braces -Wnewline-eof -Wunused-function -Wshadow 
-Wshorten-64-to-32 -Wsign-compare -Wsign-conversion -Wstrict-aliasing=2 
-Wstrict-overflow=4 -Wunused-parameter -Wunused-variable -Wwrite-strings 
-Wundef -Wno-error -WX- -pedantic -fstrict-aliasing -funwind-tables -D_DEBUG 
-std=c++11 -MD -MT src/CMakeFiles/cxxabi_objects.dir/cxa_demangle.cpp.o -MF 
src/CMakeFiles/cxxabi_objects.dir/cxa_demangle.cpp.o.d -o 
src/CMakeFiles/cxxabi_objects.dir/cxa_demangle.cpp.o -c 
/home/rink/github/ananas/external/llvm/projects/libcxxabi/src/cxa_demangle.cpp
  In file included from 
/home/rink/github/ananas/external/llvm/projects/libcxxabi/src/cxa_demangle.cpp:20:
  In file included from 
/home/rink/github/ananas/external/llvm/projects/libcxx/include/vector:264:
  
/home/rink/github/ananas/external/llvm/projects/libcxx/include/__config:1056:4: 
error: "No thread API"
  #  error "No thread API"

My patch is  similar to https://reviews.llvm.org/D43442: emit a define so that 
libcxx works when included.


Repository:
  rCXXA libc++abi

https://reviews.llvm.org/D43443

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -333,6 +333,8 @@
                         " is also set to ON.")
   endif()
   add_definitions(-D_LIBCXXABI_HAS_NO_THREADS)
+  # propgate no threads to libcxx, which uses a different flag
+  add_definitions(-D_LIBCPP_HAS_NO_THREADS)
 endif()
 
 if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -333,6 +333,8 @@
                         " is also set to ON.")
   endif()
   add_definitions(-D_LIBCXXABI_HAS_NO_THREADS)
+  # propgate no threads to libcxx, which uses a different flag
+  add_definitions(-D_LIBCPP_HAS_NO_THREADS)
 endif()
 
 if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to