--===============1211934854419900738== Content-Type: multipart/alternative; boundary=089e011839b2cad745051c0c289c --089e011839b2cad745051c0c289c Content-Type: text/plain; charset=UTF-8 I'll revert the commits now. On Jul 29, 2015 7:41 PM, "Alexey Samsonov" wrote: > Eric, the build still fails due to the issue with compiler identification > described above... > > On Wed, Jul 29, 2015 at 4:33 PM, Alexey Samsonov > wrote: > >> Trying the build now. >> >> +Brad for a weird CMake issue. Looks like CMake is unable to detect >> CMAKE_CXX_COMPILER_VERSION if I pass trunk Clang as CMAKE_CXX_COMPILER, and >> pass "-fsanitize=thread" as CMAKE_CXX_FLAGS (Compiler identification is >> determined as "Clang" instead >> of "Clang 3.8.0"). >> >> On Wed, Jul 29, 2015 at 4:24 PM, Eric Fiselier wrote: >> >>> I just pushed a possible fix to libc++. Let me know ASAP if that >>> doesn't fix the issue. I'll revert if r243591 doesn't work. >>> >>> /Eric >>> >>> On Wed, Jul 29, 2015 at 6:44 PM, Alexey Samsonov >>> wrote: >>> > Eric, >>> > >>> > Looks like it breaks the build of compiler-rt on Linux, and we can't >>> fix it >>> > instantly, sorry =/ >>> > Could you please revert it again? >>> > >>> > The problem is that when I pass correct -DLLVM_CONFIG= value when >>> > configuring standalone libcxx with >>> > just-built Clang, libcxx invokes >>> llvm/cmake/modules/HandleLLVMOptions.cmake, >>> > and it fails with an error >>> > "Host Clang version must be at least 3.1!", >>> > because CMake is unable to properly determine the compiler version of >>> > just-built Clang as 3.8.0 for >>> > some reason(?!) I'm now looking into this issue, and will provide a >>> patch to >>> > compiler-rt that should accompany >>> > re-land of libcxx CMake changes. >>> > >>> > On Wed, Jul 29, 2015 at 3:05 PM, Eric Fiselier wrote: >>> >> >>> >> Libc++ standalone builds now require that libc++ can find the LLVM >>> source >>> >> directory. If you specify the LLVM source root using >>> >> "-DLLVM_PATH=path/to/llvm" then the command should work? >>> >> >>> >> Does this new requirement work for you? >>> >> >>> >> On Jul 29, 2015 6:03 PM, "Alexey Samsonov" >>> wrote: >>> >>> >>> >>> I'm looking into the fix now, it probably should go to compiler-rt >>> >>> anyway, so I don't think we should revert libcxx part now. >>> >>> >>> >>> On Wed, Jul 29, 2015 at 2:59 PM, Kostya Serebryany >>> >>> wrote: >>> >>>> >>> >>>> Eric, >>> >>>> If there is no quick fix, will you be able to revert this, please? >>> >>>> >>> >>>> On Wed, Jul 29, 2015 at 2:56 PM, Evgenii Stepanov >>> >>>> wrote: >>> >>>>> >>> >>>>> And the log says: >>> >>>>> >>> >>>>> CMake Error at cmake/Modules/FindLLVM.cmake:41 (message): >>> >>>>> llvm-config not found and LLVM_MAIN_SRC_DIR not defined. >>> Reconfigure >>> >>>>> with >>> >>>>> -DLLVM_CONFIG=path/to/llvm-config or >>> >>>>> -DLLVM_PATH=path/to/llvm-source-root. >>> >>>>> Call Stack (most recent call first): >>> >>>>> CMakeLists.txt:37 (include) >>> >>>>> >>> >>>>> On Wed, Jul 29, 2015 at 2:49 PM, Kostya Serebryany >> > >>> >>>>> wrote: >>> >>>>> > I am seeing build failure when trying to run "ninja check-msan": >>> >>>>> > >>> >>>>> > [39/58] Performing configure step for 'libcxx_msan-with-call' >>> >>>>> > FAILED: cd >>> >>>>> > >>> >>>>> > >>> /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/libcxx_msan-with-call/src/libcxx_msan-with-call-build >>> >>>>> > && /usr/bin/cmake -P >>> >>>>> > >>> >>>>> > >>> /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-call-stamp/libcxx_msan-with-call-configure.cmake >>> >>>>> > && /usr/bin/cmake -E touch >>> >>>>> > >>> >>>>> > >>> /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-call-stamp/libcxx_msan-with-call-configure >>> >>>>> > CMake Error at >>> >>>>> > >>> >>>>> > >>> /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/libcxx_msan-with-call/src/libcxx_msan-with-call-stamp/libcxx_msan-with-call-configure.cmake:16 >>> >>>>> > (message): >>> >>>>> > Command failed: 1 >>> >>>>> > >>> >>>>> > '/usr/bin/cmake' >>> >>>>> > >>> >>>>> > >>> '-DCMAKE_C_COMPILER=/usr/local/google/home/kcc/llvm-gcc-build/./bin/clang' >>> >>>>> > >>> >>>>> > >>> '-DCMAKE_CXX_COMPILER=/usr/local/google/home/kcc/llvm-gcc-build/./bin/clang' >>> >>>>> > '-DCMAKE_C_FLAGS= -fsanitize=memory >>> -fsanitize-memory-track-origins >>> >>>>> > -Wno-pedantic -fsanitize=memory -fsanitize-memory-track-origins >>> >>>>> > -Wno-pedantic -mllvm -msan-instrumentation-with-call-threshold=0' >>> >>>>> > '-DCMAKE_CXX_FLAGS= -fsanitize=memory >>> -fsanitize-memory-track-origins >>> >>>>> > -Wno-pedantic -fsanitize=memory -fsanitize-memory-track-origins >>> >>>>> > -Wno-pedantic -mllvm -msan-instrumentation-with-call-threshold=0' >>> >>>>> > '-DCMAKE_BUILD_TYPE=Release' >>> >>>>> > >>> >>>>> > >>> '-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_msan-with-call' >>> >>>>> > '-GNinja' '/usr/local/google/home/kcc/llvm/projects/libcxx' >>> >>>>> > >>> >>>>> > See also >>> >>>>> > >>> >>>>> > >>> >>>>> > >>> >>>>> > >>> /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-call-stamp/libcxx_msan-with-call-configure-*.log >>> >>>>> > >>> >>>>> > >>> >>>>> > Looks like this is the only change that might have caused this. >>> >>>>> > >>> >>>>> > On Wed, Jul 29, 2015 at 2:07 PM, Eric Fiselier >>> wrote: >>> >>>>> >> >>> >>>>> >> Author: ericwf >>> >>>>> >> Date: Wed Jul 29 16:07:28 2015 >>> >>>>> >> New Revision: 243574 >>> >>>>> >> >>> >>>>> >> URL: http://llvm.org/viewvc/llvm-project?rev=243574&view=rev >>> >>>>> >> Log: >>> >>>>> >> Recommit r243503 "[libcxx] Cleanup CMake configuration and >>> integrate >>> >>>>> >> with >>> >>>>> >> LLVM" >>> >>>>> >> >>> >>>>> >> This change was reverted in r243550 because it broke >>> clang-format >>> >>>>> >> builds >>> >>>>> >> (see PR24306). >>> >>>>> >> >>> >>>>> >> This patch recommits a fixed version of the original. >>> >>>>> >> >>> >>>>> >> Added: >>> >>>>> >> libcxx/trunk/cmake/Modules/FindLLVM.cmake >>> >>>>> >> libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake >>> >>>>> >> Modified: >>> >>>>> >> libcxx/trunk/CMakeLists.txt >>> >>>>> >> libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake >>> >>>>> >> libcxx/trunk/cmake/config-ix.cmake >>> >>>>> >> libcxx/trunk/lib/CMakeLists.txt >>> >>>>> >> libcxx/trunk/test/CMakeLists.txt >>> >>>>> >> libcxx/trunk/test/lit.site.cfg.in >>> >>>>> >> libcxx/trunk/www/index.html >>> >>>>> >> >>> >>>>> >> Modified: libcxx/trunk/CMakeLists.txt >>> >>>>> >> URL: >>> >>>>> >> >>> >>>>> >> >>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=243574&r1=243573&r2=243574&view=diff >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> ============================================================================== >>> >>>>> >> --- libcxx/trunk/CMakeLists.txt (original) >>> >>>>> >> +++ libcxx/trunk/CMakeLists.txt Wed Jul 29 16:07:28 2015 >>> >>>>> >> @@ -3,13 +3,16 @@ >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> # Setup Project >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> - >>> >>>>> >> -project(libcxx CXX C) >>> >>>>> >> cmake_minimum_required(VERSION 2.8) >>> >>>>> >> >>> >>>>> >> if(POLICY CMP0042) >>> >>>>> >> cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by >>> default >>> >>>>> >> endif() >>> >>>>> >> +if(POLICY CMP0022) >>> >>>>> >> + cmake_policy(SET CMP0022 NEW) # Required when interacting >>> with >>> >>>>> >> LLVM and >>> >>>>> >> Clang >>> >>>>> >> +endif() >>> >>>>> >> + >>> >>>>> >> +project(libcxx CXX C) >>> >>>>> >> >>> >>>>> >> set(PACKAGE_NAME libcxx) >>> >>>>> >> set(PACKAGE_VERSION trunk-svn) >>> >>>>> >> @@ -30,52 +33,90 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD( >>> >>>>> >> build directory and run 'cmake /path/to/${PROJECT_NAME} >>> [options]' >>> >>>>> >> there." >>> >>>>> >> ) >>> >>>>> >> >>> >>>>> >> -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) >>> >>>>> >> - set(LIBCXX_LIBDIR_SUFFIX "" CACHE STRING >>> >>>>> >> - "Define suffix of library directory name (32/64)") >>> >>>>> >> - >>> >>>>> >> - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY >>> >>>>> >> ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) >>> >>>>> >> - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY >>> >>>>> >> ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) >>> >>>>> >> - >>> >>>>> >> - set(LIBCXX_BUILT_STANDALONE 1) >>> >>>>> >> -else() >>> >>>>> >> - set(LIBCXX_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX}) >>> >>>>> >> -endif() >>> >>>>> >> +# Find the required bits of LLVM >>> >>>>> >> +include(FindLLVM) >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> # Setup CMake Options >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> >>> >>>>> >> -# Define options. >>> >>>>> >> -option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON) >>> >>>>> >> -option(LIBCXX_ENABLE_RTTI "Use run time type information." ON) >>> >>>>> >> +# Basic options >>> >>>>> >> --------------------------------------------------------------- >>> >>>>> >> option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent >>> of >>> >>>>> >> build >>> >>>>> >> mode." ON) >>> >>>>> >> -option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." >>> ON) >>> >>>>> >> -option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is >>> >>>>> >> triggered." >>> >>>>> >> OFF) >>> >>>>> >> -option(LIBCXX_ENABLE_CXX1Y "Enable -std=c++1y and use of c++1y >>> >>>>> >> language >>> >>>>> >> features if the compiler supports it." OFF) >>> >>>>> >> option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared >>> library." ON) >>> >>>>> >> + >>> >>>>> >> +set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING >>> >>>>> >> + "Define suffix of library directory name (32/64)") >>> >>>>> >> +option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) >>> >>>>> >> +option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support >>> >>>>> >> headers." >>> >>>>> >> ON) >>> >>>>> >> + >>> >>>>> >> +# ABI Library options >>> >>>>> >> --------------------------------------------------------- >>> >>>>> >> +set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING >>> >>>>> >> + "Specify C++ ABI library to use." FORCE) >>> >>>>> >> +set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++) >>> >>>>> >> +set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS}) >>> >>>>> >> + >>> >>>>> >> +option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the >>> ABI >>> >>>>> >> library" >>> >>>>> >> OFF) >>> >>>>> >> + >>> >>>>> >> +# Build libc++abi with libunwind. We need this option to >>> determine >>> >>>>> >> whether to >>> >>>>> >> +# link with libunwind or libgcc_s while running the test cases. >>> >>>>> >> +option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM >>> >>>>> >> unwinder." >>> >>>>> >> OFF) >>> >>>>> >> + >>> >>>>> >> +# Target options >>> >>>>> >> -------------------------------------------------------------- >>> >>>>> >> +option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++." OFF) >>> >>>>> >> +set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.") >>> >>>>> >> +set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC >>> >>>>> >> toolchain.") >>> >>>>> >> + >>> >>>>> >> +# Feature options >>> >>>>> >> ------------------------------------------------------------- >>> >>>>> >> +option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON) >>> >>>>> >> +option(LIBCXX_ENABLE_RTTI "Use run time type information." ON) >>> >>>>> >> option(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE "Build libc++ >>> with >>> >>>>> >> support for the global filesystem namespace." ON) >>> >>>>> >> option(LIBCXX_ENABLE_STDIN "Build libc++ with support for >>> >>>>> >> stdin/std::cin." ON) >>> >>>>> >> option(LIBCXX_ENABLE_STDOUT "Build libc++ with support for >>> >>>>> >> stdout/std::cout." ON) >>> >>>>> >> option(LIBCXX_ENABLE_THREADS "Build libc++ with support for >>> >>>>> >> threads." ON) >>> >>>>> >> option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ >>> with >>> >>>>> >> support >>> >>>>> >> for thread-unsafe C functions" ON) >>> >>>>> >> -option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++" OFF) >>> >>>>> >> option(LIBCXX_ENABLE_MONOTONIC_CLOCK >>> >>>>> >> "Build libc++ with support for a monotonic clock. >>> >>>>> >> This option may only be used when >>> LIBCXX_ENABLE_THREADS=OFF." >>> >>>>> >> ON) >>> >>>>> >> -option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) >>> >>>>> >> -option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support >>> >>>>> >> headers." >>> >>>>> >> ON) >>> >>>>> >> + >>> >>>>> >> +# Misc options >>> >>>>> >> ---------------------------------------------------------------- >>> >>>>> >> +option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." >>> ON) >>> >>>>> >> +option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is >>> >>>>> >> triggered." >>> >>>>> >> OFF) >>> >>>>> >> + >>> >>>>> >> option(LIBCXX_GENERATE_COVERAGE "Enable generating code >>> coverage." >>> >>>>> >> OFF) >>> >>>>> >> set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING >>> >>>>> >> - "The Profile-rt library used to build with code >>> coverage") >>> >>>>> >> -option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the >>> ABI >>> >>>>> >> library" >>> >>>>> >> OFF) >>> >>>>> >> -set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.") >>> >>>>> >> -set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC >>> >>>>> >> toolchain.") >>> >>>>> >> -if (LIBCXX_BUILT_STANDALONE) >>> >>>>> >> - set(LLVM_USE_SANITIZER "" CACHE STRING >>> >>>>> >> - "Define the sanitizer used to build the library and >>> tests") >>> >>>>> >> + "The Profile-rt library used to build with code coverage") >>> >>>>> >> + >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> +#=============================================================================== >>> >>>>> >> +# Check option configurations >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> +#=============================================================================== >>> >>>>> >> + >>> >>>>> >> +# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON only when >>> >>>>> >> +# LIBCXX_ENABLE_THREADS is on. >>> >>>>> >> +if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENABLE_MONOTONIC_CLOCK) >>> >>>>> >> + message(FATAL_ERROR "LIBCXX_ENABLE_MONOTONIC_CLOCK can only >>> be >>> >>>>> >> set to >>> >>>>> >> OFF" >>> >>>>> >> + " when LIBCXX_ENABLE_THREADS is also set >>> to >>> >>>>> >> OFF.") >>> >>>>> >> +endif() >>> >>>>> >> + >>> >>>>> >> +# Ensure LLVM_USE_SANITIZER is not specified when >>> >>>>> >> LIBCXX_GENERATE_COVERAGE >>> >>>>> >> +# is ON. >>> >>>>> >> +if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE) >>> >>>>> >> + message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with >>> >>>>> >> LIBCXX_GENERATE_COVERAGE") >>> >>>>> >> +endif() >>> >>>>> >> + >>> >>>>> >> +# Set LIBCXX_BUILD_32_BITS to (LIBCXX_BUILD_32_BITS OR >>> >>>>> >> LLVM_BUILD_32_BITS) >>> >>>>> >> +# and check that we can build with 32 bits if requested. >>> >>>>> >> +if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32) >>> >>>>> >> + if (LIBCXX_BUILD_32_BITS OR LLVM_BUILD_32_BITS) >>> >>>>> >> + if (NOT LLVM_BUILD_32_BITS) # Don't duplicate the output >>> from >>> >>>>> >> LLVM >>> >>>>> >> + message(STATUS "Building 32 bits executables and >>> libraries.") >>> >>>>> >> + endif() >>> >>>>> >> + set(LIBCXX_BUILD_32_BITS ON CACHE BOOL "" FORCE) >>> >>>>> >> + endif() >>> >>>>> >> +elseif(LIBCXX_BUILD_32_BITS) >>> >>>>> >> + message(FATAL_ERROR "LIBCXX_BUILD_32_BITS=ON is not >>> supported on >>> >>>>> >> this >>> >>>>> >> platform.") >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> +# Check that this option is not enabled on Apple and emit a >>> usage >>> >>>>> >> warning. >>> >>>>> >> if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) >>> >>>>> >> if (APPLE) >>> >>>>> >> message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is >>> not >>> >>>>> >> supported on OS X") >>> >>>>> >> @@ -84,27 +125,6 @@ if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) >>> >>>>> >> endif() >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> -set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++) >>> >>>>> >> -if (NOT LIBCXX_CXX_ABI) >>> >>>>> >> - if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND >>> >>>>> >> - IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi") >>> >>>>> >> - set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") >>> >>>>> >> - set(LIBCXX_CXX_ABI_INCLUDE_PATHS >>> >>>>> >> "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include") >>> >>>>> >> - set(LIBCXX_CXX_ABI_INTREE 1) >>> >>>>> >> - else () >>> >>>>> >> - set(LIBCXX_CXX_ABI_LIBNAME "none") >>> >>>>> >> - endif () >>> >>>>> >> -else () >>> >>>>> >> - set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}") >>> >>>>> >> -endif () >>> >>>>> >> -set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING >>> >>>>> >> - "Specify C++ ABI library to use." FORCE) >>> >>>>> >> -set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS}) >>> >>>>> >> - >>> >>>>> >> -# Build libc++abi with libunwind. We need this option to >>> determine >>> >>>>> >> whether to >>> >>>>> >> -# link with libunwind or libgcc_s while running the test cases. >>> >>>>> >> -option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM >>> >>>>> >> unwinder." >>> >>>>> >> OFF) >>> >>>>> >> - >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> # Configure System >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> @@ -114,234 +134,113 @@ set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_S >>> >>>>> >> set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) >>> >>>>> >> set(LIBCXX_LIBRARY_DIR >>> >>>>> >> ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) >>> >>>>> >> >>> >>>>> >> +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) >>> >>>>> >> +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) >>> >>>>> >> + >>> >>>>> >> # Declare libc++ configuration variables. >>> >>>>> >> # They are intended for use as follows: >>> >>>>> >> # LIBCXX_CXX_FLAGS: General flags for both the compiler and >>> linker. >>> >>>>> >> # LIBCXX_COMPILE_FLAGS: Compile only flags. >>> >>>>> >> # LIBCXX_LINK_FLAGS: Linker only flags. >>> >>>>> >> -set(LIBCXX_CXX_FLAGS "") >>> >>>>> >> set(LIBCXX_COMPILE_FLAGS "") >>> >>>>> >> set(LIBCXX_LINK_FLAGS "") >>> >>>>> >> +set(LIBCXX_LIBRARIES "") >>> >>>>> >> >>> >>>>> >> # Configure compiler. >>> >>>>> >> include(config-ix) >>> >>>>> >> -# Configure ABI library >>> >>>>> >> -include(HandleLibCXXABI) >>> >>>>> >> + >>> >>>>> >> # Configure coverage options. >>> >>>>> >> if (LIBCXX_GENERATE_COVERAGE) >>> >>>>> >> include(CodeCoverage) >>> >>>>> >> set(CMAKE_BUILD_TYPE "COVERAGE" CACHE STRING "" FORCE) >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> +string(TOUPPER "${CMAKE_BUILD_TYPE}" >>> uppercase_CMAKE_BUILD_TYPE) >>> >>>>> >> + >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> # Setup Compiler Flags >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> >>> >>>>> >> -# Get required flags. >>> >>>>> >> -# On all systems the system c++ standard library headers need >>> to be >>> >>>>> >> excluded. >>> >>>>> >> -if (MSVC) >>> >>>>> >> - # MSVC only has -X, which disables all default includes; >>> >>>>> >> including the >>> >>>>> >> crt. >>> >>>>> >> - # Thus, we do nothing and hope we don't accidentally include >>> any >>> >>>>> >> of the >>> >>>>> >> C++ >>> >>>>> >> - # headers. >>> >>>>> >> -else() >>> >>>>> >> - if (LIBCXX_HAS_NOSTDINCXX_FLAG) >>> >>>>> >> - list(APPEND LIBCXX_COMPILE_FLAGS -nostdinc++) >>> >>>>> >> - string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS >>> >>>>> >> "${CMAKE_CXX_FLAGS}") >>> >>>>> >> - string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS >>> >>>>> >> "${CMAKE_CXX_FLAGS}") >>> >>>>> >> - endif() >>> >>>>> >> - # If c++1y has been enabled then attempt to use it. Fail if >>> it is >>> >>>>> >> no >>> >>>>> >> supported >>> >>>>> >> - # by the compiler. Otherwise choose c++11 and ensure the >>> compiler >>> >>>>> >> supports it. >>> >>>>> >> - if (LIBCXX_ENABLE_CXX1Y) >>> >>>>> >> - if (LIBCXX_HAS_STDCXX1Y_FLAG) >>> >>>>> >> - set(LIBCXX_STD_VERSION c++1y) >>> >>>>> >> - else() >>> >>>>> >> - message(FATAL_ERROR "c++1y was enabled but the compiler >>> does >>> >>>>> >> not >>> >>>>> >> support it.") >>> >>>>> >> - endif() >>> >>>>> >> - else() >>> >>>>> >> - if (LIBCXX_HAS_STDCXX11_FLAG) >>> >>>>> >> - set(LIBCXX_STD_VERSION c++11) >>> >>>>> >> - else() >>> >>>>> >> - message(FATAL_ERROR "c++11 is required by libc++ but is >>> not >>> >>>>> >> supported by the compiler") >>> >>>>> >> - endif() >>> >>>>> >> - endif() >>> >>>>> >> - # LIBCXX_STD_VERSION should always be set at this point. >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS "-std=${LIBCXX_STD_VERSION}") >>> >>>>> >> -endif() >>> >>>>> >> +include(HandleLibCXXABI) # Steup the ABI library flags >>> >>>>> >> >>> >>>>> >> -macro(append_if list condition var) >>> >>>>> >> - if (${condition}) >>> >>>>> >> - list(APPEND ${list} ${var}) >>> >>>>> >> - endif() >>> >>>>> >> -endmacro() >>> >>>>> >> +# Include macros for adding and removing libc++ flags. >>> >>>>> >> +include(HandleLibcxxFlags) >>> >>>>> >> >>> >>>>> >> -# Get warning flags >>> >>>>> >> -# Disable the system header pragma. >>> >>>>> >> -add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) >>> >>>>> >> -if (NOT MSVC) >>> >>>>> >> - append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WALL_FLAG -Wall) >>> >>>>> >> - list(APPEND LIBCXX_COMPILE_FLAGS -Werror=return-type) >>> >>>>> >> +# Remove flags that may have snuck in. >>> >>>>> >> +remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG >>> >>>>> >> + -stdlib=libc++ -stdlib=libstdc++ -lc++abi -m32) >>> >>>>> >> + >>> >>>>> >> +# Required flags >>> >>>>> >> ============================================================== >>> >>>>> >> +add_compile_flags_if_supported(-std=c++11) >>> >>>>> >> +if (NOT MSVC AND NOT LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG) >>> >>>>> >> + message(FATAL_ERROR "C++11 is required but the compiler does >>> not >>> >>>>> >> support -std=c++11") >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_W_FLAG -W) >>> >>>>> >> -append_if(LIBCXX_COMPILE_FLAGS >>> LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG >>> >>>>> >> -Wno-unused-parameter) >>> >>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WWRITE_STRINGS_FLAG >>> >>>>> >> -Wwrite-strings) >>> >>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WNO_LONG_LONG_FLAG >>> >>>>> >> -Wno-long-long) >>> >>>>> >> +# On all systems the system c++ standard library headers need >>> to be >>> >>>>> >> excluded. >>> >>>>> >> +# MSVC only has -X, which disables all default includes; >>> including >>> >>>>> >> the >>> >>>>> >> crt. >>> >>>>> >> +# Thus, we do nothing and hope we don't accidentally include >>> any of >>> >>>>> >> the >>> >>>>> >> C++ >>> >>>>> >> +# headers >>> >>>>> >> +add_compile_flags_if_supported(-nostdinc++) >>> >>>>> >> + >>> >>>>> >> +# Target flags >>> >>>>> >> ================================================================ >>> >>>>> >> +add_flags_if(LIBCXX_BUILD_32_BITS -m32) >>> >>>>> >> +add_flags_if(LIBCXX_TARGET_TRIPLE "-target >>> >>>>> >> ${LIBCXX_TARGET_TRIPLE}") >>> >>>>> >> +add_flags_if(LIBCXX_SYSROOT "--sysroot ${LIBCXX_SYSROOT}") >>> >>>>> >> +add_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain >>> >>>>> >> ${LIBCXX_GCC_TOOLCHAIN}") >>> >>>>> >> + >>> >>>>> >> +# Warning flags >>> >>>>> >> =============================================================== >>> >>>>> >> +add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) >>> >>>>> >> +add_compile_flags_if_supported( >>> >>>>> >> + -Wall -W -Wwrite-strings >>> >>>>> >> + -Wno-unused-parameter -Wno-long-long >>> >>>>> >> + -Werror=return-type) >>> >>>>> >> if (LIBCXX_ENABLE_WERROR) >>> >>>>> >> - append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WERROR_FLAG >>> -Werror) >>> >>>>> >> - append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WX_FLAG -WX) >>> >>>>> >> -else() >>> >>>>> >> - append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WNO_ERROR_FLAG >>> >>>>> >> -Wno-error) >>> >>>>> >> - append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_NO_WX_FLAG -WX-) >>> >>>>> >> + add_compile_flags_if_supported(-Werror) >>> >>>>> >> + add_compile_flags_if_supported(-WX) >>> >>>>> >> endif() >>> >>>>> >> if (LIBCXX_ENABLE_PEDANTIC) >>> >>>>> >> - append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_PEDANTIC_FLAG >>> >>>>> >> -pedantic) >>> >>>>> >> + add_compile_flags_if_supported(-pedantic) >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> -# Get feature flags. >>> >>>>> >> -# Exceptions >>> >>>>> >> +# Exception flags >>> >>>>> >> ============================================================= >>> >>>>> >> if (LIBCXX_ENABLE_EXCEPTIONS) >>> >>>>> >> # Catches C++ exceptions only and tells the compiler to >>> assume >>> >>>>> >> that >>> >>>>> >> extern C >>> >>>>> >> # functions never throw a C++ exception. >>> >>>>> >> - append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_EHSC_FLAG -EHsc) >>> >>>>> >> + add_compile_flags_if_supported(-EHsc) >>> >>>>> >> else() >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS -D_LIBCPP_NO_EXCEPTIONS) >>> >>>>> >> - append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_EHS_FLAG -EHs-) >>> >>>>> >> - append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_EHA_FLAG -EHa-) >>> >>>>> >> - append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_FNO_EXCEPTIONS_FLAG >>> >>>>> >> -fno-exceptions) >>> >>>>> >> + add_definitions(-D_LIBCPP_NO_EXCEPTIONS) >>> >>>>> >> + add_compile_flags_if_supported(-EHs- -EHa-) >>> >>>>> >> + add_compile_flags_if_supported(-fno-exceptions) >>> >>>>> >> endif() >>> >>>>> >> -# RTTI >>> >>>>> >> + >>> >>>>> >> +# RTTI flags >>> >>>>> >> >>> ================================================================== >>> >>>>> >> if (NOT LIBCXX_ENABLE_RTTI) >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS -D_LIBCPP_NO_RTTI) >>> >>>>> >> - append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_GR_FLAG -GR-) >>> >>>>> >> - append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_FNO_RTTI_FLAG >>> -fno-rtti) >>> >>>>> >> + add_definitions(-D_LIBCPP_NO_RTTI) >>> >>>>> >> + add_compile_flags_if_supported(-GR-) >>> >>>>> >> + add_compile_flags_if_supported(-fno-rtti) >>> >>>>> >> endif() >>> >>>>> >> -# Assert >>> >>>>> >> -string(TOUPPER "${CMAKE_BUILD_TYPE}" >>> uppercase_CMAKE_BUILD_TYPE) >>> >>>>> >> + >>> >>>>> >> +# Assertion flags >>> >>>>> >> ============================================================= >>> >>>>> >> +define_if(LIBCXX_ENABLE_ASSERTIONS -UNDEBUG) >>> >>>>> >> +define_if_not(LIBCXX_ENABLE_ASSERTIONS -DNDEBUG) >>> >>>>> >> if (LIBCXX_ENABLE_ASSERTIONS) >>> >>>>> >> # MSVC doesn't like _DEBUG on release builds. See PR 4379. >>> >>>>> >> - if (NOT MSVC) >>> >>>>> >> - list(APPEND LIBCXX_COMPILE_FLAGS -D_DEBUG) >>> >>>>> >> - endif() >>> >>>>> >> - # On Release builds cmake automatically defines NDEBUG, so we >>> >>>>> >> - # explicitly undefine it: >>> >>>>> >> - if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE") >>> >>>>> >> - list(APPEND LIBCXX_COMPILE_FLAGS -UNDEBUG) >>> >>>>> >> - endif() >>> >>>>> >> -else() >>> >>>>> >> - if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE") >>> >>>>> >> - list(APPEND LIBCXX_COMPILE_FLAGS -DNDEBUG) >>> >>>>> >> - endif() >>> >>>>> >> -endif() >>> >>>>> >> -# Static library >>> >>>>> >> -if (NOT LIBCXX_ENABLE_SHARED) >>> >>>>> >> - list(APPEND LIBCXX_COMPILE_FLAGS -D_LIBCPP_BUILD_STATIC) >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32) >>> >>>>> >> - if (LIBCXX_BUILD_32_BITS) >>> >>>>> >> - message(STATUS "Building 32 bits executables and >>> libraries.") >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS "-m32") >>> >>>>> >> - endif() >>> >>>>> >> -elseif(LIBCXX_BUILD_32_BITS) >>> >>>>> >> - message(FATAL_ERROR "LIBCXX_BUILD_32_BITS=ON is not >>> supported on >>> >>>>> >> this >>> >>>>> >> platform.") >>> >>>>> >> -endif() >>> >>>>> >> -# This is the _ONLY_ place where add_definitions is called. >>> >>>>> >> -if (MSVC) >>> >>>>> >> - add_definitions(-D_CRT_SECURE_NO_WARNINGS) >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -# LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE configuration >>> >>>>> >> -if (NOT LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE) >>> >>>>> >> - add_definitions(-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE) >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -# LIBCXX_ENABLE_STDIN configuration >>> >>>>> >> -if (NOT LIBCXX_ENABLE_STDIN) >>> >>>>> >> - add_definitions(-D_LIBCPP_HAS_NO_STDIN) >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -# LIBCXX_ENABLE_STDOUT configuration >>> >>>>> >> -if (NOT LIBCXX_ENABLE_STDOUT) >>> >>>>> >> - add_definitions(-D_LIBCPP_HAS_NO_STDOUT) >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -# LIBCXX_ENABLE_THREADS configuration >>> >>>>> >> -if (NOT LIBCXX_ENABLE_THREADS) >>> >>>>> >> - add_definitions(-D_LIBCPP_HAS_NO_THREADS) >>> >>>>> >> - if (NOT LIBCXX_ENABLE_MONOTONIC_CLOCK) >>> >>>>> >> - add_definitions(-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK) >>> >>>>> >> - endif() >>> >>>>> >> -# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON. >>> >>>>> >> -elseif(NOT LIBCXX_ENABLE_MONOTONIC_CLOCK) >>> >>>>> >> - message(FATAL_ERROR "LIBCXX_ENABLE_MONOTONIC_CLOCK can only >>> be >>> >>>>> >> set to >>> >>>>> >> OFF" >>> >>>>> >> - " when LIBCXX_ENABLE_THREADS is also set >>> to >>> >>>>> >> OFF.") >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -# LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS configuration >>> >>>>> >> -if (NOT LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS) >>> >>>>> >> - add_definitions(-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS) >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -# Configure for sanitizers. If LIBCXX_BUILT_STANDALONE then we >>> have >>> >>>>> >> to do >>> >>>>> >> -# the flag translation ourselves. Othewise LLVM's CMakeList.txt >>> >>>>> >> will >>> >>>>> >> handle it. >>> >>>>> >> -if (LIBCXX_BUILT_STANDALONE) >>> >>>>> >> - # NOTE: LLVM_USE_SANITIZER checks for a UNIX like system >>> instead >>> >>>>> >> of >>> >>>>> >> MSVC. >>> >>>>> >> - # But we don't have LLVM_ON_UNIX so checking for MSVC is the >>> best >>> >>>>> >> we >>> >>>>> >> can do. >>> >>>>> >> - if (LLVM_USE_SANITIZER AND NOT MSVC) >>> >>>>> >> - append_if(LIBCXX_CXX_FLAGS >>> >>>>> >> LIBCXX_HAS_FNO_OMIT_FRAME_POINTER_FLAG >>> >>>>> >> - "-fno-omit-frame-pointer") >>> >>>>> >> - if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND >>> >>>>> >> - NOT uppercase_CMAKE_BUILD_TYPE STREQUAL >>> "RELWITHDEBINFO") >>> >>>>> >> - append_if(LIBCXX_CXX_FLAGS >>> LIBCXX_HAS_GLINE_TABLES_ONLY_FLAG >>> >>>>> >> - "-gline-tables-only") >>> >>>>> >> - endif() >>> >>>>> >> - if (LLVM_USE_SANITIZER STREQUAL "Address") >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=address") >>> >>>>> >> - elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?") >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=memory") >>> >>>>> >> - if (LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins") >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS >>> >>>>> >> "-fsanitize-memory-track-origins") >>> >>>>> >> - endif() >>> >>>>> >> - elseif (LLVM_USE_SANITIZER STREQUAL "Undefined") >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS >>> >>>>> >> - "-fsanitize=undefined -fno-sanitize=vptr,function >>> >>>>> >> -fno-sanitize-recover") >>> >>>>> >> - elseif (LLVM_USE_SANITIZER STREQUAL "Thread") >>> >>>>> >> - list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=thread") >>> >>>>> >> - else() >>> >>>>> >> - message(WARNING "Unsupported value of LLVM_USE_SANITIZER: >>> >>>>> >> ${LLVM_USE_SANITIZER}") >>> >>>>> >> - endif() >>> >>>>> >> - elseif(MSVC) >>> >>>>> >> - message(WARNING "LLVM_USE_SANITIZER is not supported with >>> >>>>> >> MSVC") >>> >>>>> >> - endif() >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -append_if(LIBCXX_CXX_FLAGS LIBCXX_TARGET_TRIPLE >>> >>>>> >> - "-target ${LIBCXX_TARGET_TRIPLE}") >>> >>>>> >> - >>> >>>>> >> -append_if(LIBCXX_CXX_FLAGS LIBCXX_SYSROOT "--sysroot >>> >>>>> >> ${LIBCXX_SYSROOT}") >>> >>>>> >> -append_if(LIBCXX_CXX_FLAGS LIBCXX_GCC_TOOLCHAIN >>> >>>>> >> - "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}") >>> >>>>> >> - >>> >>>>> >> -if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE) >>> >>>>> >> - message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with >>> >>>>> >> LIBCXX_GENERATE_COVERAGE") >>> >>>>> >> + define_if_not(MSVC -D_DEBUG) >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> -string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}") >>> >>>>> >> -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_FLAGS}") >>> >>>>> >> +# Feature flags >>> >>>>> >> =============================================================== >>> >>>>> >> +define_if(MSVC -D_CRT_SECURE_NO_WARNINGS) >>> >>>>> >> +define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE >>> >>>>> >> -D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE) >>> >>>>> >> +define_if_not(LIBCXX_ENABLE_STDIN -D_LIBCPP_HAS_NO_STDIN) >>> >>>>> >> +define_if_not(LIBCXX_ENABLE_STDOUT -D_LIBCPP_HAS_NO_STDOUT) >>> >>>>> >> +define_if_not(LIBCXX_ENABLE_THREADS -D_LIBCPP_HAS_NO_THREADS) >>> >>>>> >> +define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK >>> >>>>> >> -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK) >>> >>>>> >> +define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS >>> >>>>> >> -D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS) >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> -# Setup Source Code >>> >>>>> >> +# Setup Source Code And Tests >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> #=============================================================================== >>> >>>>> >> - >>> >>>>> >> include_directories(include) >>> >>>>> >> add_subdirectory(include) >>> >>>>> >> - >>> >>>>> >> -# Add source code. This also contains all of the logic for >>> deciding >>> >>>>> >> linker flags >>> >>>>> >> -# soname, etc... >>> >>>>> >> add_subdirectory(lib) >>> >>>>> >> - >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> -#=============================================================================== >>> >>>>> >> -# Setup Tests >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> -#=============================================================================== >>> >>>>> >> - >>> >>>>> >> add_subdirectory(test) >>> >>>>> >> >>> >>>>> >> Added: libcxx/trunk/cmake/Modules/FindLLVM.cmake >>> >>>>> >> URL: >>> >>>>> >> >>> >>>>> >> >>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/FindLLVM.cmake?rev=243574&view=auto >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> ============================================================================== >>> >>>>> >> --- libcxx/trunk/cmake/Modules/FindLLVM.cmake (added) >>> >>>>> >> +++ libcxx/trunk/cmake/Modules/FindLLVM.cmake Wed Jul 29 >>> 16:07:28 >>> >>>>> >> 2015 >>> >>>>> >> @@ -0,0 +1,81 @@ >>> >>>>> >> + >>> >>>>> >> +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) >>> >>>>> >> + # Rely on llvm-config. >>> >>>>> >> + set(CONFIG_OUTPUT) >>> >>>>> >> + find_program(LLVM_CONFIG "llvm-config") >>> >>>>> >> + if(DEFINED LLVM_PATH) >>> >>>>> >> + set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} CACHE PATH "Path >>> to >>> >>>>> >> llvm/include") >>> >>>>> >> + set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source >>> >>>>> >> tree") >>> >>>>> >> + set(LLVM_MAIN_SRC_DIR ${LLVM_PATH}) >>> >>>>> >> + set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules") >>> >>>>> >> + elseif(LLVM_CONFIG) >>> >>>>> >> + message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}") >>> >>>>> >> + set(CONFIG_COMMAND ${LLVM_CONFIG} >>> >>>>> >> + "--includedir" >>> >>>>> >> + "--prefix" >>> >>>>> >> + "--src-root") >>> >>>>> >> + execute_process( >>> >>>>> >> + COMMAND ${CONFIG_COMMAND} >>> >>>>> >> + RESULT_VARIABLE HAD_ERROR >>> >>>>> >> + OUTPUT_VARIABLE CONFIG_OUTPUT >>> >>>>> >> + ) >>> >>>>> >> + if(NOT HAD_ERROR) >>> >>>>> >> + string(REGEX REPLACE >>> >>>>> >> + "[ \t]*[\r\n]+[ \t]*" ";" >>> >>>>> >> + CONFIG_OUTPUT ${CONFIG_OUTPUT}) >>> >>>>> >> + else() >>> >>>>> >> + string(REPLACE ";" " " CONFIG_COMMAND_STR >>> >>>>> >> "${CONFIG_COMMAND}") >>> >>>>> >> + message(STATUS "${CONFIG_COMMAND_STR}") >>> >>>>> >> + message(FATAL_ERROR "llvm-config failed with status >>> >>>>> >> ${HAD_ERROR}") >>> >>>>> >> + endif() >>> >>>>> >> + >>> >>>>> >> + list(GET CONFIG_OUTPUT 0 INCLUDE_DIR) >>> >>>>> >> + list(GET CONFIG_OUTPUT 1 LLVM_OBJ_ROOT) >>> >>>>> >> + list(GET CONFIG_OUTPUT 2 MAIN_SRC_DIR) >>> >>>>> >> + >>> >>>>> >> + set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to >>> >>>>> >> llvm/include") >>> >>>>> >> + set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to >>> LLVM >>> >>>>> >> build >>> >>>>> >> tree") >>> >>>>> >> + set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to >>> LLVM >>> >>>>> >> source >>> >>>>> >> tree") >>> >>>>> >> + set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake") >>> >>>>> >> + else() >>> >>>>> >> + message(FATAL_ERROR "llvm-config not found and >>> >>>>> >> LLVM_MAIN_SRC_DIR not >>> >>>>> >> defined. " >>> >>>>> >> + "Reconfigure with >>> >>>>> >> -DLLVM_CONFIG=path/to/llvm-config " >>> >>>>> >> + "or >>> -DLLVM_PATH=path/to/llvm-source-root.") >>> >>>>> >> + endif() >>> >>>>> >> + >>> >>>>> >> + if (NOT EXISTS ${LLVM_MAIN_SRC_DIR}) >>> >>>>> >> + message(FATAL_ERROR "Not found: ${LLVM_MAIN_SRC_DIR}") >>> >>>>> >> + endif() >>> >>>>> >> + >>> >>>>> >> + if(NOT EXISTS ${LLVM_CMAKE_PATH}) >>> >>>>> >> + message(FATAL_ERROR "Not found: ${LLVM_CMAKE_PATH}") >>> >>>>> >> + endif() >>> >>>>> >> + >>> >>>>> >> + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") >>> >>>>> >> + list(APPEND CMAKE_MODULE_PATH >>> >>>>> >> "${LLVM_MAIN_SRC_DIR}/cmake/modules") >>> >>>>> >> + >>> >>>>> >> + >>> >>>>> >> + if(LLVM_LIT) >>> >>>>> >> + # Define the default arguments to use with 'lit', and an >>> option >>> >>>>> >> for >>> >>>>> >> the user >>> >>>>> >> + # to override. >>> >>>>> >> + set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported") >>> >>>>> >> + if (MSVC OR XCODE) >>> >>>>> >> + set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} >>> --no-progress-bar") >>> >>>>> >> + endif() >>> >>>>> >> + set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING >>> "Default >>> >>>>> >> options >>> >>>>> >> for lit") >>> >>>>> >> + >>> >>>>> >> + # On Win32 hosts, provide an option to specify the path to >>> the >>> >>>>> >> GnuWin32 tools. >>> >>>>> >> + if( WIN32 AND NOT CYGWIN ) >>> >>>>> >> + set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 >>> >>>>> >> tools") >>> >>>>> >> + endif() >>> >>>>> >> + else() >>> >>>>> >> + set(LLVM_INCLUDE_TESTS OFF) >>> >>>>> >> + endif() >>> >>>>> >> + >>> >>>>> >> + include(AddLLVM) # Include the LLVM CMake functions. >>> >>>>> >> + include(HandleLLVMOptions) >>> >>>>> >> + set(LIBCXX_BUILT_STANDALONE 1) >>> >>>>> >> +else() >>> >>>>> >> + set(LLVM_MAIN_SRC_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Path >>> to >>> >>>>> >> LLVM >>> >>>>> >> source tree") >>> >>>>> >> + set(LLVM_LIT "${CMAKE_SOURCE_DIR}/utils/lit/lit.py") >>> >>>>> >> +endif() >>> >>>>> >> >>> >>>>> >> Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake >>> >>>>> >> URL: >>> >>>>> >> >>> >>>>> >> >>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=243574&r1=243573&r2=243574&view=diff >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> ============================================================================== >>> >>>>> >> --- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original) >>> >>>>> >> +++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Wed Jul 29 >>> >>>>> >> 16:07:28 >>> >>>>> >> 2015 >>> >>>>> >> @@ -58,6 +58,21 @@ macro(setup_abi_lib abidefines abilib ab >>> >>>>> >> >>> >>>>> >> endmacro() >>> >>>>> >> >>> >>>>> >> +# Setup the default options if LIBCXX_CXX_ABI is not specified. >>> >>>>> >> +if (NOT LIBCXX_CXX_ABI) >>> >>>>> >> + if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND >>> >>>>> >> + IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi") >>> >>>>> >> + set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") >>> >>>>> >> + set(LIBCXX_CXX_ABI_INCLUDE_PATHS >>> >>>>> >> "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include") >>> >>>>> >> + set(LIBCXX_CXX_ABI_INTREE 1) >>> >>>>> >> + else () >>> >>>>> >> + set(LIBCXX_CXX_ABI_LIBNAME "none") >>> >>>>> >> + endif () >>> >>>>> >> +else () >>> >>>>> >> + set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}") >>> >>>>> >> +endif () >>> >>>>> >> + >>> >>>>> >> +# Configure based on the selected ABI library. >>> >>>>> >> if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR >>> >>>>> >> "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libsupc++") >>> >>>>> >> set(_LIBSUPCXX_INCLUDE_FILES >>> >>>>> >> >>> >>>>> >> Added: libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake >>> >>>>> >> URL: >>> >>>>> >> >>> >>>>> >> >>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake?rev=243574&view=auto >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> ============================================================================== >>> >>>>> >> --- libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake (added) >>> >>>>> >> +++ libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake Wed Jul >>> 29 >>> >>>>> >> 16:07:28 >>> >>>>> >> 2015 >>> >>>>> >> @@ -0,0 +1,147 @@ >>> >>>>> >> +# HandleLibcxxFlags - A set of macros used to setup the flags >>> used >>> >>>>> >> to >>> >>>>> >> compile >>> >>>>> >> +# and link libc++. These macros add flags to the following >>> CMake >>> >>>>> >> variables. >>> >>>>> >> +# - LIBCXX_COMPILE_FLAGS: flags used to compile libc++ >>> >>>>> >> +# - LIBCXX_LINK_FLAGS: flags used to link libc++ >>> >>>>> >> +# - LIBCXX_LIBRARIES: libraries to link libc++ to. >>> >>>>> >> + >>> >>>>> >> +include(CheckCXXCompilerFlag) >>> >>>>> >> + >>> >>>>> >> +unset(add_flag_if_supported) >>> >>>>> >> + >>> >>>>> >> +# Mangle the name of a compiler flag into a valid CMake >>> identifier. >>> >>>>> >> +# Ex: --std=c++11 -> STD_EQ_CXX11 >>> >>>>> >> +macro(mangle_name str output) >>> >>>>> >> + string(STRIP "${str}" strippedStr) >>> >>>>> >> + string(REGEX REPLACE "^/" "" strippedStr "${strippedStr}") >>> >>>>> >> + string(REGEX REPLACE "^-+" "" strippedStr "${strippedStr}") >>> >>>>> >> + string(REGEX REPLACE "-+$" "" strippedStr "${strippedStr}") >>> >>>>> >> + string(REPLACE "-" "_" strippedStr "${strippedStr}") >>> >>>>> >> + string(REPLACE "=" "_EQ_" strippedStr "${strippedStr}") >>> >>>>> >> + string(REPLACE "+" "X" strippedStr "${strippedStr}") >>> >>>>> >> + string(TOUPPER "${strippedStr}" ${output}) >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# Remove a list of flags from all CMake variables that affect >>> >>>>> >> compile >>> >>>>> >> flags. >>> >>>>> >> +# This can be used to remove unwanted flags specified on the >>> >>>>> >> command line >>> >>>>> >> +# or added in other parts of LLVM's cmake configuration. >>> >>>>> >> +macro(remove_flags) >>> >>>>> >> + foreach(var ${ARGN}) >>> >>>>> >> + string(REPLACE "${var}" "" CMAKE_CXX_FLAGS >>> >>>>> >> "${CMAKE_CXX_FLAGS}") >>> >>>>> >> + string(REPLACE "${var}" "" CMAKE_C_FLAGS >>> "${CMAKE_C_FLAGS}") >>> >>>>> >> + string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS >>> >>>>> >> "${CMAKE_EXE_LINKER_FLAGS}") >>> >>>>> >> + string(REPLACE "${var}" "" CMAKE_SHARED_LINKER_FLAGS >>> >>>>> >> "${CMAKE_SHARED_LINKER_FLAGS}") >>> >>>>> >> + string(REPLACE "${var}" "" CMAKE_SHARED_MODULE_FLAGS >>> >>>>> >> "${CMAKE_SHARED_MODULE_FLAGS}") >>> >>>>> >> + remove_definitions(${var}) >>> >>>>> >> + endforeach() >>> >>>>> >> +endmacro(remove_flags) >>> >>>>> >> + >>> >>>>> >> +# Add a macro definition if condition is true. >>> >>>>> >> +macro(define_if condition def) >>> >>>>> >> + if (${condition}) >>> >>>>> >> + add_definitions(${def}) >>> >>>>> >> + endif() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# Add a macro definition if condition is not true. >>> >>>>> >> +macro(define_if_not condition def) >>> >>>>> >> + if (NOT ${condition}) >>> >>>>> >> + add_definitions(${def}) >>> >>>>> >> + endif() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# Add a specified list of flags to both 'LIBCXX_COMPILE_FLAGS' >>> and >>> >>>>> >> +# 'LIBCXX_LINK_FLAGS'. >>> >>>>> >> +macro(add_flags) >>> >>>>> >> + foreach(value ${ARGN}) >>> >>>>> >> + list(APPEND LIBCXX_COMPILE_FLAGS ${value}) >>> >>>>> >> + list(APPEND LIBCXX_LINK_FLAGS ${value}) >>> >>>>> >> + endforeach() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# If the specified 'condition' is true then add a list of >>> flags to >>> >>>>> >> both >>> >>>>> >> +# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'. >>> >>>>> >> +macro(add_flags_if condition) >>> >>>>> >> + if (${condition}) >>> >>>>> >> + add_flags(${ARGN}) >>> >>>>> >> + endif() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# Add each flag in the list to LIBCXX_COMPILE_FLAGS and >>> >>>>> >> LIBCXX_LINK_FLAGS >>> >>>>> >> +# if that flag is supported by the current compiler. >>> >>>>> >> +macro(add_flags_if_supported) >>> >>>>> >> + foreach(flag ${ARGN}) >>> >>>>> >> + mangle_name("${flag}" flagname) >>> >>>>> >> + check_cxx_compiler_flag("${flag}" >>> >>>>> >> "LIBCXX_SUPPORTS_${flagname}_FLAG") >>> >>>>> >> + add_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag}) >>> >>>>> >> + endforeach() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# Add a list of flags to 'LIBCXX_COMPILE_FLAGS'. >>> >>>>> >> +macro(add_compile_flags) >>> >>>>> >> + foreach(f ${ARGN}) >>> >>>>> >> + list(APPEND LIBCXX_COMPILE_FLAGS ${f}) >>> >>>>> >> + endforeach() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# If 'condition' is true then add the specified list of flags >>> to >>> >>>>> >> +# 'LIBCXX_COMPILE_FLAGS' >>> >>>>> >> +macro(add_compile_flags_if condition) >>> >>>>> >> + if (${condition}) >>> >>>>> >> + add_compile_flags(${ARGN}) >>> >>>>> >> + endif() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# For each specified flag, add that flag to >>> 'LIBCXX_COMPILE_FLAGS' >>> >>>>> >> if the >>> >>>>> >> +# flag is supported by the C++ compiler. >>> >>>>> >> +macro(add_compile_flags_if_supported) >>> >>>>> >> + foreach(flag ${ARGN}) >>> >>>>> >> + mangle_name("${flag}" flagname) >>> >>>>> >> + check_cxx_compiler_flag("-Werror ${flag}" >>> >>>>> >> "LIBCXX_SUPPORTS_${flagname}_FLAG") >>> >>>>> >> + add_compile_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG >>> >>>>> >> ${flag}) >>> >>>>> >> + endforeach() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# Add a list of flags to 'LIBCXX_LINK_FLAGS'. >>> >>>>> >> +macro(add_link_flags) >>> >>>>> >> + foreach(f ${ARGN}) >>> >>>>> >> + list(APPEND LIBCXX_LINK_FLAGS ${f}) >>> >>>>> >> + endforeach() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# If 'condition' is true then add the specified list of flags >>> to >>> >>>>> >> +# 'LIBCXX_LINK_FLAGS' >>> >>>>> >> +macro(add_link_flags_if condition) >>> >>>>> >> + if (${condition}) >>> >>>>> >> + add_link_flags(${ARGN}) >>> >>>>> >> + endif() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# For each specified flag, add that flag to >>> 'LIBCXX_LINK_FLAGS' if >>> >>>>> >> the >>> >>>>> >> +# flag is supported by the C++ compiler. >>> >>>>> >> +macro(add_link_flags_if_supported) >>> >>>>> >> + foreach(flag ${ARGN}) >>> >>>>> >> + mangle_name("${flag}" flagname) >>> >>>>> >> + check_cxx_compiler_flag("${flag}" >>> >>>>> >> "LIBCXX_SUPPORTS_${flagname}_FLAG") >>> >>>>> >> + add_link_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag}) >>> >>>>> >> + endforeach() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# Add a list of libraries or link flags to 'LIBCXX_LIBRARIES'. >>> >>>>> >> +macro(add_library_flags) >>> >>>>> >> + foreach(lib ${ARGN}) >>> >>>>> >> + list(APPEND LIBCXX_LIBRARIES ${lib}) >>> >>>>> >> + endforeach() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# if 'condition' is true then add the specified list of >>> libraries >>> >>>>> >> and >>> >>>>> >> flags >>> >>>>> >> +# to 'LIBCXX_LIBRARIES'. >>> >>>>> >> +macro(add_library_flags_if condition) >>> >>>>> >> + if(${condition}) >>> >>>>> >> + add_library_flags(${ARGN}) >>> >>>>> >> + endif() >>> >>>>> >> +endmacro() >>> >>>>> >> + >>> >>>>> >> +# Turn a comma separated CMake list into a space separated >>> string. >>> >>>>> >> +macro(split_list listname) >>> >>>>> >> + string(REPLACE ";" " " ${listname} "${${listname}}") >>> >>>>> >> +endmacro() >>> >>>>> >> >>> >>>>> >> Modified: libcxx/trunk/cmake/config-ix.cmake >>> >>>>> >> URL: >>> >>>>> >> >>> >>>>> >> >>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/config-ix.cmake?rev=243574&r1=243573&r2=243574&view=diff >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> ============================================================================== >>> >>>>> >> --- libcxx/trunk/cmake/config-ix.cmake (original) >>> >>>>> >> +++ libcxx/trunk/cmake/config-ix.cmake Wed Jul 29 16:07:28 2015 >>> >>>>> >> @@ -2,23 +2,7 @@ include(CheckLibraryExists) >>> >>>>> >> include(CheckCXXCompilerFlag) >>> >>>>> >> >>> >>>>> >> # Check compiler flags >>> >>>>> >> -check_cxx_compiler_flag(-std=c++11 >>> >>>>> >> LIBCXX_HAS_STDCXX11_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-std=c++1y >>> >>>>> >> LIBCXX_HAS_STDCXX1Y_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-fPIC >>> >>>>> >> LIBCXX_HAS_FPIC_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-fno-omit-frame-pointer >>> >>>>> >> LIBCXX_HAS_FNO_OMIT_FRAME_POINTER_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-nodefaultlibs >>> >>>>> >> LIBCXX_HAS_NODEFAULTLIBS_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-nostdinc++ >>> >>>>> >> LIBCXX_HAS_NOSTDINCXX_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-Wall >>> >>>>> >> LIBCXX_HAS_WALL_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-W >>> LIBCXX_HAS_W_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-Wno-unused-parameter >>> >>>>> >> LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-Wwrite-strings >>> >>>>> >> LIBCXX_HAS_WWRITE_STRINGS_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-Wno-long-long >>> >>>>> >> LIBCXX_HAS_WNO_LONG_LONG_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-pedantic >>> >>>>> >> LIBCXX_HAS_PEDANTIC_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-Werror >>> >>>>> >> LIBCXX_HAS_WERROR_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-Wno-error >>> >>>>> >> LIBCXX_HAS_WNO_ERROR_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-fno-exceptions >>> >>>>> >> LIBCXX_HAS_FNO_EXCEPTIONS_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-fno-rtti >>> >>>>> >> LIBCXX_HAS_FNO_RTTI_FLAG) >>> >>>>> >> -check_cxx_compiler_flag(-gline-tables-only >>> >>>>> >> LIBCXX_HAS_GLINE_TABLES_ONLY_FLAG) >>> >>>>> >> + >>> >>>>> >> check_cxx_compiler_flag(/WX >>> LIBCXX_HAS_WX_FLAG) >>> >>>>> >> check_cxx_compiler_flag(/WX- >>> >>>>> >> LIBCXX_HAS_NO_WX_FLAG) >>> >>>>> >> check_cxx_compiler_flag(/EHsc >>> >>>>> >> LIBCXX_HAS_EHSC_FLAG) >>> >>>>> >> @@ -26,6 +10,7 @@ check_cxx_compiler_flag(/EHs- >>> >>>>> >> check_cxx_compiler_flag(/EHa- >>> >>>>> >> LIBCXX_HAS_NO_EHA_FLAG) >>> >>>>> >> check_cxx_compiler_flag(/GR- >>> >>>>> >> LIBCXX_HAS_NO_GR_FLAG) >>> >>>>> >> >>> >>>>> >> + >>> >>>>> >> # Check libraries >>> >>>>> >> check_library_exists(pthread pthread_create "" >>> >>>>> >> LIBCXX_HAS_PTHREAD_LIB) >>> >>>>> >> check_library_exists(c printf "" LIBCXX_HAS_C_LIB) >>> >>>>> >> >>> >>>>> >> Modified: libcxx/trunk/lib/CMakeLists.txt >>> >>>>> >> URL: >>> >>>>> >> >>> >>>>> >> >>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=243574&r1=243573&r2=243574&view=diff >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> ============================================================================== >>> >>>>> >> --- libcxx/trunk/lib/CMakeLists.txt (original) >>> >>>>> >> +++ libcxx/trunk/lib/CMakeLists.txt Wed Jul 29 16:07:28 2015 >>> >>>>> >> @@ -25,48 +25,23 @@ if (MSVC_IDE OR XCODE) >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> if (LIBCXX_ENABLE_SHARED) >>> >>>>> >> - add_library(cxx SHARED >>> >>>>> >> - ${LIBCXX_SOURCES} >>> >>>>> >> - ${LIBCXX_HEADERS} >>> >>>>> >> - ) >>> >>>>> >> + add_library(cxx SHARED ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) >>> >>>>> >> else() >>> >>>>> >> - add_library(cxx STATIC >>> >>>>> >> - ${LIBCXX_SOURCES} >>> >>>>> >> - ${LIBCXX_HEADERS} >>> >>>>> >> - ) >>> >>>>> >> -endif() >>> >>>>> >> - >>> >>>>> >> -#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it >>> to the >>> >>>>> >> search path. >>> >>>>> >> -if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH) >>> >>>>> >> - target_link_libraries(cxx "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}") >>> >>>>> >> + add_library(cxx STATIC ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> if (DEFINED LIBCXX_CXX_ABI_DEPS) >>> >>>>> >> add_dependencies(cxx LIBCXX_CXX_ABI_DEPS) >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> -set(libraries "") >>> >>>>> >> -if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) >>> >>>>> >> - # TODO(ericwf): Remove these GNU specific linker flags and >>> let >>> >>>>> >> CMake >>> >>>>> >> do the >>> >>>>> >> - # configuration. This will be more portable. >>> >>>>> >> - list(APPEND libraries "-Wl,--whole-archive" "-Wl,-Bstatic") >>> >>>>> >> - list(APPEND libraries "${LIBCXX_CXX_ABI_LIBRARY}") >>> >>>>> >> - list(APPEND libraries "-Wl,-Bdynamic" >>> "-Wl,--no-whole-archive") >>> >>>>> >> -else() >>> >>>>> >> - list(APPEND libraries "${LIBCXX_CXX_ABI_LIBRARY}") >>> >>>>> >> -endif() >>> >>>>> >> +#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it >>> to the >>> >>>>> >> search path. >>> >>>>> >> +add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH >>> >>>>> >> "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}") >>> >>>>> >> >>> >>>>> >> -# Generate library list. >>> >>>>> >> -append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread) >>> >>>>> >> -append_if(libraries LIBCXX_HAS_C_LIB c) >>> >>>>> >> -append_if(libraries LIBCXX_HAS_M_LIB m) >>> >>>>> >> -append_if(libraries LIBCXX_HAS_RT_LIB rt) >>> >>>>> >> -append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc_s) >>> >>>>> >> +add_library_flags_if(LIBCXX_COVERAGE_LIBRARY >>> >>>>> >> "${LIBCXX_COVERAGE_LIBRARY}") >>> >>>>> >> >>> >>>>> >> -if (LIBCXX_COVERAGE_LIBRARY) >>> >>>>> >> - target_link_libraries(cxx ${LIBCXX_COVERAGE_LIBRARY}) >>> >>>>> >> -endif() >>> >>>>> >> -target_link_libraries(cxx ${libraries}) >>> >>>>> >> +add_library_flags_if(LIBCXX_ENABLE_STATIC_ABI_LIBRARY >>> >>>>> >> "-Wl,--whole-archive" "-Wl,-Bstatic") >>> >>>>> >> +add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}") >>> >>>>> >> +add_library_flags_if(LIBCXX_ENABLE_STATIC_ABI_LIBRARY >>> >>>>> >> "-Wl,-Bdynamic" >>> >>>>> >> "-Wl,--no-whole-archive") >>> >>>>> >> >>> >>>>> >> if (APPLE AND LLVM_USE_SANITIZER) >>> >>>>> >> if ("${LLVM_USE_SANITIZER}" STREQUAL "Address") >>> >>>>> >> @@ -89,15 +64,21 @@ if (APPLE AND LLVM_USE_SANITIZER) >>> >>>>> >> set(LIBCXX_SANITIZER_LIBRARY "${LIBDIR}/${LIBFILE}") >>> >>>>> >> set(LIBCXX_SANITIZER_LIBRARY "${LIBCXX_SANITIZER_LIBRARY}" >>> >>>>> >> PARENT_SCOPE) >>> >>>>> >> message(STATUS "Manually linking compiler-rt library: >>> >>>>> >> ${LIBCXX_SANITIZER_LIBRARY}") >>> >>>>> >> - target_link_libraries(cxx "${LIBCXX_SANITIZER_LIBRARY}") >>> >>>>> >> - target_link_libraries(cxx "-Wl,-rpath,${LIBDIR}") >>> >>>>> >> + add_library_flags("${LIBCXX_SANITIZER_LIBRARY}") >>> >>>>> >> + add_link_flags("-Wl,-rpath,${LIBDIR}") >>> >>>>> >> endif() >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> +# Generate library list. >>> >>>>> >> +add_library_flags_if(LIBCXX_HAS_PTHREAD_LIB pthread) >>> >>>>> >> +add_library_flags_if(LIBCXX_HAS_C_LIB c) >>> >>>>> >> +add_library_flags_if(LIBCXX_HAS_M_LIB m) >>> >>>>> >> +add_library_flags_if(LIBCXX_HAS_RT_LIB rt) >>> >>>>> >> +add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s) >>> >>>>> >> >>> >>>>> >> # Setup flags. >>> >>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_FPIC_FLAG -fPIC) >>> >>>>> >> -append_if(LIBCXX_LINK_FLAGS LIBCXX_HAS_NODEFAULTLIBS_FLAG >>> >>>>> >> -nodefaultlibs) >>> >>>>> >> +add_flags_if_supported(-fPIC) >>> >>>>> >> +add_link_flags_if_supported(-nodefaultlibs) >>> >>>>> >> >>> >>>>> >> if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR >>> >>>>> >> LIBCXX_CXX_ABI_LIBNAME STREQUAL "none")) >>> >>>>> >> @@ -106,8 +87,8 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME S >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" ) >>> >>>>> >> - list(APPEND LIBCXX_COMPILE_FLAGS "-U__STRICT_ANSI__") >>> >>>>> >> - list(APPEND LIBCXX_LINK_FLAGS >>> >>>>> >> + add_definitions(-D__STRICT_ANSI__) >>> >>>>> >> + add_link_flags( >>> >>>>> >> "-compatibility_version 1" >>> >>>>> >> "-current_version 1" >>> >>>>> >> "-install_name /usr/lib/libc++.1.dylib" >>> >>>>> >> @@ -129,7 +110,7 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME S >>> >>>>> >> set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib >>> >>>>> >> >>> >>>>> >> >>> -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp") >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> - list(APPEND LIBCXX_LINK_FLAGS >>> >>>>> >> + add_link_flags( >>> >>>>> >> "-compatibility_version 1" >>> >>>>> >> "-install_name /usr/lib/libc++.1.dylib" >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp" >>> >>>>> >> @@ -139,8 +120,9 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME S >>> >>>>> >> endif() >>> >>>>> >> endif() >>> >>>>> >> >>> >>>>> >> -string(REPLACE ";" " " LIBCXX_COMPILE_FLAGS >>> >>>>> >> "${LIBCXX_COMPILE_FLAGS}") >>> >>>>> >> -string(REPLACE ";" " " LIBCXX_LINK_FLAGS >>> "${LIBCXX_LINK_FLAGS}") >>> >>>>> >> +target_link_libraries(cxx ${LIBCXX_LIBRARIES}) >>> >>>>> >> +split_list(LIBCXX_COMPILE_FLAGS) >>> >>>>> >> +split_list(LIBCXX_LINK_FLAGS) >>> >>>>> >> >>> >>>>> >> set_target_properties(cxx >>> >>>>> >> PROPERTIES >>> >>>>> >> >>> >>>>> >> Modified: libcxx/trunk/test/CMakeLists.txt >>> >>>>> >> URL: >>> >>>>> >> >>> >>>>> >> >>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeLists.txt?rev=243574&r1=243573&r2=243574&view=diff >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> >>>>> >> >>> ============================================================================== >>> >>>>> >> --- libcxx/trunk/test/CMakeLists.txt (original) >>> >>>>> >> +++ libcxx/trunk/test/CMakeLists.txt Wed Jul 29 16:07:28 2015 >>> >>>>> >> @@ -6,84 +6,47 @@ macro(pythonize_bool var) >>> >>>>> >> endif() >>> >>>>> >> endmacro() >>> >>>>> >> >>> >>>>> >> -set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's >>> llvm-lit.") >>> >>>>> >> +set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING >>> >>>>> >> + "Configuration variant to use for LIT.") >>> >>>>> >> >>> >>>>> >> -if(LIBCXX_BUILT_STANDALONE) >>> >>>>> >> - # Make sure we can use the console pool for recent cmake and >>> >>>>> >> ninja > >>> >>>>> >> 1.5 >>> >>>>> >> - if(CMAKE_VERSION VERSION_LESS 3.1.20141117) >>> >>>>> >> - set(cmake_3_2_USES_TERMINAL) >>> >>>>> >> - else() >>> >>>>> >> - set(cmake_3_2_USES_TERMINAL USES_TERMINAL) >>> >>>>> >> - endif() >>> >>>>> >> -else() >>> >>>>> >> - include(FindPythonInterp) >>> >>>>> >> - if(PYTHONINTERP_FOUND) >>> >>>>> >> - set(LIT_EXECUTABLE >>> >>>>> >> - ${PYTHON_EXECUTABLE} >>> ${CMAKE_SOURCE_DIR}/utils/lit/lit.py) >>> >>>>> >> - else() >>> >>>>> >> - message(WARNING "Could not find Python, cannot set >>> >>>>> >> LIT_EXECUTABLE.") >>> >>>>> >> - endif() >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS) >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_RTTI) >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_SHARED) >>> >>>>> >> +pythonize_bool(LIBCXX_BUILD_32_BITS) >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE) >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_STDIN) >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_STDOUT) >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_THREADS) >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS) >>> >>>>> >> +pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK) >>> >>>>> >> +pythonize_bool(LIBCXX_GENERATE_COVERAGE) >>> >>>>> >> +pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER) >>> >>>>> >> + >>> >>>>> >> +# The tests shouldn't link to any ABI library when it has been >>> >>>>> >> linked >>> >>>>> >> into >>> >>>>> >> +# libc++ statically. >>> >>>>> >> +if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) >>> >>>>> >> + set(LIBCXX_CXX_ABI_LIBNAME "none") >>> >>>>> >> endif() >>> >>>>> >> - >>> >>>>> >> -if (LIT_EXECUTABLE) >>> >>>>> >> - set(LIT_ARGS_DEFAULT "-sv --show-unsupported --show-xfail") >>> >>>>> >> - if (MSVC OR XCODE) >>> >>>>> >> - set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} >>> --no-progress-bar") >>> >>>>> >> - endif() >>> >>>>> >> - set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" >>> >>>>> >> - CACHE STRING "Default options for lit") >>> >>>>> >> - set(LIT_ARGS "${LLVM_LIT_ARGS}") >>> >>>>> >> - separate_arguments(LIT_ARGS) >>> >>>>> >> - >>> >>>>> >> - set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING >>> >>>>> >> - "Configuration variant to use for LIT.") >>> >>>>> >> - >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS) >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_RTTI) >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_SHARED) >>> >>>>> >> - pythonize_bool(LIBCXX_BUILD_32_BITS) >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE) >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_STDIN) >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_STDOUT) >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_THREADS) >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS) >>> >>>>> >> - pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK) >>> >>>>> >> - pythonize_bool(LIBCXX_GENERATE_COVERAGE) >>> >>>>> >> - pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER) >>> >>>>> >> - >>> >>>>> >> - # The tests shouldn't link to any ABI library when it has >>> been >>> >>>>> >> linked >>> >>>>> >> into >>> >>>>> >> - # libc++ statically. >>> >>>>> >> - if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) >>> >>>>> >> - set(LIBCXX_CXX_ABI_LIBNAME "none") >>> >>>>> >> - endif() >>> >>>>> >> - set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" >>> CACHE >>> >>>>> >> STRING >>> >>>>> >> - "TargetInfo to use when setting up test environment.") >>> >>>>> >> - set(LIBCXX_EXECUTOR "None" CACHE STRING >>> >>>>> >> - "Executor to use when running tests.") >>> >>>>> >> - >>> >>>>> >> - set(AUTO_GEN_COMMENT "## Autogenerated by libcxx >>> >>>>> >> configuration.\n# Do >>> >>>>> >> not edit!") >>> >>>>> >> - >>> >>>>> >> - configure_file( >>> >>>>> >> - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >>> >>>>> >>> >>>>> >> >>> >>>>> >> - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg >>> >>>>> >> - @ONLY) >>> >>>>> >> - >>> >>>>> >> - add_custom_target(check-libcxx >>> >>>>> >> - COMMAND ${LIT_EXECUTABLE} >>> >>>>> >> - ${LIT_ARGS} >>> >>>>> >> - ${CMAKE_CURRENT_BINARY_DIR} >>> >>>>> >> - DEPENDS cxx >>> >>>>> >> - COMMENT "Running libcxx tests" >>> >>>>> >> - ${cmake_3_2_USES_TERMINAL}) >>> >>>>> >> - >>> >>>>> >> - if (LIBCXX_GENERATE_COVERAGE) >>> >>>>> >> - include(CodeCoverage) >>> >>>>> >> - set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage") >>> >>>>> >> - set(capture_dirs >>> >>>>> >> >>> "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;${CMAKE_CURRENT_BINARY_DIR}") >>> >>>>> >> - set(extract_dirs >>> >>>>> >> "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src") >>> >>>>> >> - setup_lcov_test_target_coverage("cxx" "${output_dir}" >>> >>>>> >> "${capture_dirs}" "${extract_dirs}") >>> >>>>> >> - endif() >>> >>>>> >> -else() >>> >>>>> >> - message(WARNING >>> >>>>> >> - "LIT_EXECUTABLE not set, no check-libcxx target will >>> be >>> >>>>> >> available!") >>> >>>>> >> +set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE >>> >>>>> >> STRING >>> >>>>> >> + "TargetInfo to use when setting up test environment.") >>> >>>>> >> +set(LIBCXX_EXECUTOR "None" CACHE STRING >>> >>>>> >> + "Executor to use when running tests.") >>> >>>>> >> + >>> >>>>> >> +set(AUTO_GEN_COMMENT "## Autogenerated by libcxx >>> configuration.\n# >>> >>>>> >> Do not >>> >>>>> >> edit!") >>> >>>>> >> + >>> >>>>> >> +configure_file( >>> >>>>> >> + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >>> >>>>> >> + ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg >>> >>>>> >> + @ONLY) >>> >>>>> >> + >>> >>>>> >> +add_lit_testsuite(check-libcxx "Running libcxx tests" >>> >>>>> >> + ${CMAKE_CURRENT_BINARY_DIR} >>> >>>>> >> + DEPENDS cxx) >>> >>>>> >> + >>> >>>>> >> +if (LIBCXX_GENERATE_COVERAGE) >>> >>>>> >> + include(CodeCoverage) >>> >>>>> >> + set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage") >>> >>>>> >> + set(capture_dirs >>> >>>>> >> >>> "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;${CMAKE_CURRENT_BINARY_DIR}") >>> >>>>> >> + set(extract_dirs >>> >>>>> >> "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src") >>> >>>>> >> + setup_lcov_test_target_coverage("cxx" "${output_dir >> >> ... --089e011839b2cad745051c0c289c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: Quoted-printable

