Printf is a builtin, and the check fails with -Werror because of a clang
warning about an incompatible redeclaration.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@255187 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch turns on `LIBCXX_ENABLE_ABI_LINKER_SCRIPT` by default whenever `LLVM_HAVE_LINK_VERSION_SCRIPT` is ON. This turns out to be whenever:
1. WIN32 is not defined.
2 UNIX is defined.
3. APPLE is not defined.
While `LLVM_HAVE_LINK_VERSION_SCRIPT` is meant to reflect exactly what we are asking I think it's close enough.
After committing this patch Linux users will no longer have to use "-lc++abi" explicitly!
Reviewers: mclow.lists, danalbert, compnerd, jroelofs
Subscribers: emaste, rengolin, cbergstrom, cfe-commits
Differential Revision: http://reviews.llvm.org/D13739
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@250469 91177308-0d34-0410-b5e6-96231b3b80d8
C++ macros and CMake options that specify the default ABI version of
the library, and can be overridden to pick up new ABI-changing
features.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@250254 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Hi all,
This patch is a successor to D11963. However it has changed dramatically and I felt it would be best to start a new review thread.
Please read the design documentation added in this patch for a description of how it works.
Reviewers: mclow.lists, danalbert, jroelofs, EricWF
Subscribers: vkalintiris, rnk, ed, espositofulvio, asl, eugenis, cfe-commits
Differential Revision: http://reviews.llvm.org/D13407
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@250235 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
On Mac OS X overwriting `/usr/lib/libc++.dylib` can cause your computer to fail to boot. This patch tries to make it harder to do that accidentally.
If `CMAKE_SYSTEM_NAME` is `Darwin` and `CMAKE_INSTALL_PREFIX` is `/usr` don't generate installation rules unless the user explicitly provides `LIBCXX_OVERRIDE_DARWIN_INSTALL=ON`. Note that `CMAKE_INSTALL_PREFIX` is always absolute so we don't need to worry about things like `/usr/../usr`.
Reviewers: mclow.lists, beanz, jroelofs
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D12209
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@246070 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch adds Sphinx based documentation to libc++. The goal is to make it easier to write documentation for libc++ since writing new documentation in HTML is cumbersome. This patch rewrites the main page for libc++ along with the instructions for using, building and testing libc++.
The built documentation can be found and reviewed here: http://efcs.ca/libcxx-docs
In order to build the sphinx documentation you need to specify the cmake options `-DLLVM_ENABLE_SPHINX=ON -DLIBCXX_INCLUDE_DOCS=ON`. This will add the makefile rule `docs-libcxx-html`.
Reviewers: chandlerc, mclow.lists, danalbert, jroelofs
Subscribers: silvas, cfe-commits
Differential Revision: http://reviews.llvm.org/D12129
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245788 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: Currently you can't install libc++ from within the LLVM tree without installing all of LLVM. This patch adds an install rule for libc++.
Reviewers: mclow.lists, danalbert, jroelofs, EricWF
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11697
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245470 91177308-0d34-0410-b5e6-96231b3b80d8
This patch adds the working parts of r243503. The difference with this patch
is that it doesn't include the HandleLLVMOptions.cmake file.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243698 91177308-0d34-0410-b5e6-96231b3b80d8
This change was reverted in r243550 because it broke clang-format builds
(see PR24306).
This patch recommits a fixed version of the original.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243574 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch contains the following changes:
1. Require that libc++ can find a LLVM source directory. This is done the same way as `libc++abi` currently does.
2. Cleanup ugly configuration code in CMakeLists.txt by using `add_flags`, `add_flags_if`, and `add_flags_if_supported` macros.
The goals for this patch are:
1. Help libc++ be more consistent with how LLVM handles CMake options (see PR23670 PR23671).
2. Make it easier to use sanitizers using the `LLVM_USE_SANITIZER` option.
3. Make libc++'s CMakeLists.txt file easier to understand and change.
4. Move towards allowing libc++ to create Sphinx documentation (see http://efcs.ca/libcxx-docs).
5. Move towards allowing libc++ to use other LLVM utilities such as `not` and `FileCheck`.
Reviewers: mclow.lists, jroelofs, danalbert
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11308
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243503 91177308-0d34-0410-b5e6-96231b3b80d8
The changes in src/exception.cpp and cmake/Modules/HandleLibCXXABI.cmake fix a
bug when building libc++ with GCC. Because GCC does not support __has_include
we need to explicitly tell it that we are building against libc++abi via the
preprocessor definition `LIBCXX_BUILDING_LIBCXXABI`.
The changes in include/ratio are to work around CWG defect
1712 (constexpr variable template declarations). GCC 4.8 and before has not
adopted the resolution to this defect.
The changes in include/exception work around an issue where is_final is used
without it being defined in type_traits.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237767 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch adds configuration to CMake and LIT for running the libc++ test-suite to generate code coverage.
To use code coverage use following instructions.
* Find the clang resource dir using `$CXX -print-search-dirs`. Let <library-dir> be the first library search directory.
* `cmake <regular-options> -DLIBCXX_GENERATE_COVERAGE=ON -DLIBCXX_COVERAGE_LIBRARY=<library-dir>/lib/<platform>/libclang_rt.profile.a <source>`
* `make cxx`
* `make check-libcxx`
* `make generate-libcxx-coverage`
The reason I want this patch upstreamed is so I can setup a bot that generates code coverage and posts in online for every revision.
Reviewers: mclow.lists, jroelofs, danalbert
Reviewed By: danalbert
Differential Revision: http://reviews.llvm.org/D8716
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233669 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Clean up all the different possible CMake options for specifying the ABI include paths into one CMake option named `LIBCXX_CXX_ABI_INCLUDE_PATHS`.
The documentation has been updated to reflect this change.
For the next week I have added explicit errors if any of the old flags is used. These errors inform users of the change and the new option to use.
Before committing the change I will announce this change on cfe-dev.
Reviewers: danalbert, mclow.lists
Reviewed By: danalbert, mclow.lists
Subscribers: jroelofs, cbergstrom, cfe-commits
Differential Revision: http://reviews.llvm.org/D5039
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232762 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch add the CMake option `LIBCXX_ENABLE_STATIC_ABI_LIBRARY` which, when enabled, will link libc++ against the static version of the ABI library.
Reviewers: mclow.lists, jroelofs, danalbert
Reviewed By: danalbert
Subscribers: compnerd, cfe-commits
Differential Revision: http://reviews.llvm.org/D8017
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231076 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
libc++abi2.exp should be used whenever `cxxabi.h` defines `_LIBCPPABI_VERSION`. This macro was added to libc++abi in 2012 in r149632. For this reason we should use libc++abi2.exp as default unless otherwise specified.
Also when building against an in-tree libc++abi we definitely want to use libc++abi2.exp.
I would love to know what OSX was the last to use libc++abi.exp but I can only test on 10.9.
Reviewers: danalbert, mclow.lists, EricWF
Reviewed By: EricWF
Subscribers: meadori, cfe-commits
Differential Revision: http://reviews.llvm.org/D7773
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230119 91177308-0d34-0410-b5e6-96231b3b80d8
Since we've added a new header to libc++abi (__cxxabi_config.h), we
now have a case where we might not always find all the ABI headers:
building libc++ against the system's libc++abi on Darwin.
Since this isn't actually a fatal error, degrade it to a warning.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228720 91177308-0d34-0410-b5e6-96231b3b80d8
This isn't actually used for anything, and is broken on Darwin
(currently causing build failures now that the triple is passed to aid
cross compiling). Rather than fix unused code, just remove it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226243 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This is the second attempt at allowing for the use of libraries that the linker cannot find. The first attempt used `CMAKE_LIBRARY_PATH` and `find_library` to select which ABI library should be used. There were a number of problems with this approach:
- `find_library` didn't work with cmake targets (ie in-tree libcxxabi build)
- It wasn't always possible to determine where `find_library` actually found your library.
- `target_link_libraries` inserted the path of the ABI library into libc++'s RPATH when `find_library` was used.
- Linking libc++ and it's ABI library is a special case. It's a lot easier to keep it simple.
After discussion with @cbergstrum a new approach was decided upon.
This patch achieve the same ends by simply using `LIBCXX_CXX_ABI_LIBRARY_PATH` to specify where to find the library (if the linker won't find it). When this variable is defined it is simply added as a library search path when linking libc++. It is a lot easier to duplicate this behavior in LIT. It also prevents libc++ from being linked with an RPATH.
Reviewers: mclow.lists, cbergstrom, chandlerc, danalbert
Reviewed By: chandlerc, danalbert
Subscribers: chandlerc, cfe-commits
Differential Revision: http://reviews.llvm.org/D5860
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220157 91177308-0d34-0410-b5e6-96231b3b80d8
When libcxx is built in-tree with libcxxabi it links against libcxxabi using
the name of the cmake target and not the actual library name. The cmake target
will not work with `find_library()`, so it needs special case handling.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220121 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch adds support for building/testing libc++ with an ABI library that the linker would not normally find.
- `CMAKE_LIBRARY_PATH` is used to specify the list of search directories.
- The ABI library is now found using `find_library` instead of assuming its along the linker's search path.
- `CMAKE_LIBRARY_PATH` is passed to our LIT config as `library_paths`.
- For each path in `library_paths` the following flags are added `-L<path> -Wl,-rpath -Wl,<path>`
Some changes in existing behavior were also added:
- `target_link_libraries` is now passed the ABI library file instead of the library name. Ex `target_link_libraries(cxx "/usr/lib/libc++abi.so")` vs `target_link_libraries(cxx "c++abi")`.
- `-Wl,-rpath -Wl,<path>` is now used on OSX to link to libc++ instead of env['DYLD_LIBRARY_PATH'] if `use_system_lib=False`.
Reviewers: mclow.lists, danalbert, EricWF
Reviewed By: EricWF
Subscribers: emaste, cfe-commits
Differential Revision: http://reviews.llvm.org/D5038
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220118 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
This is unnecessary now that the flag handling has been fixed. The flags will
be added properly in the main CMakeLists.txt after the config-ix inclusion which
performs the required check.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203639 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