Summary:
This patch turns on `-fvisibility-inlines-hidden` when building the dylib. This is important so that libc++.dylib doesn't accidentally export inline-functions which are ODR used somewhere in the dylib.
On OS X this change has no effect on the current ABI of the dylib. Unfortunately on Linux there are already ~20 inline functions which are unintentionally exported by the dylib. Almost all of these are implicitly generated destructors. I believe removing these function definitions is safe because every "linkage unit" which uses these functions has its own definition, and therefore shouldn't be dependent on libc++.dylib to provide them.
Also could a FreeBSD maintainer comment on the ABI compatibility of this patch?
Reviewers: mclow.lists, emaste, dexonsmith, joker-eph-DISABLED, jroelofs, danalbert, mehdi_amini, compnerd, dim
Subscribers: beanz, mgorny, cfe-commits, modocache
Differential Revision: https://reviews.llvm.org/D25593
llvm-svn: 285101
Summary:
`__libcpp_refstring` currently has two different definitions. First there is the complete definition in `<__refstring>` but there is also a second in `<stdexcept>`. The historical reason for this split is because both libc++ and libc++abi need to see the inline definitions of __libcpp_refstrings methods, but the `<stdexcept>` header doesn't. However this is an ODR violation and breaks the modules build.
This patch fixes the issue by creating a single class definition in `<stdexcept>` and changing `<__refstring>` to contain only the inline method definitions. This way both `libcxx/src/stdexcept.cpp` and `libcxxabi/src/stdexcept.cpp` see the same declaration in `<stdexcept>` and definitions in `<__refstring>`
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25603
llvm-svn: 285100
musl's pthread implementations use volatile types in their structs
which is not being constexpr in C++11 but is in C++14.
Differential Revision: https://reviews.llvm.org/D25491
llvm-svn: 284950
These modules are necessary on Darwin to allow modules with
'no_undeclared_includes' (introduced in clang r284797) to work properly
while using libc++ headers.
Patch extracted from a suggested module.modulemap from Richard Smith!
llvm-svn: 284801
Adjust the stand-alone build files to accept either CMake files from
LLVM_CMAKE_PATH or from LLVM_MAIN_SRC_DIR instead of requiring both.
This makes it possible to run libcxx tests on top of installed LLVM
and lit, without having to unpack a copy of LLVM sources. Furthermore,
it avoids adding duplicate paths.
Differential Revision: https://reviews.llvm.org/D25093
llvm-svn: 284583
Convert the Solaris xlocale.c compatibility library from plain C to C++
in order to fix the build failures caused by the addition of -std=c++11
to LIBCXX_COMPILE_FLAGS. The additional flag got propagated to the C
file, resulting in error with strict compilers.
Differential Revision: https://reviews.llvm.org/D25431
llvm-svn: 284494
Fix the iswxdigit_l() function prototype to take wint_t parameter
instead of incorrect wchar_t.
Differential Revision: https://reviews.llvm.org/D25431
llvm-svn: 284493
This fixes a small omission where even when __external_threading is provided,
we attempt to declare a pthread based threading API. Instead, we should leave
out everything for the __external_threading header to take care of.
The __threading_support header provides a proof-of-concept externally threaded
libc++ variant when _LIBCPP_HAS_THREAD_API_EXTERNAL is defined. But if the
__external_threading header is present, we should exclude all of that POC stuff.
Reviewers: EricWF
Differential revision: https://reviews.llvm.org/D25468
llvm-svn: 284232
Libc++ will not build with modules enabled. In order to support an in-tree
libc++ when LLVM_ENABLE_MODULES is ON we need to explicitly disable the feature.
Unfortunately the libc++ sources are fundamentally non-modular. For example
iostream.cpp defines cout, cerr, wout, ... as char buffers instead of streams
in order to better control initialization/destruction. Not shockingly Clang
diagnoses this. Many other sources files define _LIBCPP_BUILDING_FOO macros to
provide definitions for normally inline symbols (See bind.cpp). Finally The
current module.map prohibits using <strstream> in C++11 so we can't build
strstream.cpp.
I think I can fix most of these issues but until then just disable modules.
llvm-svn: 284230