summaryrefslogtreecommitdiffstats
path: root/libcxxabi/cmake
Commit message (Collapse)AuthorAgeFilesLines
* [libcxx{,abi}] Don't link libpthread and libdl on FuchsiaPetr Hosek2019-12-061-5/+13
| | | | | | | | | These are a part of the libc so linking these explicitly isn't necessary and embedding these as deplibs causes link time error. This issues was introduced in a9b5fff which changed how we emit deplibs. Differential Revision: https://reviews.llvm.org/D71135
* [libc++abi] Link against libSystem on Apple platformsLouis Dionne2019-10-041-0/+1
| | | | | | | | On Apple platforms, libSystem is an umbrella for all other system libraries, and libpthread (and friends) are actually just symlinks to libSystem. llvm-svn: 373770
* [libcxxabi] Fix arm build failer with libgccAdhemerval Zanella2019-09-251-2/+8
| | | | | | | | | | | | | | | | | | | | Both arm32 armv7/armv8 bots which do not use compiler-rt are failing to a linking issue: [100%] Built target cxxabi_static CMakeFiles/cxxabi_shared.dir/cxa_demangle.cpp.o: In function `(anonymous namespace)::itanium_demangle::OutputStream::writeUnsigned(unsigned long long, bool)': /home/buildslave/buildslave/libcxx-libcxxabi-libunwind-armv7-linux-noexceptions/llvm/projects/libcxxabi/src/demangle/Utility.h:55: undefined reference to `__aeabi_uldivmod' /home/buildslave/buildslave/libcxx-libcxxabi-libunwind-armv7-linux-noexceptions/llvm/projects/libcxxabi/src/demangle/Utility.h:56: undefined reference to `__aeabi_uldivmod' clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) It seems after r371273 OutputStream is used more extensively and is pulling OutputStream::writeUnsigned (which thus requires unsigned integer module). The straightfoward fix is to explicit link against libgcc if compiler-rt is not used. llvm-svn: 372921
* Provide a meaningful diagnostic when LLVM_PATH doesn't point to a directoryLouis Dionne2019-08-191-0/+3
| | | | llvm-svn: 369312
* [libcxx][libcxxabi] Remove the unused CMake checksPetr Hosek2019-05-301-32/+1
| | | | | | | | | | | These seemed to have been used in the past but were since removed by the add_compile_flags_if_supported functions that combine these these checks and adding the flag, but the original checks were never removed. Differential Revision: https://reviews.llvm.org/D62566 llvm-svn: 362058
* [runtimes] Use -Wunknown-pragmas for the pragma checkPetr Hosek2019-05-301-0/+4
| | | | | | | This is a follow up to r362055, we need -Wunknown-pragmas otherwise the check is going to succeed it the pragma isn't supported. llvm-svn: 362057
* [runtimes] Check if pragma comment(lib, ...) is supported firstPetr Hosek2019-05-301-0/+9
| | | | | | | | | This fixes the issue introduced by r362048 where we always use pragma comment(lib, ...) for dependent libraries when the compiler is Clang, but older Clang versions don't support this pragma so we need to check first if it's supported before using it. llvm-svn: 362055
* [libcxxabi][CMake] Drop unused HandleOutOfTreeLLVM includePetr Hosek2019-02-181-3/+0
| | | | | | | | | | | | This include doesn't seem to be needed for the standalone build (it's not being used by libc++ build either), but introduces unnecessary dependency because HandleOutOfTreeLLVM performs checks that require a working C++ library. We shouldn't require a working C++ library to build libc++abi or libc++ (it's what we're building after all). Differential Revision: https://reviews.llvm.org/D58333 llvm-svn: 354284
* Revert "[CMake] Use __libc_start_main rather than fopen when checking for C ↵Petr Hosek2019-01-281-1/+1
| | | | | | | | | library" This reverts commit r352341: it broke the build on macOS which doesn't seem to provide __libc_start_main in its C library. llvm-svn: 352411
* [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT alwaysMichal Gorny2019-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Refactor the get_llvm_lit_path() logic to respect LLVM_EXTERNAL_LIT, and require the fallback to be defined explicitly as LLVM_DEFAULT_EXTERNAL_LIT. This fixes building libcxx standalone after r346888. The old logic was using LLVM_EXTERNAL_LIT both as user-defined cache variable and an optional pre-definition of default value from caller (e.g. libcxx). It included a hack to make this work by assigning the value back and forth but it was fragile and stopped working in libcxx. The new logic is simpler and more transparent. Default value is provided in a separate variable, and used only when user-specified variable is empty (i.e. not overriden). Differential Revision: https://reviews.llvm.org/D57282 llvm-svn: 352374
* [CMake] Use __libc_start_main rather than fopen when checking for C libraryPetr Hosek2019-01-281-1/+1
| | | | | | | | | | | | | | | | | | The check_library_exists CMake uses a custom symbol definition. This is a problem when checking for C library symbols because Clang recognizes many of them as builtins, and returns the -Wbuiltin-requires-header (or -Wincompatible-library-redeclaration) error. When building with -Werror which is the default, this causes the check_library_exists check fail making the build think that C library isn't available. To avoid this issue, we should use a symbol that isn't recognized by Clang and wouldn't cause the same issue. __libc_start_main seems like reasonable choice that fits the bill. Differential Revision: https://reviews.llvm.org/D57142 llvm-svn: 352341
* [libcxxabi] Support building hermetic static libraryPetr Hosek2019-01-241-0/+23
| | | | | | | | | | | | This is useful when the static libc++abi library is being linked into shared libraries that may be used in with other shared libraries that use different C++ library. We want to avoid avoid exporting libc++abi or libc++ symbols in those cases. This achieved by a new CMake option which can be enabled by libc++abi vendors as needed. Differential Revision: https://reviews.llvm.org/D56026 llvm-svn: 352017
* Enable LLVM_ENABLE_WARNINGS when building standalone out of treeMartin Storsjo2019-01-221-0/+2
| | | | | | | | | When built within the llvm runtimes directory, the runtimes CMakeLists.txt adds the same. Differential Revision: https://reviews.llvm.org/D56979 llvm-svn: 351873
* [CMake] Passthrough CFLAGS when checking the compiler-rt pathPetr Hosek2018-11-141-0/+3
| | | | | | | | | | This is needed when cross-compiling for a different target since CFLAGS may contain additional flags like -resource-dir which change the location in which compiler-rt builtins are found. Differential Revision: https://reviews.llvm.org/D54371 llvm-svn: 346820
* [CMake] Convert paths to the right form in standalone builds on WindowsMartin Storsjo2018-06-202-3/+7
| | | | | | | | | | | | | The paths output from llvm-config --cmakedir and from clang --print-libgcc-file-name can contain backslashes, while CMake can't handle the paths in this form. This matches what compiler-rt already does (since SVN r203789 and r293195). Differential Revision: https://reviews.llvm.org/D48355 llvm-svn: 335171
* Fix standalone test-suite run.Eric Fiselier2018-01-171-7/+15
| | | | | | | | | This patch updates libc++abi's HandleOutOfTreeLLVM.cmake to match libc++'s -- and more importantly, to fix a bug where llvm-lit wasn't found/created when libc++abi was built out-of-tree. This prevented the test suite from running. llvm-svn: 322768
* build: use cmake to pass -std=c++11Saleem Abdulrasool2017-06-111-5/+0
| | | | | | | | | | Rather than manually checking for support for the spelling of the C++ standard, indicate to CMake that we require that the compiler support C++11 and that we compile without the GNU extensions. This simplifies the flags handling in libc++abi itself by relying on CMake to translate the flag and add it as appropriate. llvm-svn: 305175
* build: use POSITION_INDEPENDENT_CODE CMake propertySaleem Abdulrasool2017-06-111-1/+0
| | | | | | | | | | | | Use the POSITION_INDEPENDENT_CODE target property to indicate that we should be building with -fPIC or the equivalent flag based on the toolchain that we are using. This makes the check more portable and simplifies the flags management. Because we don't want this setting to propagate in the case of an in-tree build, set the property on the targets we construct explicitly rather than setting CMAKE_POSITION_INDEPENDENT_CODE to ON globally. llvm-svn: 305174
* [libcxxabi] HandleLLVMOptions in out of tree buildMartell Malone2017-06-031-0/+1
| | | | | | Differential revision: https://reviews.llvm.org/D33753 llvm-svn: 304664
* [libcxxabi] Rework CMakeLists.txt into modulesMartell Malone2017-06-013-0/+356
| | | | | | | | | | Refactor cmake to remove dependence on LLVM's cmake modules. This improves handling of cmake checks when cross compiling and brings libcxxabi in line with libcxx and other project modules. Differential revision: https://reviews.llvm.org/D33635 llvm-svn: 304374
* [libcxxabi] iconv is not needed for mingw-w64Martell Malone2017-05-261-1/+1
| | | | llvm-svn: 304026
* [Libcxxabi]: Support using compiler-rt for MinGW64Martell Malone2017-05-111-3/+8
| | | | | | | | Reviewers: EricWF Differential Revision: https://reviews.llvm.org/D33098 llvm-svn: 302824
* Fix Libc++abi linking under MinGW64Eric Fiselier2017-05-111-1/+4
| | | | llvm-svn: 302760
* Apply libc++ MinGW CMake fix to libc++abiEric Fiselier2017-05-111-0/+5
| | | | llvm-svn: 302754
* [CMake][libcxxabi] Fix the -target and -gcc-toolchain flag handlingPetr Hosek2017-04-161-1/+1
| | | | | | | | | | | | CMake has the problem with the single dash variant because of the space, so use the double dash with equal sign version. These flag need to be included in compile flags to propagate correctly. We also don't have to pass the target triple when checking for compiler-rt since that flag is already included in compile flags now. Differential Revision: https://reviews.llvm.org/D32069 llvm-svn: 300418
* [CMake][libcxxabi] Use -nodefaultlibs for CMake checksPetr Hosek2017-04-072-5/+91
| | | | | | | | | | | | Since libc++abi is built with -nodefaultlibs, we should be using this option even for CMake checks to avoid any inconsistency and also to avoid dependency on a working C++ standard library just for the setting up the build itself. The implementation is largely similar to the one used by libc++. Differential Revision: https://reviews.llvm.org/D31639 llvm-svn: 299797
* Turn on -Wunused-function and cleanup occurancesEric Fiselier2017-03-041-1/+1
| | | | llvm-svn: 296936
* [CMake] Trying to fix the bots I brokeChris Bieneman2016-08-291-1/+1
| | | | | See: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-cxx1z/builds/981/steps/build.libcxxabi/logs/stdio llvm-svn: 280023
* [CMake] Use -std=c++11 if supportedChris Bieneman2016-08-291-0/+5
| | | | | | | | | | | | Summary: This patch adds a check for if -std=c++11 is a supported flag, and adds it to CMAKE_CXX_FLAGS if it is supported. Reviewers: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24007 llvm-svn: 280021
* libc++abi: add a top level option for using CompilerRTSaleem Abdulrasool2016-07-151-1/+3
| | | | | | | | | | Add an option to opt into compiler-rt instead of libgcc. This option defaults to OFF to avoid a behaviour change. It is not possible to mix and match different runtime libraries. Disabling this requires that libc++ is built accordingly. This knob is particularly useful for targets that are GCC by default (i.e. Linux). llvm-svn: 275505
* Partially revert r270816: build with -fvisibility=hidden.Eric Fiselier2016-06-021-1/+0
| | | | | | | | | | | | | | | | | This patch breaks the ABI on linux when libc++abi.a is statically linked into libc++.so. Certain libc++ symbols get exported from libc++abi.a as hidden and therefore they also get hidden in libc++.so. The symbols is question are: * _ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv * _ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv * _ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv I imagine we just need to fix the visibility for these symbols in the libc++ headers but I'm reverting the patch until it's sorted. llvm-svn: 271500
* libc++abi: build with -fvisibility=hiddenSaleem Abdulrasool2016-05-261-0/+1
| | | | | | | | Enable building libc++abi with hidden visibility by default. The ABI mandated interfaces (and a few extra) are already set up to be externally visible. This allows us to ensure that any implementation details are not leaked. llvm-svn: 270816
* [libc++abi] Use libgcc and libgcc_s to provide _Unwind symbols instead of ↵Eric Fiselier2015-12-141-1/+1
| | | | | | | | | | | | | | | | | | libgcc_eh.a Summary: libgcc_eh.a cannot be used when building libc++abi as a shared library (the default configuration). See this post for some more discussion: https://gcc.gnu.org/ml/gcc/2012-03/msg00104.html This patch reverts back to using libgcc_s when linking libc++abi.so. Reviewers: danalbert, chandlerc, mclow.lists, ismail, compnerd Subscribers: vkalintiris, cfe-commits Differential Revision: http://reviews.llvm.org/D15440 llvm-svn: 255559
* Replace cmake check for printf with a check for fopen.Evgeniy Stepanov2015-12-101-1/+1
| | | | | | | Printf is a builtin, and the check fails with -Werror because of a clang warning about an incompatible redeclaration. llvm-svn: 255186
* unwind: use -fno-rtti -fno-exceptions -funwind-tablesSaleem Abdulrasool2015-02-061-0/+2
| | | | | | | | | RTTI and exceptions are not needed for the unwinder, the use of C++ there is for very specific cases, and does not require dynamic_cast nor does it use exceptions. This avoids unnecessary references to type information being emitted. llvm-svn: 228408
* Enable -Wundef.Dan Albert2015-02-051-0/+1
| | | | | | | | The problem that caused the need for http://reviews.llvm.org/D7419 was caused by testing the value of something that was undefined. This should prevent that in the future. llvm-svn: 228257
* Add -funwind-tables to CMAKE_C_FLAGS.Logan Chien2015-01-221-0/+2
| | | | | | | | Without -funwind-tables, the compiler won't generate the unwinding table for these C functions. However, the functions in libunwind, such as `_Unwind_Backtrace()`, WILL unwind stack to get the backtrace. llvm-svn: 226823
* [libcxxabi] Add __cxa_thread_atexit for TLS support on Linux.Dan Albert2014-12-181-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: Fixes PR21738. The implementation for this is handled by __cxa_thread_atexit_impl, which is supplied by libc. More information: https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables Reviewers: mclow.lists, EricWF, jroelofs Reviewed By: jroelofs Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D6708 llvm-svn: 224477
* libcxxabi must link to dl if using bundled unwindJonathan Roelofs2014-08-181-0/+1
| | | | | | | Patch by Ismail Donmez http://reviews.llvm.org/D4953 llvm-svn: 215950
* libcxxabi cmake: Use HandleLLVMOptions.cmake, don't manually add -std=c++11.Nico Weber2014-07-161-1/+0
| | | | | | | | No intended behavior change on Linux and Mac OS X. On Windows, having libcxxabi in one's checkout should now no longer break running cmake. (cl.exe supports c++11, but doesn't understand a -std= flag.) llvm-svn: 213214
* Fix for libc++abi when using -Wl,--as-needed.Dan Albert2014-07-141-0/+2
| | | | | | | | | | | The cmake files for libc++abi and the unwinder weren't linking against libpthread or an unwind library. If the tests were linked with -Wl,--as-needed, these libraries wouldn't be linked, causing them to fail. Patch contributed by İsmail Dönmez. llvm-svn: 212958
* Make cmake cxxflags match those in lib/buildit.Dan Albert2014-07-101-3/+14
| | | | llvm-svn: 212768
* Add a cmake build system.Dan Albert2014-07-031-0/+27
Will add support for tests with lit in a later patch. This does not yet support building the unwinder in src/Unwind. llvm-svn: 212286
OpenPOWER on IntegriCloud