LLVM_USE_SANITIZER=Undefined support was added to the LLVM CMake configuration.
Update libc++'s handling of LLVM_USE_SANITIZER to support this as well.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@219987 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
I changed the build so that each ABI header gets its own install rule. This gives us the flexibility to install different headers in different directories.
This also fixes the problem where libstdc++ bits/<header>'s were not being installed under a bits directory.
Test Plan: I tested this patch on linux against libstdc++ and libcxxabi.
Reviewers: danalbert, mclow.lists, jroelofs
Reviewed By: jroelofs
Subscribers: jhunold, cfe-commits
Differential Revision: http://reviews.llvm.org/D5454
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@218309 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch adds support for LLVM_USE_SANITIZER when being built in-tree and standalone.
This patch does the following things:
1. define the LLVM_USE_SANITIZER option to "" when being built standalone. This also helps show we support it.
2. Translate LLVM_USE_SANITIZER when standalone in a very similar way done in llvm/cmake/HandleLLVMOptions.cmake.
3. Add config.llvm_use_sanitizer to lit.site.cfg.in
4. Add code to translate config.llvm_use_sanitizer's value into the needed compile flags in lit.cfg.
Currently lit.cfg assumes that that the compiler supports '-fno-omit-frame-pointer' while CMakeLists.txt actually checks to see if its supported. We could pass this information to lit but I'm not sure its needed.
Reviewers: mclow.lists, danalbert
Reviewed By: danalbert
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4949
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215872 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch does two things:
CMake Update:
- Add compiler flag checks for -std=c++11 and -std=c++1y and remove check for -std=c++0x.
- Add configuration option LIBCXX_ENABLE_CXX1Y to prevent/allow -std=c++1y from being chosen as the std version. LIBCXX_ENABLE_CXX1Y is set to OFF by default.
- if LIBCXX_ENABLE_CXX1Y is enabled then set LIBCXX_STD_VERSION to c++1y and fail if the compiler does not support -std=c++1y
- If c++1y is not enabled then use c++11 and fail if the compiler does not support c++11.
Lit Update:
- Update lit.site.cfg.in to capture LIBCXX_STD_VERSION information as config.std.
- Remove mentions of has_cxx0X configuration option.
- Check for `--param std=X' passed to lit on the command line.
- Choose the std for the tests either from command line parameter or (if it doesn't exist) the lit.site.cfg.
Reviewers: mclow.lists, danalbert
Reviewed By: danalbert
Subscribers: emaste, rnk, ajwong, danalbert, cfe-commits
Differential Revision: http://reviews.llvm.org/D4329
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215802 91177308-0d34-0410-b5e6-96231b3b80d8
Pass target name ("cxxabi") to target_link_libraries(cxx ...) to ensure
that linker is able to locate just-built libc++abi in the build tree,
instead of relying on "-lc++abi" linker flag.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214114 91177308-0d34-0410-b5e6-96231b3b80d8
This will detect if you are building libcxx in-tree and libcxxabi is
available. If so, it will default to using the in-tree libcxxabi by
setting LIBCXX_CXX_ABI to "libcxxabi", LIBCXX_LIBCXXABI_INCLUDE_PATHS to
"${CMAKE_SOURCE_DIR}/projects/libcxxabi/include" and will add "cxxabi"
as a proper dependency.
Patch by Russell Harmon.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214037 91177308-0d34-0410-b5e6-96231b3b80d8
Always use list(APPEND) as it will perform the desired action even if the list
is empty or previously unset. The first set is harmless, however, the
subsequent set was overwriting the previous flag setup resulting in an improper
compilation command being generated. This manifested as a build failure on
Linux when using cmake + ninja.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203638 91177308-0d34-0410-b5e6-96231b3b80d8
add_definitions is meant for adding C preprocessor definitions. Modern cmake
suggests use of the CMAKE_CXX_FLAGS for the purposes of pushing flags to the
compilation commands. Simply switch to the modern form given that we are
already requiring a new enough cmake.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203637 91177308-0d34-0410-b5e6-96231b3b80d8
easier to use freshly-built clang with freshly-built libc++.
Basically, this makes it possible to run clang with libc++ without
having to install it, even if you don't have any version of libc++
installed in /usr/
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194825 91177308-0d34-0410-b5e6-96231b3b80d8
Linking against libstdc++, rather than libsupc++, is probably better
for people who need to link against clients of libstdc++. Because
libsupc++ is provided only as a static library, its globals are not
shared between the static library and the copy linked into libstdc++.
This has been found to cause at least one test failure.
This also removes a number of symbols which were multiply defined
between libstdc++ and libc++, only when linking with libstdc++.
Differential Revision: http://llvm-reviews.chandlerc.com/D1825
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192075 91177308-0d34-0410-b5e6-96231b3b80d8
I've changed it so we don't set highest level warnings (all) for MSVC when building projects using cmake and instead leave the default. That's /W4 on my machine and seems to be ok.
With all warnings on for msvc, we see literally thousands of warnings. 99.99% aren't relevant and just obscure the ones that are.
I think the user can still override things if they want something different from the command line when using cmake.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192010 91177308-0d34-0410-b5e6-96231b3b80d8
libcxx doesn't build with -Werror because of #warnings in its source
code. But when libcxx is built as an external LLVM project, it inherits
LLVM build flags, breaking the build if LLVM_ENABLE_WERROR is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191814 91177308-0d34-0410-b5e6-96231b3b80d8
Otherwise if libcxx is built as an LLVM external project (after r191624),
"include(config-ix)" will include config-ix.cmake from LLVM, not from libcxx,
which will result in misconfigured build tree.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191657 91177308-0d34-0410-b5e6-96231b3b80d8
You can now configure from the command line using:
-DLIBCXX_CXX_ABI=libsupc++
-DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="path;path
Also documents how to build on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@171316 91177308-0d34-0410-b5e6-96231b3b80d8
LLVM_ENABLE_ASSERTIONS instead of LIBCXX_ENABLE_ASSERTIONS when
figuring out what _DEBUG/NDEBUG defines to set. It also tries to test
the non-existent variable 'uppercase_CMAKE_BUILD_TYPE', which the top
level LLVM CMakeLists.txt sets up, but which the top level libc++
CMakeLists.txt currently does not. Changing the variable name tested
and creating the uppercase release name variable allows libc++ to
honor the LIBCXX_ENABLE_ASSERTIONS option correctly.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@161308 91177308-0d34-0410-b5e6-96231b3b80d8