I'll revert the commits now.

On Jul 29, 2015 7:41 PM, "Alexey Samsonov&q= uot; <vonosmas@gmail.com> w= rote:
Eric, the build still fails due to the issue with compiler identificatio= n described above...

On Wed, Jul 29, 2015 at 4:33 PM, Alexey Samsonov <vonosmas@gmail= .com> wrote:
Trying the build now.

+Brad for a weird CMake issue. = Looks like CMake is unable to detect CMAKE_CXX_COMPILER_VERSION if I pass t= runk Clang as CMAKE_CXX_COMPILER, and pass "-fsanitize=3Dthread" = as CMAKE_CXX_FLAGS (Compiler identification is determined as "Clang&qu= ot; instead
of "Clang 3.8.0").

On Wed, Jul 29, 2015 at 4:24 P= M, Eric Fiselier <eric@efcs.ca> wrote:
I just pushed a possible fix to libc++. Let me know ASAP if that
doesn't fix the issue. I'll revert if r243591 doesn't work.

/Eric

On Wed, Jul 29, 2015 at 6:44 PM, Alexey Samsonov <vonosmas@gmail.com> wrote:
> Eric,
>
> Looks like it breaks the build of compiler-rt on Linux, and we can'= ;t fix it
> instantly, sorry =3D/
> Could you please revert it again?
>
> The problem is that when I pass correct -DLLVM_CONFIG=3D value when
> configuring standalone libcxx with
> just-built Clang, libcxx invokes llvm/cmake/modules/HandleLLVMOptions.= cmake,
> and it fails with an error
> "Host Clang version must be at least 3.1!",
> because CMake is unable to properly determine the compiler version of<= br> > just-built Clang as 3.8.0 for
> some reason(?!) I'm now looking into this issue, and will provide = a patch to
> compiler-rt that should accompany
> re-land of libcxx CMake changes.
>
> On Wed, Jul 29, 2015 at 3:05 PM, Eric Fiselier <eric@efcs.ca> wrote:
>>
>> Libc++ standalone builds now require that libc++ can find the LLVM= source
>> directory. If you specify the LLVM source root using
>> "-DLLVM_PATH=3Dpath/to/llvm" then the command should wor= k?
>>
>> Does this new requirement work for you?
>>
>> On Jul 29, 2015 6:03 PM, "Alexey Samsonov" = <samsonov@googl= e.com> wrote:
>>>
>>> I'm looking into the fix now, it probably should go to com= piler-rt
>>> anyway, so I don't think we should revert libcxx part now.=
>>>
>>> On Wed, Jul 29, 2015 at 2:59 PM, Kostya Serebryany <= kcc@google.com><= br> >>> wrote:
>>>>
>>>> Eric,
>>>> If there is no quick fix, will you be able to revert this,= please?
>>>>
>>>> On Wed, Jul 29, 2015 at 2:56 PM, Evgenii Stepanov
>>>> <eugeni.stepanov@gmail.com> wrote:
>>>>>
>>>>> And the log says:
>>>>>
>>>>> CMake Error at cmake/Modules/FindLLVM.cmake:41 (messag= e):
>>>>>=C2=A0 =C2=A0llvm-config not found and LLVM_MAIN_SRC_DI= R not defined.=C2=A0 Reconfigure
>>>>> with
>>>>>=C2=A0 =C2=A0-DLLVM_CONFIG=3Dpath/to/llvm-config or
>>>>> -DLLVM_PATH=3Dpath/to/llvm-source-root.
>>>>> Call Stack (most recent call first):
>>>>>=C2=A0 =C2=A0CMakeLists.txt:37 (include)
>>>>>
>>>>> On Wed, Jul 29, 2015 at 2:49 PM, Kostya Serebry= any <kcc@google.com<= /a>>
>>>>> wrote:
>>>>> > I am seeing build failure when trying to run &quo= t;ninja check-msan":
>>>>> >
>>>>> > [39/58] Performing configure step for 'libcxx= _msan-with-call'
>>>>> > FAILED: cd
>>>>> >
>>>>> > /usr/local/google/home/kcc/llvm-gcc-build/project= s/compiler-rt/lib/msan/libcxx_msan-with-call/src/libcxx_msan-with-call-buil= d
>>>>> > && /usr/bin/cmake -P
>>>>> >
>>>>> > /usr/local/google/home/kcc/llvm-gcc-build/project= s/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-= call-stamp/libcxx_msan-with-call-configure.cmake
>>>>> > && /usr/bin/cmake -E touch
>>>>> >
>>>>> > /usr/local/google/home/kcc/llvm-gcc-build/project= s/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-= call-stamp/libcxx_msan-with-call-configure
>>>>> > CMake Error at
>>>>> >
>>>>> > /usr/local/google/home/kcc/llvm-gcc-build/project= s/compiler-rt/lib/msan/libcxx_msan-with-call/src/libcxx_msan-with-call-stam= p/libcxx_msan-with-call-configure.cmake:16
>>>>> > (message):
>>>>> >=C2=A0 =C2=A0Command failed: 1
>>>>> >
>>>>> >=C2=A0 =C2=A0 '/usr/bin/cmake'
>>>>> >
>>>>> > '-DCMAKE_C_COMPILER=3D/usr/local/google/home/= kcc/llvm-gcc-build/./bin/clang'
>>>>> >
>>>>> > '-DCMAKE_CXX_COMPILER=3D/usr/local/google/hom= e/kcc/llvm-gcc-build/./bin/clang'
>>>>> > '-DCMAKE_C_FLAGS=3D -fsanitize=3Dmemory -fsan= itize-memory-track-origins
>>>>> > -Wno-pedantic -fsanitize=3Dmemory -fsanitize-memo= ry-track-origins
>>>>> > -Wno-pedantic -mllvm -msan-instrumentation-with-c= all-threshold=3D0'
>>>>> > '-DCMAKE_CXX_FLAGS=3D -fsanitize=3Dmemory -fs= anitize-memory-track-origins
>>>>> > -Wno-pedantic -fsanitize=3Dmemory -fsanitize-memo= ry-track-origins
>>>>> > -Wno-pedantic -mllvm -msan-instrumentation-with-c= all-threshold=3D0'
>>>>> > '-DCMAKE_BUILD_TYPE=3DRelease'
>>>>> >
>>>>> > '-DCMAKE_INSTALL_PREFIX:PATH=3D/usr/local/goo= gle/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_m= san-with-call'
>>>>> > '-GNinja' '/usr/local/google/home/kcc= /llvm/projects/libcxx'
>>>>> >
>>>>> >=C2=A0 =C2=A0See also
>>>>> >
>>>>> >
>>>>> >
>>>>> > /usr/local/google/home/kcc/llvm-gcc-build/project= s/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-= call-stamp/libcxx_msan-with-call-configure-*.log
>>>>> >
>>>>> >
>>>>> > Looks like this is the only change that might hav= e caused this.
>>>>> >
>>>>> > On Wed, Jul 29, 2015 at 2:07 PM= , Eric Fiselier <
eric@= efcs.ca> wrote:
>>>>> >>
>>>>> >> Author: ericwf
>>>>> >> Date: Wed Jul 29 16:07:28 2015
>>>>> >> New Revision: 243574
>>>>> >>
>>>>> >> URL: http://llvm.org/viewvc/llvm-project?rev=3D243574&view= =3Drev
>>>>> >> Log:
>>>>> >> Recommit r243503 "[libcxx] Cleanup CMake= configuration and integrate
>>>>> >> with
>>>>> >> LLVM"
>>>>> >>
>>>>> >> This change was reverted in r243550 because i= t broke clang-format
>>>>> >> builds
>>>>> >> (see PR24306).
>>>>> >>
>>>>> >> This patch recommits a fixed version of the o= riginal.
>>>>> >>
>>>>> >> Added:
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/cmake/Modules= /FindLLVM.cmake
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/cmake/Modules= /HandleLibcxxFlags.cmake
>>>>> >> Modified:
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/CMakeLists.tx= t
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/cmake/Modules= /HandleLibCXXABI.cmake
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/cmake/config-= ix.cmake
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/lib/CMakeList= s.txt
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/test/CMakeLis= ts.txt
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/= test/lit.site.cfg.in
>>>>> >>=C2=A0 =C2=A0 =C2=A0libcxx/trunk/www/index.htm= l
>>>>> >>
>>>>> >> Modified: libcxx/trunk/CMakeLists.txt
>>>>> >> URL:
>>>>> >>
>>>>> >> http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=3D24= 3574&r1=3D243573&r2=3D243574&view=3Ddiff
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> --- libcxx/trunk/CMakeLists.txt (original)
>>>>> >> +++ libcxx/trunk/CMakeLists.txt Wed Jul 29 16= :07:28 2015
>>>>> >> @@ -3,13 +3,16 @@
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >>=C2=A0 # Setup Project
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> -
>>>>> >> -project(libcxx CXX C)
>>>>> >>=C2=A0 cmake_minimum_required(VERSION 2.8)
>>>>> >>
>>>>> >>=C2=A0 if(POLICY CMP0042)
>>>>> >>=C2=A0 =C2=A0 cmake_policy(SET CMP0042 NEW) # = Set MACOSX_RPATH=3DYES by default
>>>>> >>=C2=A0 endif()
>>>>> >> +if(POLICY CMP0022)
>>>>> >> +=C2=A0 cmake_policy(SET CMP0022 NEW) # Requi= red when interacting with
>>>>> >> LLVM and
>>>>> >> Clang
>>>>> >> +endif()
>>>>> >> +
>>>>> >> +project(libcxx CXX C)
>>>>> >>
>>>>> >>=C2=A0 set(PACKAGE_NAME libcxx)
>>>>> >>=C2=A0 set(PACKAGE_VERSION trunk-svn)
>>>>> >> @@ -30,52 +33,90 @@ MACRO_ENSURE_OUT_OF_SOURC= E_BUILD(
>>>>> >>=C2=A0 =C2=A0build directory and run 'cmak= e /path/to/${PROJECT_NAME} [options]'
>>>>> >> there."
>>>>> >>=C2=A0 =C2=A0)
>>>>> >>
>>>>> >> -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_S= OURCE_DIR)
>>>>> >> -=C2=A0 set(LIBCXX_LIBDIR_SUFFIX ""= CACHE STRING
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 "Define suffix of = library directory name (32/64)")
>>>>> >> -
>>>>> >> -=C2=A0 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
>>>>> >> ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX= })
>>>>> >> -=C2=A0 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
>>>>> >> ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX= })
>>>>> >> -
>>>>> >> -=C2=A0 set(LIBCXX_BUILT_STANDALONE 1)
>>>>> >> -else()
>>>>> >> -=C2=A0 set(LIBCXX_LIBDIR_SUFFIX ${LLVM_LIBDI= R_SUFFIX})
>>>>> >> -endif()
>>>>> >> +# Find the required bits of LLVM
>>>>> >> +include(FindLLVM)
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >>=C2=A0 # Setup CMake Options
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >>
>>>>> >> -# Define options.
>>>>> >> -option(LIBCXX_ENABLE_EXCEPTIONS "Use ex= ceptions." ON)
>>>>> >> -option(LIBCXX_ENABLE_RTTI "Use run time= type information." ON)
>>>>> >> +# Basic options
>>>>> >> ---------------------------------------------= ------------------
>>>>> >>=C2=A0 option(LIBCXX_ENABLE_ASSERTIONS "E= nable assertions independent of
>>>>> >> build
>>>>> >> mode." ON)
>>>>> >> -option(LIBCXX_ENABLE_PEDANTIC "Compile = with pedantic enabled." ON)
>>>>> >> -option(LIBCXX_ENABLE_WERROR "Fail and s= top if a warning is
>>>>> >> triggered."
>>>>> >> OFF)
>>>>> >> -option(LIBCXX_ENABLE_CXX1Y "Enable -std= =3Dc++1y and use of c++1y
>>>>> >> language
>>>>> >> features if the compiler supports it." O= FF)
>>>>> >>=C2=A0 option(LIBCXX_ENABLE_SHARED "Build= libc++ as a shared library." ON)
>>>>> >> +
>>>>> >> +set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR= _SUFFIX}" CACHE STRING
>>>>> >> +=C2=A0 =C2=A0 "Define suffix of library= directory name (32/64)")
>>>>> >> +option(LIBCXX_INSTALL_HEADERS "Install = the libc++ headers." ON)
>>>>> >> +option(LIBCXX_INSTALL_SUPPORT_HEADERS "= Install libc++ support
>>>>> >> headers."
>>>>> >> ON)
>>>>> >> +
>>>>> >> +# ABI Library options
>>>>> >> ---------------------------------------------= ------------
>>>>> >> +set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}&q= uot; CACHE STRING
>>>>> >> +=C2=A0 =C2=A0 "Specify C++ ABI library = to use." FORCE)
>>>>> >> +set(CXXABIS none libcxxabi libcxxrt libstdc+= + libsupc++)
>>>>> >> +set_property(CACHE LIBCXX_CXX_ABI PROPERTY S= TRINGS ;${CXXABIS})
>>>>> >> +
>>>>> >> +option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY &quo= t;Statically link the ABI
>>>>> >> library"
>>>>> >> OFF)
>>>>> >> +
>>>>> >> +# Build libc++abi with libunwind. We need th= is option to determine
>>>>> >> whether to
>>>>> >> +# link with libunwind or libgcc_s while runn= ing the test cases.
>>>>> >> +option(LIBCXXABI_USE_LLVM_UNWINDER "Bui= ld and use the LLVM
>>>>> >> unwinder."
>>>>> >> OFF)
>>>>> >> +
>>>>> >> +# Target options
>>>>> >> ---------------------------------------------= -----------------
>>>>> >> +option(LIBCXX_BUILD_32_BITS "Build 32 b= it libc++." OFF)
>>>>> >> +set(LIBCXX_SYSROOT "" CACHE STRING= "Use alternate sysroot.")
>>>>> >> +set(LIBCXX_GCC_TOOLCHAIN "" CACHE = STRING "Use alternate GCC
>>>>> >> toolchain.")
>>>>> >> +
>>>>> >> +# Feature options
>>>>> >> ---------------------------------------------= ----------------
>>>>> >> +option(LIBCXX_ENABLE_EXCEPTIONS "Use ex= ceptions." ON)
>>>>> >> +option(LIBCXX_ENABLE_RTTI "Use run time= type information." ON)
>>>>> >>=C2=A0 option(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_= NAMESPACE "Build libc++ with
>>>>> >> support for the global filesystem namespace.&= quot; ON)
>>>>> >>=C2=A0 option(LIBCXX_ENABLE_STDIN "Build = libc++ with support for
>>>>> >> stdin/std::cin." ON)
>>>>> >>=C2=A0 option(LIBCXX_ENABLE_STDOUT "Build= libc++ with support for
>>>>> >> stdout/std::cout." ON)
>>>>> >>=C2=A0 option(LIBCXX_ENABLE_THREADS "Buil= d libc++ with support for
>>>>> >> threads." ON)
>>>>> >>=C2=A0 option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FU= NCTIONS "Build libc++ with
>>>>> >> support
>>>>> >> for thread-unsafe C functions" ON)
>>>>> >> -option(LIBCXX_BUILD_32_BITS "Build 32 b= it libc++" OFF)
>>>>> >>=C2=A0 option(LIBCXX_ENABLE_MONOTONIC_CLOCK
>>>>> >>=C2=A0 =C2=A0 "Build libc++ with support = for a monotonic clock.
>>>>> >>=C2=A0 =C2=A0 =C2=A0This option may only be us= ed when LIBCXX_ENABLE_THREADS=3DOFF."
>>>>> >> ON)
>>>>> >> -option(LIBCXX_INSTALL_HEADERS "Install = the libc++ headers." ON)
>>>>> >> -option(LIBCXX_INSTALL_SUPPORT_HEADERS "= Install libc++ support
>>>>> >> headers."
>>>>> >> ON)
>>>>> >> +
>>>>> >> +# Misc options
>>>>> >> ---------------------------------------------= -------------------
>>>>> >> +option(LIBCXX_ENABLE_PEDANTIC "Compile = with pedantic enabled." ON)
>>>>> >> +option(LIBCXX_ENABLE_WERROR "Fail and s= top if a warning is
>>>>> >> triggered."
>>>>> >> OFF)
>>>>> >> +
>>>>> >>=C2=A0 option(LIBCXX_GENERATE_COVERAGE "E= nable generating code coverage."
>>>>> >> OFF)
>>>>> >>=C2=A0 set(LIBCXX_COVERAGE_LIBRARY ""= ; CACHE STRING
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0"The Profile= -rt library used to build with code coverage")
>>>>> >> -option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY &quo= t;Statically link the ABI
>>>>> >> library"
>>>>> >> OFF)
>>>>> >> -set(LIBCXX_SYSROOT "" CACHE STRING= "Use alternate sysroot.")
>>>>> >> -set(LIBCXX_GCC_TOOLCHAIN "" CACHE = STRING "Use alternate GCC
>>>>> >> toolchain.")
>>>>> >> -if (LIBCXX_BUILT_STANDALONE)
>>>>> >> -=C2=A0 set(LLVM_USE_SANITIZER "" C= ACHE STRING
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 "Define the saniti= zer used to build the library and tests")
>>>>> >> +=C2=A0 =C2=A0 "The Profile-rt library u= sed to build with code coverage")
>>>>> >> +
>>>>> >>
>>>>> >>
>>>>> >> +#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> +# Check option configurations
>>>>> >>
>>>>> >>
>>>>> >> +#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> +
>>>>> >> +# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is se= t to ON only when
>>>>> >> +# LIBCXX_ENABLE_THREADS is on.
>>>>> >> +if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENAB= LE_MONOTONIC_CLOCK)
>>>>> >> +=C2=A0 message(FATAL_ERROR "LIBCXX_ENAB= LE_MONOTONIC_CLOCK can only be
>>>>> >> set to
>>>>> >> OFF"
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " when LIBCXX_ENABLE_THREADS is als= o set to
>>>>> >> OFF.")
>>>>> >> +endif()
>>>>> >> +
>>>>> >> +# Ensure LLVM_USE_SANITIZER is not specified= when
>>>>> >> LIBCXX_GENERATE_COVERAGE
>>>>> >> +# is ON.
>>>>> >> +if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_C= OVERAGE)
>>>>> >> +=C2=A0 message(FATAL_ERROR "LLVM_USE_SA= NITIZER cannot be used with
>>>>> >> LIBCXX_GENERATE_COVERAGE")
>>>>> >> +endif()
>>>>> >> +
>>>>> >> +# Set LIBCXX_BUILD_32_BITS to (LIBCXX_BUILD_= 32_BITS OR
>>>>> >> LLVM_BUILD_32_BITS)
>>>>> >> +# and check that we can build with 32 bits i= f requested.
>>>>> >> +if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN3= 2)
>>>>> >> +=C2=A0 if (LIBCXX_BUILD_32_BITS OR LLVM_BUIL= D_32_BITS)
>>>>> >> +=C2=A0 =C2=A0 if (NOT LLVM_BUILD_32_BITS) # = Don't duplicate the output from
>>>>> >> LLVM
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 message(STATUS "Bu= ilding 32 bits executables and libraries.")
>>>>> >> +=C2=A0 =C2=A0 endif()
>>>>> >> +=C2=A0 =C2=A0 set(LIBCXX_BUILD_32_BITS ON CA= CHE BOOL "" FORCE)
>>>>> >> +=C2=A0 endif()
>>>>> >> +elseif(LIBCXX_BUILD_32_BITS)
>>>>> >> +=C2=A0 message(FATAL_ERROR "LIBCXX_BUIL= D_32_BITS=3DON is not supported on
>>>>> >> this
>>>>> >> platform.")
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> +# Check that this option is not enabled on A= pple and emit a usage
>>>>> >> warning.
>>>>> >>=C2=A0 if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) >>>>> >>=C2=A0 =C2=A0 if (APPLE)
>>>>> >>=C2=A0 =C2=A0 =C2=A0 message(FATAL_ERROR "= ;LIBCXX_ENABLE_STATIC_ABI_LIBRARY is not
>>>>> >> supported on OS X")
>>>>> >> @@ -84,27 +125,6 @@ if (LIBCXX_ENABLE_STATIC_= ABI_LIBRARY)
>>>>> >>=C2=A0 =C2=A0 endif()
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> -set(CXXABIS none libcxxabi libcxxrt libstdc+= + libsupc++)
>>>>> >> -if (NOT LIBCXX_CXX_ABI)
>>>>> >> -=C2=A0 if (NOT DEFINED LIBCXX_BUILT_STANDALO= NE AND
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 IS_DIRECTORY "${CM= AKE_SOURCE_DIR}/projects/libcxxabi")
>>>>> >> -=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_LIBNAME &qu= ot;libcxxabi")
>>>>> >> -=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_INCLUDE_PAT= HS
>>>>> >> "${CMAKE_SOURCE_DIR}/projects/libcxxabi/= include")
>>>>> >> -=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_INTREE 1) >>>>> >> -=C2=A0 else ()
>>>>> >> -=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_LIBNAME &qu= ot;none")
>>>>> >> -=C2=A0 endif ()
>>>>> >> -else ()
>>>>> >> -=C2=A0 set(LIBCXX_CXX_ABI_LIBNAME "${LI= BCXX_CXX_ABI}")
>>>>> >> -endif ()
>>>>> >> -set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}&q= uot; CACHE STRING
>>>>> >> -=C2=A0 =C2=A0 "Specify C++ ABI library = to use." FORCE)
>>>>> >> -set_property(CACHE LIBCXX_CXX_ABI PROPERTY S= TRINGS ;${CXXABIS})
>>>>> >> -
>>>>> >> -# Build libc++abi with libunwind. We need th= is option to determine
>>>>> >> whether to
>>>>> >> -# link with libunwind or libgcc_s while runn= ing the test cases.
>>>>> >> -option(LIBCXXABI_USE_LLVM_UNWINDER "Bui= ld and use the LLVM
>>>>> >> unwinder."
>>>>> >> OFF)
>>>>> >> -
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >>=C2=A0 # Configure System
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> @@ -114,234 +134,113 @@ set(LIBCXX_SOURCE_DIR= =C2=A0 ${CMAKE_CURRENT_S
>>>>> >>=C2=A0 set(LIBCXX_BINARY_DIR=C2=A0 ${CMAKE_CUR= RENT_BINARY_DIR})
>>>>> >>=C2=A0 set(LIBCXX_LIBRARY_DIR
>>>>> >> ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX= })
>>>>> >>
>>>>> >> +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_= LIBRARY_DIR})
>>>>> >> +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_= LIBRARY_DIR})
>>>>> >> +
>>>>> >>=C2=A0 # Declare libc++ configuration variable= s.
>>>>> >>=C2=A0 # They are intended for use as follows:=
>>>>> >>=C2=A0 # LIBCXX_CXX_FLAGS: General flags for b= oth the compiler and linker.
>>>>> >>=C2=A0 # LIBCXX_COMPILE_FLAGS: Compile only fl= ags.
>>>>> >>=C2=A0 # LIBCXX_LINK_FLAGS: Linker only flags.=
>>>>> >> -set(LIBCXX_CXX_FLAGS "")
>>>>> >>=C2=A0 set(LIBCXX_COMPILE_FLAGS "")<= br> >>>>> >>=C2=A0 set(LIBCXX_LINK_FLAGS "")
>>>>> >> +set(LIBCXX_LIBRARIES "")
>>>>> >>
>>>>> >>=C2=A0 # Configure compiler.
>>>>> >>=C2=A0 include(config-ix)
>>>>> >> -# Configure ABI library
>>>>> >> -include(HandleLibCXXABI)
>>>>> >> +
>>>>> >>=C2=A0 # Configure coverage options.
>>>>> >>=C2=A0 if (LIBCXX_GENERATE_COVERAGE)
>>>>> >>=C2=A0 =C2=A0 include(CodeCoverage)
>>>>> >>=C2=A0 =C2=A0 set(CMAKE_BUILD_TYPE "COVER= AGE" CACHE STRING "" FORCE)
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> +string(TOUPPER "${CMAKE_BUILD_TYPE}&quo= t; uppercase_CMAKE_BUILD_TYPE)
>>>>> >> +
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >>=C2=A0 # Setup Compiler Flags
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >>
>>>>> >> -# Get required flags.
>>>>> >> -# On all systems the system c++ standard lib= rary headers need to be
>>>>> >> excluded.
>>>>> >> -if (MSVC)
>>>>> >> -=C2=A0 # MSVC only has -X, which disables al= l default includes;
>>>>> >> including the
>>>>> >> crt.
>>>>> >> -=C2=A0 # Thus, we do nothing and hope we don= 't accidentally include any
>>>>> >> of the
>>>>> >> C++
>>>>> >> -=C2=A0 # headers.
>>>>> >> -else()
>>>>> >> -=C2=A0 if (LIBCXX_HAS_NOSTDINCXX_FLAG)
>>>>> >> -=C2=A0 =C2=A0 list(APPEND LIBCXX_COMPILE_FLA= GS -nostdinc++)
>>>>> >> -=C2=A0 =C2=A0 string(REPLACE "-stdlib= =3Dlibc++" "" CMAKE_CXX_FLAGS
>>>>> >> "${CMAKE_CXX_FLAGS}")
>>>>> >> -=C2=A0 =C2=A0 string(REPLACE "-stdlib= =3Dlibstdc++" "" CMAKE_CXX_FLAGS
>>>>> >> "${CMAKE_CXX_FLAGS}")
>>>>> >> -=C2=A0 endif()
>>>>> >> -=C2=A0 # If c++1y has been enabled then atte= mpt to use it. Fail if it is
>>>>> >> no
>>>>> >> supported
>>>>> >> -=C2=A0 # by the compiler. Otherwise choose c= ++11 and ensure the compiler
>>>>> >> supports it.
>>>>> >> -=C2=A0 if (LIBCXX_ENABLE_CXX1Y)
>>>>> >> -=C2=A0 =C2=A0 if (LIBCXX_HAS_STDCXX1Y_FLAG)<= br> >>>>> >> -=C2=A0 =C2=A0 =C2=A0 set(LIBCXX_STD_VERSION = c++1y)
>>>>> >> -=C2=A0 =C2=A0 else()
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 message(FATAL_ERROR &qu= ot;c++1y was enabled but the compiler does
>>>>> >> not
>>>>> >> support it.")
>>>>> >> -=C2=A0 =C2=A0 endif()
>>>>> >> -=C2=A0 else()
>>>>> >> -=C2=A0 =C2=A0 if (LIBCXX_HAS_STDCXX11_FLAG)<= br> >>>>> >> -=C2=A0 =C2=A0 =C2=A0 set(LIBCXX_STD_VERSION = c++11)
>>>>> >> -=C2=A0 =C2=A0 else()
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 message(FATAL_ERROR &qu= ot;c++11 is required by libc++ but is not
>>>>> >> supported by the compiler")
>>>>> >> -=C2=A0 =C2=A0 endif()
>>>>> >> -=C2=A0 endif()
>>>>> >> -=C2=A0 # LIBCXX_STD_VERSION should always be= set at this point.
>>>>> >> -=C2=A0 list(APPEND LIBCXX_CXX_FLAGS "-s= td=3D${LIBCXX_STD_VERSION}")
>>>>> >> -endif()
>>>>> >> +include(HandleLibCXXABI) # Steup the ABI lib= rary flags
>>>>> >>
>>>>> >> -macro(append_if list condition var)
>>>>> >> -=C2=A0 if (${condition})
>>>>> >> -=C2=A0 =C2=A0 list(APPEND ${list} ${var})
>>>>> >> -=C2=A0 endif()
>>>>> >> -endmacro()
>>>>> >> +# Include macros for adding and removing lib= c++ flags.
>>>>> >> +include(HandleLibcxxFlags)
>>>>> >>
>>>>> >> -# Get warning flags
>>>>> >> -# Disable the system header pragma.
>>>>> >> -add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYST= EM_HEADER)
>>>>> >> -if (NOT MSVC)
>>>>> >> -=C2=A0 append_if(LIBCXX_COMPILE_FLAGS LIBCXX= _HAS_WALL_FLAG -Wall)
>>>>> >> -=C2=A0 list(APPEND LIBCXX_COMPILE_FLAGS -Wer= ror=3Dreturn-type)
>>>>> >> +# Remove flags that may have snuck in.
>>>>> >> +remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0-stdlib=3Dlibc++ -stdlib=3Dlibstdc++ -lc++abi -m32)
>>>>> >> +
>>>>> >> +# Required flags
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> +add_compile_flags_if_supported(-std=3Dc++11)=
>>>>> >> +if (NOT MSVC AND NOT LIBCXX_SUPPORTS_STD_EQ_= CXX11_FLAG)
>>>>> >> +=C2=A0 message(FATAL_ERROR "C++11 is re= quired but the compiler does not
>>>>> >> support -std=3Dc++11")
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_W_= FLAG -W)
>>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WN= O_UNUSED_PARAMETER_FLAG
>>>>> >> -Wno-unused-parameter)
>>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WW= RITE_STRINGS_FLAG
>>>>> >> -Wwrite-strings)
>>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WN= O_LONG_LONG_FLAG
>>>>> >> -Wno-long-long)
>>>>> >> +# On all systems the system c++ standard lib= rary headers need to be
>>>>> >> excluded.
>>>>> >> +# MSVC only has -X, which disables all defau= lt includes; including
>>>>> >> the
>>>>> >> crt.
>>>>> >> +# Thus, we do nothing and hope we don't = accidentally include any of
>>>>> >> the
>>>>> >> C++
>>>>> >> +# headers
>>>>> >> +add_compile_flags_if_supported(-nostdinc++)<= br> >>>>> >> +
>>>>> >> +# Target flags
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> +add_flags_if(LIBCXX_BUILD_32_BITS -m32)
>>>>> >> +add_flags_if(LIBCXX_TARGET_TRIPLE "-tar= get
>>>>> >> ${LIBCXX_TARGET_TRIPLE}")
>>>>> >> +add_flags_if(LIBCXX_SYSROOT "--sysroot = ${LIBCXX_SYSROOT}")
>>>>> >> +add_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc= -toolchain
>>>>> >> ${LIBCXX_GCC_TOOLCHAIN}")
>>>>> >> +
>>>>> >> +# Warning flags
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> +add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYST= EM_HEADER)
>>>>> >> +add_compile_flags_if_supported(
>>>>> >> +=C2=A0 =C2=A0 -Wall -W -Wwrite-strings
>>>>> >> +=C2=A0 =C2=A0 -Wno-unused-parameter -Wno-lon= g-long
>>>>> >> +=C2=A0 =C2=A0 -Werror=3Dreturn-type)
>>>>> >>=C2=A0 if (LIBCXX_ENABLE_WERROR)
>>>>> >> -=C2=A0 append_if(LIBCXX_COMPILE_FLAGS LIBCXX= _HAS_WERROR_FLAG -Werror)
>>>>> >> -=C2=A0 append_if(LIBCXX_COMPILE_FLAGS LIBCXX= _HAS_WX_FLAG -WX)
>>>>> >> -else()
>>>>> >> -=C2=A0 append_if(LIBCXX_COMPILE_FLAGS LIBCXX= _HAS_WNO_ERROR_FLAG
>>>>> >> -Wno-error)
>>>>> >> -=C2=A0 append_if(LIBCXX_COMPILE_FLAGS LIBCXX= _HAS_NO_WX_FLAG -WX-)
>>>>> >> +=C2=A0 add_compile_flags_if_supported(-Werro= r)
>>>>> >> +=C2=A0 add_compile_flags_if_supported(-WX) >>>>> >>=C2=A0 endif()
>>>>> >>=C2=A0 if (LIBCXX_ENABLE_PEDANTIC)
>>>>> >> -=C2=A0 append_if(LIBCXX_COMPILE_FLAGS LIBCXX= _HAS_PEDANTIC_FLAG
>>>>> >> -pedantic)
>>>>> >> +=C2=A0 add_compile_flags_if_supported(-pedan= tic)
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> -# Get feature flags.
>>>>> >> -# Exceptions
>>>>> >> +# Exception flags
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >>=C2=A0 if (LIBCXX_ENABLE_EXCEPTIONS)
>>>>> >>=C2=A0 =C2=A0 # Catches C++ exceptions only an= d tells the compiler to assume
>>>>> >> that
>>>>> >> extern C
>>>>> >>=C2=A0 =C2=A0 # functions never throw a C++ ex= ception.
>>>>> >> -=C2=A0 append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS= _EHSC_FLAG -EHsc)
>>>>> >> +=C2=A0 add_compile_flags_if_supported(-EHsc)=
>>>>> >>=C2=A0 else()
>>>>> >> -=C2=A0 list(APPEND LIBCXX_CXX_FLAGS -D_LIBCP= P_NO_EXCEPTIONS)
>>>>> >> -=C2=A0 append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS= _NO_EHS_FLAG -EHs-)
>>>>> >> -=C2=A0 append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS= _NO_EHA_FLAG -EHa-)
>>>>> >> -=C2=A0 append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS= _FNO_EXCEPTIONS_FLAG
>>>>> >> -fno-exceptions)
>>>>> >> +=C2=A0 add_definitions(-D_LIBCPP_NO_EXCEPTIO= NS)
>>>>> >> +=C2=A0 add_compile_flags_if_supported(-EHs- = -EHa-)
>>>>> >> +=C2=A0 add_compile_flags_if_supported(-fno-e= xceptions)
>>>>> >>=C2=A0 endif()
>>>>> >> -# RTTI
>>>>> >> +
>>>>> >> +# RTTI flags
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D
>>>>> >>=C2=A0 if (NOT LIBCXX_ENABLE_RTTI)
>>>>> >> -=C2=A0 list(APPEND LIBCXX_CXX_FLAGS -D_LIBCP= P_NO_RTTI)
>>>>> >> -=C2=A0 append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS= _NO_GR_FLAG -GR-)
>>>>> >> -=C2=A0 append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS= _FNO_RTTI_FLAG -fno-rtti)
>>>>> >> +=C2=A0 add_definitions(-D_LIBCPP_NO_RTTI)
>>>>> >> +=C2=A0 add_compile_flags_if_supported(-GR-)<= br> >>>>> >> +=C2=A0 add_compile_flags_if_supported(-fno-r= tti)
>>>>> >>=C2=A0 endif()
>>>>> >> -# Assert
>>>>> >> -string(TOUPPER "${CMAKE_BUILD_TYPE}&quo= t; uppercase_CMAKE_BUILD_TYPE)
>>>>> >> +
>>>>> >> +# Assertion flags
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> +define_if(LIBCXX_ENABLE_ASSERTIONS -UNDEBUG)=
>>>>> >> +define_if_not(LIBCXX_ENABLE_ASSERTIONS -DNDE= BUG)
>>>>> >>=C2=A0 if (LIBCXX_ENABLE_ASSERTIONS)
>>>>> >>=C2=A0 =C2=A0 # MSVC doesn't like _DEBUG o= n release builds. See PR 4379.
>>>>> >> -=C2=A0 if (NOT MSVC)
>>>>> >> -=C2=A0 =C2=A0 list(APPEND LIBCXX_COMPILE_FLA= GS -D_DEBUG)
>>>>> >> -=C2=A0 endif()
>>>>> >> -=C2=A0 # On Release builds cmake automatical= ly defines NDEBUG, so we
>>>>> >> -=C2=A0 # explicitly undefine it:
>>>>> >> -=C2=A0 if (uppercase_CMAKE_BUILD_TYPE STREQU= AL "RELEASE")
>>>>> >> -=C2=A0 =C2=A0 list(APPEND LIBCXX_COMPILE_FLA= GS -UNDEBUG)
>>>>> >> -=C2=A0 endif()
>>>>> >> -else()
>>>>> >> -=C2=A0 if (NOT uppercase_CMAKE_BUILD_TYPE ST= REQUAL "RELEASE")
>>>>> >> -=C2=A0 =C2=A0 list(APPEND LIBCXX_COMPILE_FLA= GS -DNDEBUG)
>>>>> >> -=C2=A0 endif()
>>>>> >> -endif()
>>>>> >> -# Static library
>>>>> >> -if (NOT LIBCXX_ENABLE_SHARED)
>>>>> >> -=C2=A0 list(APPEND LIBCXX_COMPILE_FLAGS -D_L= IBCPP_BUILD_STATIC)
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN3= 2)
>>>>> >> -=C2=A0 if (LIBCXX_BUILD_32_BITS)
>>>>> >> -=C2=A0 =C2=A0 message(STATUS "Building = 32 bits executables and libraries.")
>>>>> >> -=C2=A0 =C2=A0 list(APPEND LIBCXX_CXX_FLAGS &= quot;-m32")
>>>>> >> -=C2=A0 endif()
>>>>> >> -elseif(LIBCXX_BUILD_32_BITS)
>>>>> >> -=C2=A0 message(FATAL_ERROR "LIBCXX_BUIL= D_32_BITS=3DON is not supported on
>>>>> >> this
>>>>> >> platform.")
>>>>> >> -endif()
>>>>> >> -# This is the _ONLY_ place where add_definit= ions is called.
>>>>> >> -if (MSVC)
>>>>> >> -=C2=A0 add_definitions(-D_CRT_SECURE_NO_WARN= INGS)
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -# LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE = configuration
>>>>> >> -if (NOT LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAME= SPACE)
>>>>> >> -=C2=A0 add_definitions(-D_LIBCPP_HAS_NO_GLOB= AL_FILESYSTEM_NAMESPACE)
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -# LIBCXX_ENABLE_STDIN configuration
>>>>> >> -if (NOT LIBCXX_ENABLE_STDIN)
>>>>> >> -=C2=A0 add_definitions(-D_LIBCPP_HAS_NO_STDI= N)
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -# LIBCXX_ENABLE_STDOUT configuration
>>>>> >> -if (NOT LIBCXX_ENABLE_STDOUT)
>>>>> >> -=C2=A0 add_definitions(-D_LIBCPP_HAS_NO_STDO= UT)
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -# LIBCXX_ENABLE_THREADS configuration
>>>>> >> -if (NOT LIBCXX_ENABLE_THREADS)
>>>>> >> -=C2=A0 add_definitions(-D_LIBCPP_HAS_NO_THRE= ADS)
>>>>> >> -=C2=A0 if (NOT LIBCXX_ENABLE_MONOTONIC_CLOCK= )
>>>>> >> -=C2=A0 =C2=A0 add_definitions(-D_LIBCPP_HAS_= NO_MONOTONIC_CLOCK)
>>>>> >> -=C2=A0 endif()
>>>>> >> -# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is se= t to ON.
>>>>> >> -elseif(NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)
>>>>> >> -=C2=A0 message(FATAL_ERROR "LIBCXX_ENAB= LE_MONOTONIC_CLOCK can only be
>>>>> >> set to
>>>>> >> OFF"
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " when LIBCXX_ENABLE_THREADS is als= o set to
>>>>> >> OFF.")
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -# LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS co= nfiguration
>>>>> >> -if (NOT LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTI= ONS)
>>>>> >> -=C2=A0 add_definitions(-D_LIBCPP_HAS_NO_THRE= AD_UNSAFE_C_FUNCTIONS)
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -# Configure for sanitizers. If LIBCXX_BUILT_= STANDALONE then we have
>>>>> >> to do
>>>>> >> -# the flag translation ourselves. Othewise L= LVM's CMakeList.txt
>>>>> >> will
>>>>> >> handle it.
>>>>> >> -if (LIBCXX_BUILT_STANDALONE)
>>>>> >> -=C2=A0 # NOTE: LLVM_USE_SANITIZER checks for= a UNIX like system instead
>>>>> >> of
>>>>> >> MSVC.
>>>>> >> -=C2=A0 # But we don't have LLVM_ON_UNIX = so checking for MSVC is the best
>>>>> >> we
>>>>> >> can do.
>>>>> >> -=C2=A0 if (LLVM_USE_SANITIZER AND NOT MSVC)<= br> >>>>> >> -=C2=A0 =C2=A0 append_if(LIBCXX_CXX_FLAGS
>>>>> >> LIBCXX_HAS_FNO_OMIT_FRAME_POINTER_FLAG
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 "-fno-omit-frame-pointer")
>>>>> >> -=C2=A0 =C2=A0 if (NOT uppercase_CMAKE_BUILD_= TYPE STREQUAL "DEBUG" AND
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 NOT uppercase_CM= AKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 append_if(LIBCXX_CXX_FL= AGS LIBCXX_HAS_GLINE_TABLES_ONLY_FLAG
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 "-gline-tables-only")
>>>>> >> -=C2=A0 =C2=A0 endif()
>>>>> >> -=C2=A0 =C2=A0 if (LLVM_USE_SANITIZER STREQUA= L "Address")
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 list(APPEND LIBCXX_CXX_= FLAGS "-fsanitize=3Daddress")
>>>>> >> -=C2=A0 =C2=A0 elseif (LLVM_USE_SANITIZER MAT= CHES "Memory(WithOrigins)?")
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 list(APPEND LIBCXX_CXX_= FLAGS "-fsanitize=3Dmemory")
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 if (LLVM_USE_SANITIZER = STREQUAL "MemoryWithOrigins")
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 list(APPEND LIBC= XX_CXX_FLAGS
>>>>> >> "-fsanitize-memory-track-origins")<= br> >>>>> >> -=C2=A0 =C2=A0 =C2=A0 endif()
>>>>> >> -=C2=A0 =C2=A0 elseif (LLVM_USE_SANITIZER STR= EQUAL "Undefined")
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 list(APPEND LIBCXX_CXX_= FLAGS
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "-fs= anitize=3Dundefined -fno-sanitize=3Dvptr,function
>>>>> >> -fno-sanitize-recover")
>>>>> >> -=C2=A0 =C2=A0 elseif (LLVM_USE_SANITIZER STR= EQUAL "Thread")
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 list(APPEND LIBCXX_CXX_= FLAGS "-fsanitize=3Dthread")
>>>>> >> -=C2=A0 =C2=A0 else()
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 message(WARNING "U= nsupported value of LLVM_USE_SANITIZER:
>>>>> >> ${LLVM_USE_SANITIZER}")
>>>>> >> -=C2=A0 =C2=A0 endif()
>>>>> >> -=C2=A0 elseif(MSVC)
>>>>> >> -=C2=A0 =C2=A0 message(WARNING "LLVM_USE= _SANITIZER is not supported with
>>>>> >> MSVC")
>>>>> >> -=C2=A0 endif()
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -append_if(LIBCXX_CXX_FLAGS LIBCXX_TARGET_TRI= PLE
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "-ta= rget ${LIBCXX_TARGET_TRIPLE}")
>>>>> >> -
>>>>> >> -append_if(LIBCXX_CXX_FLAGS LIBCXX_SYSROOT &q= uot;--sysroot
>>>>> >> ${LIBCXX_SYSROOT}")
>>>>> >> -append_if(LIBCXX_CXX_FLAGS LIBCXX_GCC_TOOLCH= AIN
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "-gc= c-toolchain ${LIBCXX_GCC_TOOLCHAIN}")
>>>>> >> -
>>>>> >> -if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_C= OVERAGE)
>>>>> >> -=C2=A0 message(FATAL_ERROR "LLVM_USE_SA= NITIZER cannot be used with
>>>>> >> LIBCXX_GENERATE_COVERAGE")
>>>>> >> +=C2=A0 define_if_not(MSVC -D_DEBUG)
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> -string(REPLACE ";" " " L= IBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}")
>>>>> >> -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}= ${LIBCXX_CXX_FLAGS}")
>>>>> >> +# Feature flags
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> +define_if(MSVC -D_CRT_SECURE_NO_WARNINGS)
>>>>> >> +define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTE= M_NAMESPACE
>>>>> >> -D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE)=
>>>>> >> +define_if_not(LIBCXX_ENABLE_STDIN -D_LIBCPP_= HAS_NO_STDIN)
>>>>> >> +define_if_not(LIBCXX_ENABLE_STDOUT -D_LIBCPP= _HAS_NO_STDOUT)
>>>>> >> +define_if_not(LIBCXX_ENABLE_THREADS -D_LIBCP= P_HAS_NO_THREADS)
>>>>> >> +define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK<= br> >>>>> >> -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK)
>>>>> >> +define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_= FUNCTIONS
>>>>> >> -D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS) >>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> -# Setup Source Code
>>>>> >> +# Setup Source Code And Tests
>>>>> >>
>>>>> >>
>>>>> >> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> -
>>>>> >>=C2=A0 include_directories(include)
>>>>> >>=C2=A0 add_subdirectory(include)
>>>>> >> -
>>>>> >> -# Add source code. This also contains all of= the logic for deciding
>>>>> >> linker flags
>>>>> >> -# soname, etc...
>>>>> >>=C2=A0 add_subdirectory(lib)
>>>>> >> -
>>>>> >>
>>>>> >>
>>>>> >> -#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> -# Setup Tests
>>>>> >>
>>>>> >>
>>>>> >> -#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> -
>>>>> >>=C2=A0 add_subdirectory(test)
>>>>> >>
>>>>> >> Added: libcxx/trunk/cmake/Modules/FindLLVM.cm= ake
>>>>> >> URL:
>>>>> >>
>>>>> >> http:/= /llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/FindLLVM.cmake?rev= =3D243574&view=3Dauto
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> --- libcxx/trunk/cmake/Modules/FindLLVM.cmake= (added)
>>>>> >> +++ libcxx/trunk/cmake/Modules/FindLLVM.cmake= Wed Jul 29 16:07:28
>>>>> >> 2015
>>>>> >> @@ -0,0 +1,81 @@
>>>>> >> +
>>>>> >> +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_= SOURCE_DIR)
>>>>> >> +=C2=A0 # Rely on llvm-config.
>>>>> >> +=C2=A0 set(CONFIG_OUTPUT)
>>>>> >> +=C2=A0 find_program(LLVM_CONFIG "llvm-c= onfig")
>>>>> >> +=C2=A0 if(DEFINED LLVM_PATH)
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_INCLUDE_DIR ${LLVM_IN= CLUDE_DIR} CACHE PATH "Path to
>>>>> >> llvm/include")
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_PATH ${LLVM_PATH} CAC= HE PATH "Path to LLVM source
>>>>> >> tree")
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_MAIN_SRC_DIR ${LLVM_P= ATH})
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_CMAKE_PATH "${LL= VM_PATH}/cmake/modules")
>>>>> >> +=C2=A0 elseif(LLVM_CONFIG)
>>>>> >> +=C2=A0 =C2=A0 message(STATUS "Found LLV= M_CONFIG as ${LLVM_CONFIG}")
>>>>> >> +=C2=A0 =C2=A0 set(CONFIG_COMMAND ${LLVM_CONF= IG}
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 "--includedir"= ;
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 "--prefix"
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 "--src-root")=
>>>>> >> +=C2=A0 =C2=A0 execute_process(
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 COMMAND ${CONFIG_COMMAN= D}
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 RESULT_VARIABLE HAD_ERR= OR
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 OUTPUT_VARIABLE CONFIG_= OUTPUT
>>>>> >> +=C2=A0 =C2=A0 )
>>>>> >> +=C2=A0 =C2=A0 if(NOT HAD_ERROR)
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 string(REGEX REPLACE
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 "[ \t]*[\r\= n]+[ \t]*" ";"
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 CONFIG_OUTPUT ${= CONFIG_OUTPUT})
>>>>> >> +=C2=A0 =C2=A0 else()
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 string(REPLACE ";&= quot; " " CONFIG_COMMAND_STR
>>>>> >> "${CONFIG_COMMAND}")
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 message(STATUS "${= CONFIG_COMMAND_STR}")
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 message(FATAL_ERROR &qu= ot;llvm-config failed with status
>>>>> >> ${HAD_ERROR}")
>>>>> >> +=C2=A0 =C2=A0 endif()
>>>>> >> +
>>>>> >> +=C2=A0 =C2=A0 list(GET CONFIG_OUTPUT 0 INCLU= DE_DIR)
>>>>> >> +=C2=A0 =C2=A0 list(GET CONFIG_OUTPUT 1 LLVM_= OBJ_ROOT)
>>>>> >> +=C2=A0 =C2=A0 list(GET CONFIG_OUTPUT 2 MAIN_= SRC_DIR)
>>>>> >> +
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_INCLUDE_DIR ${INCLUDE= _DIR} CACHE PATH "Path to
>>>>> >> llvm/include")
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_BINARY_DIR ${LLVM_OBJ= _ROOT} CACHE PATH "Path to LLVM
>>>>> >> build
>>>>> >> tree")
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_MAIN_SRC_DIR ${MAIN_S= RC_DIR} CACHE PATH "Path to LLVM
>>>>> >> source
>>>>> >> tree")
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_CMAKE_PATH "${LL= VM_BINARY_DIR}/share/llvm/cmake")
>>>>> >> +=C2=A0 else()
>>>>> >> +=C2=A0 =C2=A0 message(FATAL_ERROR "llvm= -config not found and
>>>>> >> LLVM_MAIN_SRC_DIR not
>>>>> >> defined. "
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Reconfigure with
>>>>> >> -DLLVM_CONFIG=3Dpath/to/llvm-config "
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "or -DLLVM_PATH=3Dpath/to/ll= vm-source-root.")
>>>>> >> +=C2=A0 endif()
>>>>> >> +
>>>>> >> +=C2=A0 if (NOT EXISTS ${LLVM_MAIN_SRC_DIR})<= br> >>>>> >> +=C2=A0 =C2=A0 message(FATAL_ERROR "Not = found: ${LLVM_MAIN_SRC_DIR}")
>>>>> >> +=C2=A0 endif()
>>>>> >> +
>>>>> >> +=C2=A0 if(NOT EXISTS ${LLVM_CMAKE_PATH})
>>>>> >> +=C2=A0 =C2=A0 message(FATAL_ERROR "Not = found: ${LLVM_CMAKE_PATH}")
>>>>> >> +=C2=A0 endif()
>>>>> >> +
>>>>> >> +=C2=A0 list(APPEND CMAKE_MODULE_PATH "$= {LLVM_CMAKE_PATH}")
>>>>> >> +=C2=A0 list(APPEND CMAKE_MODULE_PATH
>>>>> >> "${LLVM_MAIN_SRC_DIR}/cmake/modules"= ;)
>>>>> >> +
>>>>> >> +
>>>>> >> +=C2=A0 if(LLVM_LIT)
>>>>> >> +=C2=A0 =C2=A0 # Define the default arguments= to use with 'lit', and an option
>>>>> >> for
>>>>> >> the user
>>>>> >> +=C2=A0 =C2=A0 # to override.
>>>>> >> +=C2=A0 =C2=A0 set(LIT_ARGS_DEFAULT "-sv= --show-xfail --show-unsupported")
>>>>> >> +=C2=A0 =C2=A0 if (MSVC OR XCODE)
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 set(LIT_ARGS_DEFAULT &q= uot;${LIT_ARGS_DEFAULT} --no-progress-bar")
>>>>> >> +=C2=A0 =C2=A0 endif()
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_LIT_ARGS "${LIT_= ARGS_DEFAULT}" CACHE STRING "Default
>>>>> >> options
>>>>> >> for lit")
>>>>> >> +
>>>>> >> +=C2=A0 =C2=A0 # On Win32 hosts, provide an o= ption to specify the path to the
>>>>> >> GnuWin32 tools.
>>>>> >> +=C2=A0 =C2=A0 if( WIN32 AND NOT CYGWIN )
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 set(LLVM_LIT_TOOLS_DIR = "" CACHE PATH "Path to GnuWin32
>>>>> >> tools")
>>>>> >> +=C2=A0 =C2=A0 endif()
>>>>> >> +=C2=A0 else()
>>>>> >> +=C2=A0 =C2=A0 set(LLVM_INCLUDE_TESTS OFF)
>>>>> >> +=C2=A0 endif()
>>>>> >> +
>>>>> >> +=C2=A0 include(AddLLVM) # Include the LLVM C= Make functions.
>>>>> >> +=C2=A0 include(HandleLLVMOptions)
>>>>> >> +=C2=A0 set(LIBCXX_BUILT_STANDALONE 1)
>>>>> >> +else()
>>>>> >> +=C2=A0 set(LLVM_MAIN_SRC_DIR "${CMAKE_S= OURCE_DIR}" CACHE PATH "Path to
>>>>> >> LLVM
>>>>> >> source tree")
>>>>> >> +=C2=A0 set(LLVM_LIT "${CMAKE_SOURCE_DIR= }/utils/lit/lit.py")
>>>>> >> +endif()
>>>>> >>
>>>>> >> Modified: libcxx/trunk/cmake/Modules/HandleLi= bCXXABI.cmake
>>>>> >> URL:
>>>>> >>
>>>>> >> http://llvm.org/viewvc/llvm-project/libcxx/tru= nk/cmake/Modules/HandleLibCXXABI.cmake?rev=3D243574&r1=3D243573&r2= =3D243574&view=3Ddiff
>>>>> >>
>>>>> >>
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> --- libcxx/trunk/cmake/Modules/HandleLibCXXAB= I.cmake (original)
>>>>> >> +++ libcxx/trunk/cmake/Modules/HandleLibCXXAB= I.cmake Wed Jul 29
>>>>> >> 16:07:28
>>>>> >> 2015
>>>>> >> @@ -58,6 +58,21 @@ macro(setup_abi_lib abidef= ines abilib ab
>>>>> >>
>>>>> >>=C2=A0 endmacro()
>>>>> >>
>>>>> >> +# Setup the default options if LIBCXX_CXX_AB= I is not specified.
>>>>> >> +if (NOT LIBCXX_CXX_ABI)
>>>>> >> +=C2=A0 if (NOT DEFINED LIBCXX_BUILT_STANDALO= NE AND
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 IS_DIRECTORY "${CM= AKE_SOURCE_DIR}/projects/libcxxabi")
>>>>> >> +=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_LIBNAME &qu= ot;libcxxabi")
>>>>> >> +=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_INCLUDE_PAT= HS
>>>>> >> "${CMAKE_SOURCE_DIR}/projects/libcxxabi/= include")
>>>>> >> +=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_INTREE 1) >>>>> >> +=C2=A0 else ()
>>>>> >> +=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_LIBNAME &qu= ot;none")
>>>>> >> +=C2=A0 endif ()
>>>>> >> +else ()
>>>>> >> +=C2=A0 set(LIBCXX_CXX_ABI_LIBNAME "${LI= BCXX_CXX_ABI}")
>>>>> >> +endif ()
>>>>> >> +
>>>>> >> +# Configure based on the selected ABI librar= y.
>>>>> >>=C2=A0 if ("${LIBCXX_CXX_ABI_LIBNAME}&quo= t; STREQUAL "libstdc++" OR
>>>>> >>=C2=A0 =C2=A0 =C2=A0 "${LIBCXX_CXX_ABI_LI= BNAME}" STREQUAL "libsupc++")
>>>>> >>=C2=A0 =C2=A0 set(_LIBSUPCXX_INCLUDE_FILES
>>>>> >>
>>>>> >> Added: libcxx/trunk/cmake/Modules/HandleLibcx= xFlags.cmake
>>>>> >> URL:
>>>>> >>
>>>>> >> http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLib= cxxFlags.cmake?rev=3D243574&view=3Dauto
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> --- libcxx/trunk/cmake/Modules/HandleLibcxxFl= ags.cmake (added)
>>>>> >> +++ libcxx/trunk/cmake/Modules/HandleLibcxxFl= ags.cmake Wed Jul 29
>>>>> >> 16:07:28
>>>>> >> 2015
>>>>> >> @@ -0,0 +1,147 @@
>>>>> >> +# HandleLibcxxFlags - A set of macros used t= o setup the flags used
>>>>> >> to
>>>>> >> compile
>>>>> >> +# and link libc++. These macros add flags to= the following CMake
>>>>> >> variables.
>>>>> >> +# - LIBCXX_COMPILE_FLAGS: flags used to comp= ile libc++
>>>>> >> +# - LIBCXX_LINK_FLAGS: flags used to link li= bc++
>>>>> >> +# - LIBCXX_LIBRARIES: libraries to link libc= ++ to.
>>>>> >> +
>>>>> >> +include(CheckCXXCompilerFlag)
>>>>> >> +
>>>>> >> +unset(add_flag_if_supported)
>>>>> >> +
>>>>> >> +# Mangle the name of a compiler flag into a = valid CMake identifier.
>>>>> >> +# Ex: --std=3Dc++11 -> STD_EQ_CXX11
>>>>> >> +macro(mangle_name str output)
>>>>> >> +=C2=A0 string(STRIP "${str}" strip= pedStr)
>>>>> >> +=C2=A0 string(REGEX REPLACE "^/" &= quot;" strippedStr "${strippedStr}")
>>>>> >> +=C2=A0 string(REGEX REPLACE "^-+" = "" strippedStr "${strippedStr}")
>>>>> >> +=C2=A0 string(REGEX REPLACE "-+$" = "" strippedStr "${strippedStr}")
>>>>> >> +=C2=A0 string(REPLACE "-" "_&= quot; strippedStr "${strippedStr}")
>>>>> >> +=C2=A0 string(REPLACE "=3D" "= _EQ_" strippedStr "${strippedStr}")
>>>>> >> +=C2=A0 string(REPLACE "+" "X&= quot; strippedStr "${strippedStr}")
>>>>> >> +=C2=A0 string(TOUPPER "${strippedStr}&q= uot; ${output})
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# Remove a list of flags from all CMake vari= ables that affect
>>>>> >> compile
>>>>> >> flags.
>>>>> >> +# This can be used to remove unwanted flags = specified on the
>>>>> >> command line
>>>>> >> +# or added in other parts of LLVM's cmak= e configuration.
>>>>> >> +macro(remove_flags)
>>>>> >> +=C2=A0 foreach(var ${ARGN})
>>>>> >> +=C2=A0 =C2=A0 string(REPLACE "${var}&qu= ot; "" CMAKE_CXX_FLAGS
>>>>> >> "${CMAKE_CXX_FLAGS}")
>>>>> >> +=C2=A0 =C2=A0 string(REPLACE "${var}&qu= ot; "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
>>>>> >> +=C2=A0 =C2=A0 string(REPLACE "${var}&qu= ot; "" CMAKE_EXE_LINKER_FLAGS
>>>>> >> "${CMAKE_EXE_LINKER_FLAGS}")
>>>>> >> +=C2=A0 =C2=A0 string(REPLACE "${var}&qu= ot; "" CMAKE_SHARED_LINKER_FLAGS
>>>>> >> "${CMAKE_SHARED_LINKER_FLAGS}")
>>>>> >> +=C2=A0 =C2=A0 string(REPLACE "${var}&qu= ot; "" CMAKE_SHARED_MODULE_FLAGS
>>>>> >> "${CMAKE_SHARED_MODULE_FLAGS}")
>>>>> >> +=C2=A0 =C2=A0 remove_definitions(${var})
>>>>> >> +=C2=A0 endforeach()
>>>>> >> +endmacro(remove_flags)
>>>>> >> +
>>>>> >> +# Add a macro definition if condition is tru= e.
>>>>> >> +macro(define_if condition def)
>>>>> >> +=C2=A0 if (${condition})
>>>>> >> +=C2=A0 =C2=A0 add_definitions(${def})
>>>>> >> +=C2=A0 endif()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# Add a macro definition if condition is not= true.
>>>>> >> +macro(define_if_not condition def)
>>>>> >> +=C2=A0 if (NOT ${condition})
>>>>> >> +=C2=A0 =C2=A0 add_definitions(${def})
>>>>> >> +=C2=A0 endif()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# Add a specified list of flags to both '= ;LIBCXX_COMPILE_FLAGS' and
>>>>> >> +# 'LIBCXX_LINK_FLAGS'.
>>>>> >> +macro(add_flags)
>>>>> >> +=C2=A0 foreach(value ${ARGN})
>>>>> >> +=C2=A0 =C2=A0 list(APPEND LIBCXX_COMPILE_FLA= GS ${value})
>>>>> >> +=C2=A0 =C2=A0 list(APPEND LIBCXX_LINK_FLAGS = ${value})
>>>>> >> +=C2=A0 endforeach()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# If the specified 'condition' is tr= ue then add a list of flags to
>>>>> >> both
>>>>> >> +# 'LIBCXX_COMPILE_FLAGS' and 'LI= BCXX_LINK_FLAGS'.
>>>>> >> +macro(add_flags_if condition)
>>>>> >> +=C2=A0 if (${condition})
>>>>> >> +=C2=A0 =C2=A0 add_flags(${ARGN})
>>>>> >> +=C2=A0 endif()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# Add each flag in the list to LIBCXX_COMPIL= E_FLAGS and
>>>>> >> LIBCXX_LINK_FLAGS
>>>>> >> +# if that flag is supported by the current c= ompiler.
>>>>> >> +macro(add_flags_if_supported)
>>>>> >> +=C2=A0 foreach(flag ${ARGN})
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 mangle_name("${fla= g}" flagname)
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 check_cxx_compiler_flag= ("${flag}"
>>>>> >> "LIBCXX_SUPPORTS_${flagname}_FLAG")=
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 add_flags_if(LIBCXX_SUP= PORTS_${flagname}_FLAG ${flag})
>>>>> >> +=C2=A0 endforeach()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# Add a list of flags to 'LIBCXX_COMPILE= _FLAGS'.
>>>>> >> +macro(add_compile_flags)
>>>>> >> +=C2=A0 foreach(f ${ARGN})
>>>>> >> +=C2=A0 =C2=A0 list(APPEND LIBCXX_COMPILE_FLA= GS ${f})
>>>>> >> +=C2=A0 endforeach()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# If 'condition' is true then add th= e specified list of flags to
>>>>> >> +# 'LIBCXX_COMPILE_FLAGS'
>>>>> >> +macro(add_compile_flags_if condition)
>>>>> >> +=C2=A0 if (${condition})
>>>>> >> +=C2=A0 =C2=A0 add_compile_flags(${ARGN})
>>>>> >> +=C2=A0 endif()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# For each specified flag, add that flag to = 'LIBCXX_COMPILE_FLAGS'
>>>>> >> if the
>>>>> >> +# flag is supported by the C++ compiler.
>>>>> >> +macro(add_compile_flags_if_supported)
>>>>> >> +=C2=A0 foreach(flag ${ARGN})
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 mangle_name("${fla= g}" flagname)
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 check_cxx_compiler_flag= ("-Werror ${flag}"
>>>>> >> "LIBCXX_SUPPORTS_${flagname}_FLAG")=
>>>>> >> +=C2=A0 =C2=A0 =C2=A0 add_compile_flags_if(LI= BCXX_SUPPORTS_${flagname}_FLAG
>>>>> >> ${flag})
>>>>> >> +=C2=A0 endforeach()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# Add a list of flags to 'LIBCXX_LINK_FL= AGS'.
>>>>> >> +macro(add_link_flags)
>>>>> >> +=C2=A0 foreach(f ${ARGN})
>>>>> >> +=C2=A0 =C2=A0 list(APPEND LIBCXX_LINK_FLAGS = ${f})
>>>>> >> +=C2=A0 endforeach()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# If 'condition' is true then add th= e specified list of flags to
>>>>> >> +# 'LIBCXX_LINK_FLAGS'
>>>>> >> +macro(add_link_flags_if condition)
>>>>> >> +=C2=A0 if (${condition})
>>>>> >> +=C2=A0 =C2=A0 add_link_flags(${ARGN})
>>>>> >> +=C2=A0 endif()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# For each specified flag, add that flag to = 'LIBCXX_LINK_FLAGS' if
>>>>> >> the
>>>>> >> +# flag is supported by the C++ compiler.
>>>>> >> +macro(add_link_flags_if_supported)
>>>>> >> +=C2=A0 foreach(flag ${ARGN})
>>>>> >> +=C2=A0 =C2=A0 mangle_name("${flag}"= ; flagname)
>>>>> >> +=C2=A0 =C2=A0 check_cxx_compiler_flag("= ${flag}"
>>>>> >> "LIBCXX_SUPPORTS_${flagname}_FLAG")=
>>>>> >> +=C2=A0 =C2=A0 add_link_flags_if(LIBCXX_SUPPO= RTS_${flagname}_FLAG ${flag})
>>>>> >> +=C2=A0 endforeach()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# Add a list of libraries or link flags to &= #39;LIBCXX_LIBRARIES'.
>>>>> >> +macro(add_library_flags)
>>>>> >> +=C2=A0 foreach(lib ${ARGN})
>>>>> >> +=C2=A0 =C2=A0 list(APPEND LIBCXX_LIBRARIES $= {lib})
>>>>> >> +=C2=A0 endforeach()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# if 'condition' is true then add th= e specified list of libraries
>>>>> >> and
>>>>> >> flags
>>>>> >> +# to 'LIBCXX_LIBRARIES'.
>>>>> >> +macro(add_library_flags_if condition)
>>>>> >> +=C2=A0 if(${condition})
>>>>> >> +=C2=A0 =C2=A0 add_library_flags(${ARGN})
>>>>> >> +=C2=A0 endif()
>>>>> >> +endmacro()
>>>>> >> +
>>>>> >> +# Turn a comma separated CMake list into a s= pace separated string.
>>>>> >> +macro(split_list listname)
>>>>> >> +=C2=A0 string(REPLACE ";" " &= quot; ${listname} "${${listname}}")
>>>>> >> +endmacro()
>>>>> >>
>>>>> >> Modified: libcxx/trunk/cmake/config-ix.cmake<= br> >>>>> >> URL:
>>>>> >>
>>>>> >> http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/con= fig-ix.cmake?rev=3D243574&r1=3D243573&r2=3D243574&view=3Ddiff
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> --- libcxx/trunk/cmake/config-ix.cmake (origi= nal)
>>>>> >> +++ libcxx/trunk/cmake/config-ix.cmake Wed Ju= l 29 16:07:28 2015
>>>>> >> @@ -2,23 +2,7 @@ include(CheckLibraryExists)<= br> >>>>> >>=C2=A0 include(CheckCXXCompilerFlag)
>>>>> >>
>>>>> >>=C2=A0 # Check compiler flags
>>>>> >> -check_cxx_compiler_flag(-std=3Dc++11
>>>>> >> LIBCXX_HAS_STDCXX11_FLAG)
>>>>> >> -check_cxx_compiler_flag(-std=3Dc++1y
>>>>> >> LIBCXX_HAS_STDCXX1Y_FLAG)
>>>>> >> -check_cxx_compiler_flag(-fPIC
>>>>> >> LIBCXX_HAS_FPIC_FLAG)
>>>>> >> -check_cxx_compiler_flag(-fno-omit-frame-poin= ter
>>>>> >> LIBCXX_HAS_FNO_OMIT_FRAME_POINTER_FLAG)
>>>>> >> -check_cxx_compiler_flag(-nodefaultlibs
>>>>> >> LIBCXX_HAS_NODEFAULTLIBS_FLAG)
>>>>> >> -check_cxx_compiler_flag(-nostdinc++
>>>>> >> LIBCXX_HAS_NOSTDINCXX_FLAG)
>>>>> >> -check_cxx_compiler_flag(-Wall
>>>>> >> LIBCXX_HAS_WALL_FLAG)
>>>>> >> -check_cxx_compiler_flag(-W=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 LIBCXX_HAS_W_FL= AG)
>>>>> >> -check_cxx_compiler_flag(-Wno-unused-paramete= r
>>>>> >> LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG)
>>>>> >> -check_cxx_compiler_flag(-Wwrite-strings
>>>>> >> LIBCXX_HAS_WWRITE_STRINGS_FLAG)
>>>>> >> -check_cxx_compiler_flag(-Wno-long-long
>>>>> >> LIBCXX_HAS_WNO_LONG_LONG_FLAG)
>>>>> >> -check_cxx_compiler_flag(-pedantic
>>>>> >> LIBCXX_HAS_PEDANTIC_FLAG)
>>>>> >> -check_cxx_compiler_flag(-Werror
>>>>> >> LIBCXX_HAS_WERROR_FLAG)
>>>>> >> -check_cxx_compiler_flag(-Wno-error
>>>>> >> LIBCXX_HAS_WNO_ERROR_FLAG)
>>>>> >> -check_cxx_compiler_flag(-fno-exceptions
>>>>> >> LIBCXX_HAS_FNO_EXCEPTIONS_FLAG)
>>>>> >> -check_cxx_compiler_flag(-fno-rtti
>>>>> >> LIBCXX_HAS_FNO_RTTI_FLAG)
>>>>> >> -check_cxx_compiler_flag(-gline-tables-only >>>>> >> LIBCXX_HAS_GLINE_TABLES_ONLY_FLAG)
>>>>> >> +
>>>>> >>=C2=A0 check_cxx_compiler_flag(/WX=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0LIBCXX_HA= S_WX_FLAG)
>>>>> >>=C2=A0 check_cxx_compiler_flag(/WX-
>>>>> >> LIBCXX_HAS_NO_WX_FLAG)
>>>>> >>=C2=A0 check_cxx_compiler_flag(/EHsc
>>>>> >> LIBCXX_HAS_EHSC_FLAG)
>>>>> >> @@ -26,6 +10,7 @@ check_cxx_compiler_flag(/EH= s-
>>>>> >>=C2=A0 check_cxx_compiler_flag(/EHa-
>>>>> >> LIBCXX_HAS_NO_EHA_FLAG)
>>>>> >>=C2=A0 check_cxx_compiler_flag(/GR-
>>>>> >> LIBCXX_HAS_NO_GR_FLAG)
>>>>> >>
>>>>> >> +
>>>>> >>=C2=A0 # Check libraries
>>>>> >>=C2=A0 check_library_exists(pthread pthread_cr= eate ""
>>>>> >> LIBCXX_HAS_PTHREAD_LIB)
>>>>> >>=C2=A0 check_library_exists(c printf "&qu= ot; LIBCXX_HAS_C_LIB)
>>>>> >>
>>>>> >> Modified: libcxx/trunk/lib/CMakeLists.txt
>>>>> >> URL:
>>>>> >>
>>>>> >> http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists= .txt?rev=3D243574&r1=3D243573&r2=3D243574&view=3Ddiff
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> --- libcxx/trunk/lib/CMakeLists.txt (original= )
>>>>> >> +++ libcxx/trunk/lib/CMakeLists.txt Wed Jul 2= 9 16:07:28 2015
>>>>> >> @@ -25,48 +25,23 @@ if (MSVC_IDE OR XCODE)
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >>=C2=A0 if (LIBCXX_ENABLE_SHARED)
>>>>> >> -=C2=A0 add_library(cxx SHARED
>>>>> >> -=C2=A0 =C2=A0 ${LIBCXX_SOURCES}
>>>>> >> -=C2=A0 =C2=A0 ${LIBCXX_HEADERS}
>>>>> >> -=C2=A0 =C2=A0 )
>>>>> >> +=C2=A0 add_library(cxx SHARED ${LIBCXX_SOURC= ES} ${LIBCXX_HEADERS})
>>>>> >>=C2=A0 else()
>>>>> >> -=C2=A0 add_library(cxx STATIC
>>>>> >> -=C2=A0 =C2=A0 ${LIBCXX_SOURCES}
>>>>> >> -=C2=A0 =C2=A0 ${LIBCXX_HEADERS}
>>>>> >> -=C2=A0 =C2=A0 )
>>>>> >> -endif()
>>>>> >> -
>>>>> >> -#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined w= e want to add it to the
>>>>> >> search path.
>>>>> >> -if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH)
>>>>> >> -=C2=A0 target_link_libraries(cxx "-L${L= IBCXX_CXX_ABI_LIBRARY_PATH}")
>>>>> >> +=C2=A0 add_library(cxx STATIC ${LIBCXX_SOURC= ES} ${LIBCXX_HEADERS})
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >>=C2=A0 if (DEFINED LIBCXX_CXX_ABI_DEPS)
>>>>> >>=C2=A0 =C2=A0 add_dependencies(cxx LIBCXX_CXX_= ABI_DEPS)
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> -set(libraries "")
>>>>> >> -if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
>>>>> >> -=C2=A0 =C2=A0 # TODO(ericwf): Remove these G= NU specific linker flags and let
>>>>> >> CMake
>>>>> >> do the
>>>>> >> -=C2=A0 =C2=A0 # configuration. This will be = more portable.
>>>>> >> -=C2=A0 =C2=A0 list(APPEND libraries "-W= l,--whole-archive" "-Wl,-Bstatic")
>>>>> >> -=C2=A0 =C2=A0 list(APPEND libraries "${= LIBCXX_CXX_ABI_LIBRARY}")
>>>>> >> -=C2=A0 =C2=A0 list(APPEND libraries "-W= l,-Bdynamic" "-Wl,--no-whole-archive")
>>>>> >> -else()
>>>>> >> -=C2=A0 =C2=A0 list(APPEND libraries "${= LIBCXX_CXX_ABI_LIBRARY}")
>>>>> >> -endif()
>>>>> >> +#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined w= e want to add it to the
>>>>> >> search path.
>>>>> >> +add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PAT= H
>>>>> >> "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")=
>>>>> >>
>>>>> >> -# Generate library list.
>>>>> >> -append_if(libraries LIBCXX_HAS_PTHREAD_LIB p= thread)
>>>>> >> -append_if(libraries LIBCXX_HAS_C_LIB c)
>>>>> >> -append_if(libraries LIBCXX_HAS_M_LIB m)
>>>>> >> -append_if(libraries LIBCXX_HAS_RT_LIB rt)
>>>>> >> -append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc= _s)
>>>>> >> +add_library_flags_if(LIBCXX_COVERAGE_LIBRARY=
>>>>> >> "${LIBCXX_COVERAGE_LIBRARY}")
>>>>> >>
>>>>> >> -if (LIBCXX_COVERAGE_LIBRARY)
>>>>> >> -=C2=A0 target_link_libraries(cxx ${LIBCXX_CO= VERAGE_LIBRARY})
>>>>> >> -endif()
>>>>> >> -target_link_libraries(cxx ${libraries})
>>>>> >> +add_library_flags_if(LIBCXX_ENABLE_STATIC_AB= I_LIBRARY
>>>>> >> "-Wl,--whole-archive" "-Wl,-Bs= tatic")
>>>>> >> +add_library_flags("${LIBCXX_CXX_ABI_LIB= RARY}")
>>>>> >> +add_library_flags_if(LIBCXX_ENABLE_STATIC_AB= I_LIBRARY
>>>>> >> "-Wl,-Bdynamic"
>>>>> >> "-Wl,--no-whole-archive")
>>>>> >>
>>>>> >>=C2=A0 if (APPLE AND LLVM_USE_SANITIZER)
>>>>> >>=C2=A0 =C2=A0 if ("${LLVM_USE_SANITIZER}&= quot; STREQUAL "Address")
>>>>> >> @@ -89,15 +64,21 @@ if (APPLE AND LLVM_USE_SA= NITIZER)
>>>>> >>=C2=A0 =C2=A0 =C2=A0 set(LIBCXX_SANITIZER_LIBR= ARY "${LIBDIR}/${LIBFILE}")
>>>>> >>=C2=A0 =C2=A0 =C2=A0 set(LIBCXX_SANITIZER_LIBR= ARY "${LIBCXX_SANITIZER_LIBRARY}"
>>>>> >> PARENT_SCOPE)
>>>>> >>=C2=A0 =C2=A0 =C2=A0 message(STATUS "Manu= ally linking compiler-rt library:
>>>>> >> ${LIBCXX_SANITIZER_LIBRARY}")
>>>>> >> -=C2=A0 =C2=A0 target_link_libraries(cxx &quo= t;${LIBCXX_SANITIZER_LIBRARY}")
>>>>> >> -=C2=A0 =C2=A0 target_link_libraries(cxx &quo= t;-Wl,-rpath,${LIBDIR}")
>>>>> >> +=C2=A0 =C2=A0 add_library_flags("${LIBC= XX_SANITIZER_LIBRARY}")
>>>>> >> +=C2=A0 =C2=A0 add_link_flags("-Wl,-rpat= h,${LIBDIR}")
>>>>> >>=C2=A0 =C2=A0 endif()
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> +# Generate library list.
>>>>> >> +add_library_flags_if(LIBCXX_HAS_PTHREAD_LIB = pthread)
>>>>> >> +add_library_flags_if(LIBCXX_HAS_C_LIB c)
>>>>> >> +add_library_flags_if(LIBCXX_HAS_M_LIB m)
>>>>> >> +add_library_flags_if(LIBCXX_HAS_RT_LIB rt) >>>>> >> +add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gc= c_s)
>>>>> >>
>>>>> >>=C2=A0 # Setup flags.
>>>>> >> -append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_FP= IC_FLAG -fPIC)
>>>>> >> -append_if(LIBCXX_LINK_FLAGS LIBCXX_HAS_NODEF= AULTLIBS_FLAG
>>>>> >> -nodefaultlibs)
>>>>> >> +add_flags_if_supported(-fPIC)
>>>>> >> +add_link_flags_if_supported(-nodefaultlibs)<= br> >>>>> >>
>>>>> >>=C2=A0 if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME = STREQUAL "libcxxabi" OR
>>>>> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
>>>>> >> @@ -106,8 +87,8 @@ if ( APPLE AND (LIBCXX_CXX= _ABI_LIBNAME S
>>>>> >>=C2=A0 =C2=A0 endif()
>>>>> >>
>>>>> >>=C2=A0 =C2=A0 if ( CMAKE_OSX_DEPLOYMENT_TARGET= STREQUAL "10.6" )
>>>>> >> -=C2=A0 =C2=A0 list(APPEND LIBCXX_COMPILE_FLA= GS "-U__STRICT_ANSI__")
>>>>> >> -=C2=A0 =C2=A0 list(APPEND LIBCXX_LINK_FLAGS<= br> >>>>> >> +=C2=A0 =C2=A0 add_definitions(-D__STRICT_ANS= I__)
>>>>> >> +=C2=A0 =C2=A0 add_link_flags(
>>>>> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 "-compatibili= ty_version 1"
>>>>> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 "-current_ver= sion 1"
>>>>> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 "-install_nam= e /usr/lib/libc++.1.dylib"
>>>>> >> @@ -129,7 +110,7 @@ if ( APPLE AND (LIBCXX_CX= X_ABI_LIBNAME S
>>>>> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 set (OSX_RE_EXPORT= _LINE "/usr/lib/libc++abi.dylib
>>>>> >>
>>>>> >> -Wl,-reexported_symbols_list,${CMAKE_CURRENT_= SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
>>>>> >>=C2=A0 =C2=A0 =C2=A0 endif()
>>>>> >>
>>>>> >> -=C2=A0 =C2=A0 list(APPEND LIBCXX_LINK_FLAGS<= br> >>>>> >> +=C2=A0 =C2=A0 add_link_flags(
>>>>> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 "-compatibili= ty_version 1"
>>>>> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 "-install_nam= e /usr/lib/libc++.1.dylib"
>>>>> >>
>>>>> >>
>>>>> >> "-Wl,-unexported_symbols_list,${CMAKE_CU= RRENT_SOURCE_DIR}/libc++unexp.exp"
>>>>> >> @@ -139,8 +120,9 @@ if ( APPLE AND (LIBCXX_CX= X_ABI_LIBNAME S
>>>>> >>=C2=A0 =C2=A0 endif()
>>>>> >>=C2=A0 endif()
>>>>> >>
>>>>> >> -string(REPLACE ";" " " L= IBCXX_COMPILE_FLAGS
>>>>> >> "${LIBCXX_COMPILE_FLAGS}")
>>>>> >> -string(REPLACE ";" " " L= IBCXX_LINK_FLAGS "${LIBCXX_LINK_FLAGS}")
>>>>> >> +target_link_libraries(cxx ${LIBCXX_LIBRARIES= })
>>>>> >> +split_list(LIBCXX_COMPILE_FLAGS)
>>>>> >> +split_list(LIBCXX_LINK_FLAGS)
>>>>> >>
>>>>> >>=C2=A0 set_target_properties(cxx
>>>>> >>=C2=A0 =C2=A0 PROPERTIES
>>>>> >>
>>>>> >> Modified: libcxx/trunk/test/CMakeLists.txt
>>>>> >> URL:
>>>>> >>
>>>>> >> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeL= ists.txt?rev=3D243574&r1=3D243573&r2=3D243574&view=3Ddiff >>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> >> --- libcxx/trunk/test/CMakeLists.txt (origina= l)
>>>>> >> +++ libcxx/trunk/test/CMakeLists.txt Wed Jul = 29 16:07:28 2015
>>>>> >> @@ -6,84 +6,47 @@ macro(pythonize_bool var) >>>>> >>=C2=A0 =C2=A0 endif()
>>>>> >>=C2=A0 endmacro()
>>>>> >>
>>>>> >> -set(LIT_EXECUTABLE "" CACHE FILEPA= TH "Path to LLVM's llvm-lit.")
>>>>> >> +set(LIBCXX_LIT_VARIANT "libcxx" CA= CHE STRING
>>>>> >> +=C2=A0 =C2=A0 "Configuration variant to= use for LIT.")
>>>>> >>
>>>>> >> -if(LIBCXX_BUILT_STANDALONE)
>>>>> >> -=C2=A0 # Make sure we can use the console po= ol for recent cmake and
>>>>> >> ninja >
>>>>> >> 1.5
>>>>> >> -=C2=A0 if(CMAKE_VERSION VERSION_LESS 3.1.201= 41117)
>>>>> >> -=C2=A0 =C2=A0 set(cmake_3_2_USES_TERMINAL) >>>>> >> -=C2=A0 else()
>>>>> >> -=C2=A0 =C2=A0 set(cmake_3_2_USES_TERMINAL US= ES_TERMINAL)
>>>>> >> -=C2=A0 endif()
>>>>> >> -else()
>>>>> >> -=C2=A0 include(FindPythonInterp)
>>>>> >> -=C2=A0 if(PYTHONINTERP_FOUND)
>>>>> >> -=C2=A0 =C2=A0 set(LIT_EXECUTABLE
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 ${PYTHON_EXECUTA= BLE} ${CMAKE_SOURCE_DIR}/utils/lit/lit.py)
>>>>> >> -=C2=A0 else()
>>>>> >> -=C2=A0 =C2=A0 message(WARNING "Could no= t find Python, cannot set
>>>>> >> LIT_EXECUTABLE.")
>>>>> >> -=C2=A0 endif()
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_RTTI)
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_SHARED)
>>>>> >> +pythonize_bool(LIBCXX_BUILD_32_BITS)
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_GLOBAL_FILESYST= EM_NAMESPACE)
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_STDIN)
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_STDOUT)
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_THREADS)
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_THREAD_UNSAFE_C= _FUNCTIONS)
>>>>> >> +pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK= )
>>>>> >> +pythonize_bool(LIBCXX_GENERATE_COVERAGE)
>>>>> >> +pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)<= br> >>>>> >> +
>>>>> >> +# The tests shouldn't link to any ABI li= brary when it has been
>>>>> >> linked
>>>>> >> into
>>>>> >> +# libc++ statically.
>>>>> >> +if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
>>>>> >> +=C2=A0 set(LIBCXX_CXX_ABI_LIBNAME "none= ")
>>>>> >>=C2=A0 endif()
>>>>> >> -
>>>>> >> -if (LIT_EXECUTABLE)
>>>>> >> -=C2=A0 set(LIT_ARGS_DEFAULT "-sv --show= -unsupported --show-xfail")
>>>>> >> -=C2=A0 if (MSVC OR XCODE)
>>>>> >> -=C2=A0 =C2=A0 set(LIT_ARGS_DEFAULT "${L= IT_ARGS_DEFAULT} --no-progress-bar")
>>>>> >> -=C2=A0 endif()
>>>>> >> -=C2=A0 set(LLVM_LIT_ARGS "${LIT_ARGS_DE= FAULT}"
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 CACHE STRING "Defa= ult options for lit")
>>>>> >> -=C2=A0 set(LIT_ARGS "${LLVM_LIT_ARGS}&q= uot;)
>>>>> >> -=C2=A0 separate_arguments(LIT_ARGS)
>>>>> >> -
>>>>> >> -=C2=A0 set(LIBCXX_LIT_VARIANT "libcxx&q= uot; CACHE STRING
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 "Configuration var= iant to use for LIT.")
>>>>> >> -
>>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_EXCEPTIO= NS)
>>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_RTTI)
>>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_SHARED)<= br> >>>>> >> -=C2=A0 pythonize_bool(LIBCXX_BUILD_32_BITS)<= br> >>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_GLOBAL_F= ILESYSTEM_NAMESPACE)
>>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_STDIN) >>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_STDOUT)<= br> >>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_THREADS)=
>>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_THREAD_U= NSAFE_C_FUNCTIONS)
>>>>> >> -=C2=A0 pythonize_bool(LIBCXX_ENABLE_MONOTONI= C_CLOCK)
>>>>> >> -=C2=A0 pythonize_bool(LIBCXX_GENERATE_COVERA= GE)
>>>>> >> -=C2=A0 pythonize_bool(LIBCXXABI_USE_LLVM_UNW= INDER)
>>>>> >> -
>>>>> >> -=C2=A0 # The tests shouldn't link to any= ABI library when it has been
>>>>> >> linked
>>>>> >> into
>>>>> >> -=C2=A0 # libc++ statically.
>>>>> >> -=C2=A0 if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)=
>>>>> >> -=C2=A0 =C2=A0 set(LIBCXX_CXX_ABI_LIBNAME &qu= ot;none")
>>>>> >> -=C2=A0 endif()
>>>>> >> -=C2=A0 set(LIBCXX_TARGET_INFO "libcxx.t= est.target_info.LocalTI" CACHE
>>>>> >> STRING
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 "TargetInfo to use= when setting up test environment.")
>>>>> >> -=C2=A0 set(LIBCXX_EXECUTOR "None" = CACHE STRING
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 "Executor to use w= hen running tests.")
>>>>> >> -
>>>>> >> -=C2=A0 set(AUTO_GEN_COMMENT "## Autogen= erated by libcxx
>>>>> >> configuration.\n# Do
>>>>> >> not edit!")
>>>>> >> -
>>>>> >> -=C2=A0 configure_file(
>>>>> >> -=C2=A0 =C2=A0 ${CMAKE_CURRENT_SO= URCE_DIR}/lit.site.cfg.in
>>>>>
>>>>> >>
>>>>> >> -=C2=A0 =C2=A0 ${CMAKE_CURRENT_BINARY_DIR}/li= t.site.cfg
>>>>> >> -=C2=A0 =C2=A0 @ONLY)
>>>>> >> -
>>>>> >> -=C2=A0 add_custom_target(check-libcxx
>>>>> >> -=C2=A0 =C2=A0 COMMAND ${LIT_EXECUTABLE}
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${= LIT_ARGS}
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${= CMAKE_CURRENT_BINARY_DIR}
>>>>> >> -=C2=A0 =C2=A0 DEPENDS cxx
>>>>> >> -=C2=A0 =C2=A0 COMMENT "Running libcxx t= ests"
>>>>> >> -=C2=A0 =C2=A0 ${cmake_3_2_USES_TERMINAL})
>>>>> >> -
>>>>> >> -=C2=A0 if (LIBCXX_GENERATE_COVERAGE)
>>>>> >> -=C2=A0 =C2=A0 include(CodeCoverage)
>>>>> >> -=C2=A0 =C2=A0 set(output_dir "${CMAKE_C= URRENT_BINARY_DIR}/coverage")
>>>>> >> -=C2=A0 =C2=A0 set(capture_dirs
>>>>> >> "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;$= {CMAKE_CURRENT_BINARY_DIR}")
>>>>> >> -=C2=A0 =C2=A0 set(extract_dirs
>>>>> >> "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_S= OURCE_DIR}/src")
>>>>> >> -=C2=A0 =C2=A0 setup_lcov_test_target_coverag= e("cxx" "${output_dir}"
>>>>> >> "${capture_dirs}" "${extract_d= irs}")
>>>>> >> -=C2=A0 endif()
>>>>> >> -else()
>>>>> >> -=C2=A0 message(WARNING
>>>>> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "LIT= _EXECUTABLE not set, no check-libcxx target will be
>>>>> >> available!")
>>>>> >> +set(LIBCXX_TARGET_INFO "libcxx.test.tar= get_info.LocalTI" CACHE
>>>>> >> STRING
>>>>> >> +=C2=A0 =C2=A0 "TargetInfo to use when s= etting up test environment.")
>>>>> >> +set(LIBCXX_EXECUTOR "None" CACHE S= TRING
>>>>> >> +=C2=A0 =C2=A0 "Executor to use when run= ning tests.")
>>>>> >> +
>>>>> >> +set(AUTO_GEN_COMMENT "## Autogenerated = by libcxx configuration.\n#
>>>>> >> Do not
>>>>> >> edit!")
>>>>> >> +
>>>>> >> +configure_file(
>>>>> >> +=C2=A0 ${CMAKE_CURRENT_SOURCE_DI= R}/lit.site.cfg.in
>>>>> >> +=C2=A0 ${CMAKE_CURRENT_BINARY_DIR}/lit= .site.cfg
>>>>> >> +=C2=A0 @ONLY)
>>>>> >> +
>>>>> >> +add_lit_testsuite(check-libcxx "Running= libcxx tests"
>>>>> >> +=C2=A0 ${CMAKE_CURRENT_BINARY_DIR}
>>>>> >> +=C2=A0 DEPENDS cxx)
>>>>> >> +
>>>>> >> +if (LIBCXX_GENERATE_COVERAGE)
>>>>> >> +=C2=A0 include(CodeCoverage)
>>>>> >> +=C2=A0 set(output_dir "${CMAKE_CURRENT_= BINARY_DIR}/coverage")
>>>>> >> +=C2=A0 set(capture_dirs
>>>>> >> "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;$= {CMAKE_CURRENT_BINARY_DIR}")
>>>>> >> +=C2=A0 set(extract_dirs
>>>>> >> "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_S= OURCE_DIR}/src")
>>>>> >> +=C2=A0 setup_lcov_test_target_coverage("= ;cxx" "${output_dir
<= /div>
...
--089e011839b2cad745051c0c289c-- --===============1211934854419900738== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits --===============1211934854419900738==--