Commit Graph

142 Commits

Author SHA1 Message Date
Petr Hosek
af3bb36aa2 [libcxx] Update gen_link_script.py to support different input and output
This enables the use of this script from other build systems like
GN which don't support post-build actions as well as for static
archives.

Differential Revision: https://reviews.llvm.org/D60309

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358915 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-22 19:51:33 +00:00
Petr Hosek
8a82647271 [CMake] Split linked libraries for shared and static libc++
Some linker libraries are only needed for shared libc++, some only
for static libc++, combining these together in LIBCXX_LIBRARIES and
LIBCXX_INTERFACE_LIBRARIES can introduce unnecessary dependencies.

This changes splits those up into LIBCXX_SHARED_LIBRARIES and
LIBCXX_STATIC_LIBRARIES matching what libc++abi already does.

Differential Revision: https://reviews.llvm.org/D57872

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358614 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 21:41:09 +00:00
Martin Storsjo
56dd7238c9 [CMake] Fix statically linking in libcxxabi if built separately
In this case, CMake doesn't know about the c++abi target within the
same CMake run.

This reverts this aspect back to how it was before SVN r357811.

Differential Revision: https://reviews.llvm.org/D60448

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358009 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 14:31:09 +00:00
Louis Dionne
9f8a406c0e [libc++] Remove install_name and compatibility_version on OS X
CMake already specifies those, and we never actually want those to be
used. In fact, r357811 re-ordered those flags in a way that the
explicitly-provided install_name was overriding the CMake-provided
install_name (instead of the other way around). This caused the dylib
to be considered a system dylib, and hence the explicitly provided rpath
to be ignored. This, in turn, caused some unit tests to start linking
against the system libc++.dylib instead of the freshly-built one.
Specifically, the unit tests that started linking against the system
dylib are those that didn't specify a DYLD_LIBRARY_PATH, such as
last_write_time.sh.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357946 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 21:37:42 +00:00
Louis Dionne
2884b592ec [libc++][CMake] Make sure the benchmarks link against libc++abi
The refactoring in r357811 made it so that we didn't add the ABI library
to the list of LIBCXX_LIBRARIES. As a result, benchmarks didn't link to
the ABI library and were missing symbols. This broke the build bots.

As a drive-by fix, we also provide the SHARED ABI library to the linker
script instead of the STATIC ABI library.

This couldn't be discovered on Apple platforms because libc++.dylib
re-exports libc++abi.dylib symbols there.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357818 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 21:05:32 +00:00
Louis Dionne
dda98abc8d [libc++] Localize CMake code only related to the shared library
Summary:
There's a lot of CMake logic that's only relevant to the shared library,
yet it was using a code path and setting variables that impact both the
shared and the static libraries. This patch moves this logic so that it
clearly only impacts the shared library.

Reviewers: phosek, smeenai, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60276

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357811 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 20:29:54 +00:00
Petr Hosek
d5529b8cd9 [CMake] Differentiate between static and shared libc++abi
This addresses the issue introduced in r354212 which broke the case when
static libc++abi is merged into static libc++, but shared libc++ is
linked against shared libc++. There are 4 different possible
combinations which is difficult to capture using a single variable. This
change splits LIBCXX_CXX_ABI_LIBRARY into two:
LIBCXX_CXX_SHARED_ABI_LIBRARY and LIBCXX_CXX_STATIC_ABI_LIBRARY to
handle the shared and static cases. This in turn allows simplification
of some of the logic around merging of static archives.

