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
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
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
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
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
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
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
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
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
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
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
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
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