Differential Revision: https://reviews.llvm.org/D60114

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357556 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 01:33:14 +00:00
Louis Dionne
244334750d [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms
Summary:
I can't see a good reason to disallow this, even though it isn't the
standard way we build libc++ for Apple platforms.

Making this work on Apple platforms requires using different flags for
--whole-archive and removing the -D flag when running `ar` to merge
archives because that flag isn't supported by the `ar` shipped on Apple
platforms. This shouldn't be an issue since the -D option appears to be
enabled by default in GNU `ar`.

Reviewers: phosek, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59513

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356903 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 14:56:29 +00:00
Louis Dionne
0b3b8d8d65 [libc++] Re-export the sjlj ABI v2 for ARM architectures
We were previously not exporting the right ABI version of libc++abi.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356798 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 19:38:53 +00:00
Eric Fiselier
cdb3094601 Allow disabling of filesystem library.
Summary: Filesystem doesn't work on Windows, so we need a mechanism to turn it off for the time being.

Reviewers: ldionne, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: mstorsjo, mgorny, christof, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59619

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356633 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-21 00:04:31 +00:00
Louis Dionne
3af5f5e110 [libc++][CMake] Clean up some of the libc++ re-exporting logic
Summary:
This change allows specifying the version of libc++abi's ABI to re-export
when configuring CMake. It also clearly identifies which ABI version of
libc++abi each export file contains.

Finally, it removes hardcoded knowledge about the 10.9 SDK for MacOS,
since that knowledge is not relevant anymore. Indeed, libc++ can't be
built with the toolchain that came with the 10.9 SDK anyway because
the version of Clang it includes is too old (for example if you want
to build a working libc++.dylib, you need bugfixes to visibility
attributes that are only in recent Clangs).

Reviewers: dexonsmith, EricWF

Subscribers: mgorny, christof, jkorous, arphaman, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59489

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356587 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 18:16:24 +00:00
Louis Dionne
3b886a1ce8 [libc++] Build <filesystem> support as part of the dylib
Summary:
This patch treats <filesystem> as a first-class citizen of the dylib,
like all other sub-libraries (e.g. <chrono>). As such, it also removes
all special handling for installing the filesystem library separately
or disabling part of the test suite from the lit command line.

Unlike the previous attempt (r356500), this doesn't remove all the
filesystem tests.

Reviewers: mclow.lists, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59152

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356518 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 20:56:13 +00:00
Louis Dionne
e76d13a487 Revert "[libc++] Build <filesystem> support as part of the dylib"
When I applied r356500 (https://reviews.llvm.org/D59152), I somehow
deleted all of filesystem's tests. I will revert r356500 and re-apply
it properly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356505 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 19:27:29 +00:00
Louis Dionne
582679a3fe [libc++] Build <filesystem> support as part of the dylib
Summary:
This patch treats <filesystem> as a first-class citizen of the dylib,
like all other sub-libraries (e.g. <chrono>). As such, it also removes
all special handling for installing the filesystem library separately
or disabling part of the test suite from the lit command line.

Reviewers: mclow.lists, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59152

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356500 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 19:09:33 +00:00
Louis Dionne
41aeda8093 [libc++][CMake] Do not define cxx_shared_EXPORTS when building the shared library
CMake will define -Dcxx_shared_EXPORTS when building the shared library
by default. In theory, this is used to signal to the library that we're
building a shared library and that dllimport/dllexport should be used.
However, we already have our own way of doing that, so I'm removing this
define to avoid meaningless command line arguments in the build.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356167 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-14 17:15:47 +00:00
Louis Dionne
36684e49e2 [libc++][CMake] Fix typo introduced in r356150
That typo broke the build when the shared library build was disabled.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356155 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-14 14:52:26 +00:00
Louis Dionne
e54dd56e8e [libc++] Do not force building with -fPIC (re-applying)
Summary:
In r355746, we stopped forcing to build with -fPIC because that should
be specified by the CMAKE_POSITION_INDEPENDENT_CODE option at CMake
configure time (and by default -fPIC is used for shared libraries anyways).

However, r355746 had to be reverted in r355756 because we were not
actually building the shared library with -fPIC. The reason is that
we were sharing an object library between the static and the shared
library, which caused flags for static libraries to be used when
building object files that were going to be used for a shared library.

Since this was resolved by r356150, we can stop forcing -fPIC again.

Reviewers: EricWF, smeenai

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59250

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356153 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-14 14:38:38 +00:00
Louis Dionne
18616964ee [libc++] Do not share an object library to create the static/shared libraries
Summary:
The problem with using an object library for doing this is that it prevents
the shared library and the static library from being built with the right
default flags. For example, CMake will build shared libraries with -fPIC
by default, but not static libraries. Using an object library to create
the shared library will prevent the right default flags for shared
libraries from being used.

As a side effect, this patch also localizes the logic related to building
a hermetic static library to the static library case, making clear that
this has no effect on the shared library.

Reviewers: phosek, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59248

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356150 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-14 14:19:08 +00:00
Eric Fiselier
a23faa9455 Revert "[libc++] Do not force building with -fPIC"
This reverts commit r355764.

CMake does not turn -fPIC on for us by default. so this patch breaks
standalone builds. The only reason it hasn't broken any bots is because
LLVM turns on and specifies '-fPIC' for us.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355756 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 23:27:46 +00:00
Louis Dionne
11e3f8c4d4 [libc++] Do not force building with -fPIC
Summary:
Whether we build with -fPIC should be specified by the
CMAKE_POSITION_INDEPENDENT_CODE option at configure time.
Note that this patch doesn't change the behavior when building
by default, since -fPIC is used for shared libraries by default.

Reviewers: EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59146

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355746 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 22:24:12 +00:00
Matthew Voss
7f35e38753 Revert "[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/"
This broke the windows bots.

This reverts commit 28302c66d2586074f77497d5dc4eac7182b679e0.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355725 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 20:33:55 +00:00
Petr Hosek
7f02475f6c [runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/
This change is a consequence of the discussion in "RFC: Place libs in
Clang-dedicated directories", specifically the suggestion that
libunwind, libc++abi and libc++ shouldn't be using Clang resource
directory.  Tools like clangd make this assumption, but this is
currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build.
This change addresses that by moving the output of these libraries to
lib/<target> and include/ directories, leaving resource directory only
for compiler-rt runtimes and Clang builtin headers.

Differential Revision: https://reviews.llvm.org/D59013

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355665 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 05:35:22 +00:00
Louis Dionne
7f3087ed7c [libc++] Remove old CMake workaround
We haven't had any complaints so far, and I don't think anybody builds
libc++ from source for that old platform anymore.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355336 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 20:52:14 +00:00
Eric Fiselier
bc415828df Make LIBCXX_STANDARD_VER configurable
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353649 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-10 18:27:55 +00:00
Petr Hosek
d4a2081367 [CMake] Use correct visibility for linked libraries in CMake
When linking library dependencies, we shouldn't need to export linked
libraries to dependents. We should be explicit about this in
target_link_libraries, otherwise other targets that depend on these such
as sanitizers get repeated (and possibly even conflicting) dependencies.

Differential Revision: https://reviews.llvm.org/D57456

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@352688 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 23:18:05 +00:00
Petr Hosek
7b459f3f48 Revert "[CMake] Use correct visibility for linked libraries in CMake"
This reverts commit r352654: this broke libcxx and sanitizer bots.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@352658 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 19:51:18 +00:00
Petr Hosek
30f748dc47 [CMake] Use correct visibility for linked libraries in CMake
When linking library dependencies, we shouldn't need to export linked
libraries to dependents. We should be explicit about this in
target_link_libraries, otherwise other targets that depend on these such
as sanitizers get repeated (and possibly even conflicting) dependencies.

Differential Revision: https://reviews.llvm.org/D57456

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@352654 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 19:27:26 +00:00
Petr Hosek
9e444eb82d [libcxx] Support building hermetic static library
This is useful when static libc++ library is being linked into
shared libraries that may be used in combination with libraries.
We want to avoid we exporting libc++ symbols in those cases where
this option is useful. This is provided as a CMake option and can
be enabled by libc++ vendors as needed.

Differential Revision: https://reviews.llvm.org/D55404

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350489 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-06 06:14:31 +00:00
Louis Dionne
c56c9cffe6 [libcxx] Make sure the re-export logic works when paths contain spaces
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347711 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-27 21:13:31 +00:00
Louis Dionne
f27a903f77 [libcxx] Fix libc++ re-exporting logic when Command Line Tools are not installed
Summary:
When the Xcode Command Line tools are not installed but CMAKE_OSX_SYSROOT is
set, we would try to re-export symbols from the libc++abi.dylib shipped in
the sysroot, which does not exist. This commit changes the build on OS X to
always re-export symbols from the explicit re-export lists, which doesn't
change depending on what system you're building on, and is therefore much
less flaky.

Reviewers: EricWF, mclow.lists

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D54595

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347708 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-27 20:59:47 +00:00
Louis Dionne
9bc5d8e1ba [libcxx] Remove custom CMake code targeting Mac OS 10.6
libc++ has dropped support for Mac OS 10.6 for a while, and we don't
have any testers set up for that OS.

This commit puts in an error message so that people can reach out to
the libc++ maintainers in case support for 10.6 is still expected (as
opposed to silently failing in weird ways). We can completely drop
support for 10.6 and remove the error message some time in the future
when we're sure that nobody is relying on it.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344576 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-16 00:31:32 +00:00
Eric Fiselier
bc3f4035c3 Add libc++fs to the test deps, and not to the target 'cxx'.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338096 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 03:47:46 +00:00
Eric Fiselier
0be5527dc0 Attempt to unbreak *all the bots*
The bots were failing to build the cxx_filesystem target, so the
tests were failing. Though this does lead me to wonder how it
was ever working with c++experimental.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338095 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 03:42:58 +00:00
Eric Fiselier
a0866c5fb5 Implement <filesystem>
This patch implements the <filesystem> header and uses that
to provide <experimental/filesystem>.

Unlike other standard headers, the symbols needed for <filesystem>
have not yet been placed in libc++.so. Instead they live in the
new libc++fs.a library. Users of filesystem are required to link this
library. (Also note that libc++experimental no longer contains the
definition of <experimental/filesystem>, which now requires linking libc++fs).

The reason for keeping <filesystem> out of the dylib for now is that
it's still somewhat experimental, and the possibility of requiring an
ABI breaking change is very real. In the future the symbols will likely
be moved into the dylib, or the dylib will be made to link libc++fs automagically).

Note that moving the symbols out of libc++experimental may break user builds
until they update to -lc++fs. This should be OK, because the experimental
library provides no stability guarantees. However, I plan on looking into
ways we can force libc++experimental to automagically link libc++fs.

In order to use a single implementation and set of tests for <filesystem>, it
has been placed in a special `__fs` namespace. This namespace is inline in
C++17 onward, but not before that. As such implementation is available
in C++11 onward, but no filesystem namespace is present "directly", and
as such name conflicts shouldn't occur in C++11 or C++14.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338093 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 03:07:09 +00:00
Petr Hosek
89d973a050 [CMake] Option to control whether shared/static library is installed
Currently it's only possible to control whether shared or static library
build of libc++, libc++abi and libunwind is enabled or disabled and
whether to install everything we've built or not. However, it'd be
useful to have more fine grained control, e.g. when static libraries are
merged together into libc++.a we don't need to install libc++abi.a and
libunwind.a. This change adds this option.

Differential Revision: https://reviews.llvm.org/D49573

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337867 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-24 23:27:51 +00:00
Petr Hosek
44ef94a8c9 Reland "[CMake] Support statically linking dependencies only to shared or static library"
This is a reland of commit r337668.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337814 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-24 07:06:17 +00:00
Petr Hosek
78c3548b88 Revert "[CMake] Support statically linking dependencies only to shared or static library"
This reverts commit r337668: broke the cxxabi build when using Make.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337670 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 05:07:44 +00:00
Petr Hosek
24acfd881a [CMake] Support statically linking dependencies only to shared or static library
Currently it's possible to select whether to statically link unwinder
or the C++ ABI library, but this option applies to both the shared
and static library. However, in some scenarios it may be desirable to
only statically link unwinder and C++ ABI library into static C++
library since for shared C++ library we can rely on dynamic linking
and linker scripts. This change enables selectively enabling or
disabling statically linking only to shared or static library.

Differential Revision: https://reviews.llvm.org/D49502

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337668 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 04:19:55 +00:00
Ahmed Bougacha
92f1507ade [CMake] Rename cxx_headers back to cxx-headers.
r334477 renamed the cxx-headers target to cxx_headers, but various
pieces sort-of expect the target names to match the component (e.g.,
LLVM_DISTRIBUTION_COMPONENTS in the various bootstrap caches, which, via
some magic foreign to me, seems to expect cxx-headers,
install-cxx-headers, and install-cxx-headers-stripped to exist.)

Revert back to cxx-headers.

Differential Revision: https://reviews.llvm.org/D48701

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@335899 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28 18:35:35 +00:00
Petr Hosek
204d5ec7f1 [CMake] Use common variable for all header targets NFC
This simplifies the handling of header targets.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334477 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 06:58:06 +00:00
Petr Hosek
8650687840 [CMake] Add a missing target dependency on C++ ABI headers
This resolves the breakage introduced in r334468 which results in
build error when using CMake Makefile generator.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334470 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 03:31:03 +00:00
Petr Hosek
f48515b28b Reland "Use custom command and target to install libc++ headers"
Using file(COPY FILE...) has several downsides. Since the file command
is only executed at configuration time, any changes to headers made
after the initial CMake execution are ignored. This can lead to subtle
errors since the just built Clang will be using stale libc++ headers.
Furthermore, since the headers are copied prior to executing the build
system, this may hide missing dependencies on libc++ from other LLVM
components.

This changes replaces the use of file(COPY FILE...) command with a
custom command and target which addresses all aforementioned issues and
matches the implementation already used by other LLVM components that
also install headers like Clang builtin headers.

Differential Revision: https://reviews.llvm.org/D44773

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334468 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 03:10:02 +00:00
Petr Hosek
09ff3dc74f Revert "[CMake] Use custom command and target to install libc++ headers"
This reverts commit r329544 which is failing on libcxx standalone bots.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329545 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 04:36:04 +00:00
Petr Hosek
8d0d6fa4aa [CMake] Use custom command and target to install libc++ headers
Using file(COPY FILE...) has several downsides. Since the file command
is only executed at configuration time, any changes to headers made
after the initial CMake execution are ignored. This can lead to subtle
errors since the just built Clang will be using stale libc++ headers.
Furthermore, since the headers are copied prior to executing the build
system, this may hide missing dependencies on libc++ from other LLVM
components.

This changes replaces the use of file(COPY FILE...) command with a
custom command and target which addresses all aforementioned issues and
matches the implementation already used by other LLVM components that
also install headers like Clang builtin headers.

Differential Revision: https://reviews.llvm.org/D44773

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329544 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 04:23:04 +00:00
Petr Hosek
698b695147 [CMake] Copy the generated __config header into build directory
When the generated __config file is being used, it is currently only
copied during installation process. However, that means that the file
that gets copied into LLVM build directory is the vanilla __config file,
and any parts of the build that depend on the just built toolchain like
sanitizers will get that instead of the generated version. To avoid this
issue, we need to copy the generated header into the LLVM build
directory as well.

Differential Revision: https://reviews.llvm.org/D43797

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327194 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-10 01:20:11 +00:00
Don Hinton
1dfee5b4d4 LLVM_FOUND isn't always set, so just test if llvm_setup_rpath() is
available instead.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-27 18:55:30 +00:00
Don Hinton
44aacb7850 Reland: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

Differential Revision: https://reviews.llvm.org/D42459

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323492 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 01:34:51 +00:00
Don Hinton
e0c8dbec38 Revert [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
Shoaib Meenai pointed out this will break standalone builds when built without llvm.

Differential Revision: https://reviews.llvm.org/D42459

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323459 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-25 19:22:23 +00:00
Don Hinton
102b0a11f0 [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

Differential Revision: https://reviews.llvm.org/D42459

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323453 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-25 18:13:26 +00:00
Shoaib Meenai
cd9466e36f [libc++] Create install-stripped targets
LLVM is gaining install-*-stripped targets to perform stripped installs,
and in order for this to be useful for install-distribution, all
potential distribution components should have stripped installation
targets. LLVM has a function to create these install targets, but since
we can't use LLVM CMake functions in libc++, let's do it manually.

Differential Revision: https://reviews.llvm.org/D40680

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319959 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 21:03:42 +00:00