1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

1813 Commits

Author SHA1 Message Date
Oliver Stannard
260194e7a2 Revert "[CMake][ELF] Add -fno-semantic-interposition and -Bsymbolic-functions"
This reverts commit 3bf1acab5b454ad7fb2074b34663108b53620695.

This is causing the test `gcov-shared-flush.c' to fail on the 2-stage
aarch64 buildbots (https://lab.llvm.org/buildbot/#/builders/7/builds/2720).
2021-05-13 14:31:17 +01:00
Shoaib Meenai
7cc79975c6 [cmake] Fix typo in function name
Not sure how my local testing didn't trigger this path. Should fix
https://lab.llvm.org/buildbot/#/builders/132/builds/5494
2021-05-12 12:14:52 -07:00
Shoaib Meenai
011d3c9d37 [cmake] Add support for multiple distributions
LLVM's build system contains support for configuring a distribution, but
it can often be useful to be able to configure multiple distributions
(e.g. if you want separate distributions for the tools and the
libraries). Add this support to the build system, along with
documentation and usage examples.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D89177
2021-05-12 11:13:18 -07:00
Fangrui Song
686fd925f4 [CMake][ELF] Add -fno-semantic-interposition and -Bsymbolic-functions
llvm-dev message: https://lists.llvm.org/pipermail/llvm-dev/2021-May/150465.html

In an ELF shared object, a default visibility defined symbol is preemptible by default.
This creates some missed optimization opportunities. -fno-semantic-interposition can optimize -fPIC:

* in Clang: avoid GOT/PLT cost for variable access/function calls to external linkage definition in the same TU
* in GCC: enable interprocedural optimizations (including inlining) and avoid PLT

See https://gist.github.com/MaskRay/2d4dfcfc897341163f734afb59f689c6 for more information.

-Bsymbolic-functions is more aggressive than -fvisibility-inlines-hidden (present since 2012) as it applies
to all function definitions.  It can

* avoid PLT for cross-TU function calls && reduce dynamic symbol lookup
* reduce dynamic symbol lookup for taking function addresses and optimize out GOT/TOC on x86-64/ppc64

With both options, the libLLVM.so and libclang-cpp.so performance should
be closer to PIE binary linking against `libLLVM*.a` and `libclang*.a`

(In a -DLLVM_TARGETS_TO_BUILD=X86 build, the number of JUMP_SLOT decreases from 12716 to 1628, and the number of GLOB_DAT decreases from 1918 to 1313
The built clang with `-DLLVM_LINK_LLVM_DYLIB=on -DCLANG_LINK_CLANG_DYLIB=on` is significantly faster.
See the Linux kernel build result https://bugs.archlinux.org/task/70697
)

Some implication:

Interposing a subset of functions is no longer supported.
(This is fragile anyway and cannot really be supported. For Mach-O we don't use
`ld -interpose`, so interposition is not supported on Mach-O at all.)

Compiling a program which takes the address of any LLVM function with
`{gcc,clang} -fno-pic` and expects the address to equal to the address taken
from libLLVM.so or libclang-cpp.so is unsupported. I am fairly confident that
llvm-project shouldn't have different behaviors depending on such pointer
equality (as we've been using -fvisibility-inlines-hidden which applies to
inline functions for a long time), but if we accidentally do, users should be
aware that they should not make assumption on pointer equality in `-fno-pic`
mode.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D102090
2021-05-12 10:34:31 -07:00
Dave Lee
0afed2f182 [cmake] Enable -Wmisleading-indentation
Enable `-Wmisleading-indentation` to balance with the LLVM style of optional parentheses.

Differential Revision: https://reviews.llvm.org/D102092
2021-05-10 09:56:04 -07:00
Martin Storsjö
eff58ba276 [cmake] Use -ffunction-sections and -Wl,--gc-sections on MinGW targets
If compiling with GCC or linking with ld.bfd, these options have little
effect, but if built with Clang and linked with LLD, they provide a
quite notable size decrease - this shrinks an entire llvm-mingw
distribution package by 22%.

If building with BUILD_SHARED_LIBS or LLVM_BUILD_LLVM_DYLIB with LLD,
this requires a version of LLD that contains a fix for auto exporting
symbols from comdats, 2b01a417d7ccb001ccc1185ef5fdc967c9fac8d7.

Differential Revision: https://reviews.llvm.org/D101568
2021-04-30 10:53:40 +03:00
Jim Radford
ba54030614 [CMake][llvm] add missing include to LLVMCheckLinkerFlag
Differential Revision: https://reviews.llvm.org/D101417
2021-04-27 18:48:52 -07:00
Jim Radford
8377f04809 [CMake][llvm] avoid conflict w/ (and use when available) new builtin check_linker_flag
Match the API for the new check_linker_flag and use it directly when
available, leaving the old code as a fallback.

Differential Revision: https://reviews.llvm.org/D100901
2021-04-27 16:41:28 -07:00
Hubert Tong
900a840929 [AIX] Avoid use of mtim.tv_nsec member of stat structure on AIX
The value observed for the `mtim.tv_nsec` member is erroneous in some
AIX environments. Avoid using this member by forcing
`HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC` to `0`.

This resolves "mtime changed" errors such as the one
http://lab.llvm.org:8014/#/builders/126/builds/330/steps/5/logs/FAIL__Clang__test_c
has.

Reviewed By: daltenty, jsji

Differential Revision: https://reviews.llvm.org/D101323
2021-04-26 18:30:13 -04:00
Jim Radford
59805704ed [CMake][llvm] avoid changing global flags (may be used outside of llvm)
Changing global flags can break builds of projects that include/build
llvm as a sub-project, as the effect is global. Ideally we would
disable this warning at the directory level instead, but the obvious
way (disabling warning D9025) isn't supported. At least we can limit
the effect to only MSVC.

Patch by Jim Radford.

Differential Revision: https://reviews.llvm.org/D100900
2021-04-20 16:06:25 -07:00
Mircea Trofin
e3f85d297f [mlgo] Skip AOT-compiling a model if a header/object pair is provided
This allows one to cross-compile the header/object for a model in a
setup where the compiler is built on a system that cannot host the AOT
compiler. For example, if arm-hostable clang is desired, while the AOT
Tensorflow compiler can cross-compile to arm, it can't currently run on
arm.

The only alternative in that scenario would be to cross-compile clang
itself, but that gets complicated when trying to run tests after that.

Differential Revision: https://reviews.llvm.org/D99992
2021-04-13 09:46:29 -07:00
Kirill Bobyrev
f1dff186b8 [CMake] try creating symlink first on windows
//-E create_symlink//  is available on windows since CMake 3.13 (LLVM now uses 3.13.4)
It may needs administrator privileges or enabled developer mode (Windows 10)
See https://cmake.org/cmake/help/latest/release/3.13.html

Reviewed By: kbobyrev

Differential Revision: https://reviews.llvm.org/D99170
2021-04-07 11:23:10 +02:00
Tom Stellard
c476e3c118 Revert "llvm-shlib: Create object libraries for each component and link against them"
This reverts commit 43ceb74eb1a5801662419fb66a6bf0d5414f1ec5.

This caused some build failures: https://bugs.llvm.org/show_bug.cgi?id=49818
2021-04-05 10:46:19 -07:00
Tom Stellard
26663577f0 llvm-shlib: Create object libraries for each component and link against them
This makes it possible to build libLLVM.so without first creating a
static library for each component.  In the case where only libLLVM.so is
built (i.e. ninja LLVM) this eliminates 150 linker jobs.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D95727
2021-04-01 14:58:44 -07:00
Petr Hosek
a856b70a96 Revert "[CMake] Use write_basic_package_version_file for LLVM"
This reverts commit 3001d080c813da20b329303bf8f45451480e5905 which
seems to have introduced a race condition that's failing the build
in some cases.
2021-03-29 13:07:39 -07:00
Alex Reinking
e8bc4b3fec [CMake] Use write_basic_package_version_file for LLVM
Use the CMake 3.13 features of CMakeConfigPackageHelpers to generate
LLVMConfigVersion.cmake with proper architecture detection, major+minor
version matching, etc.

Differential Revision: https://reviews.llvm.org/D99451
2021-03-27 21:02:20 +00:00
Aleksandr Platonov
64d851e46c [CMake][gRPC] Fix a typo in protobuf version variable name
Without this patch CMake log contains `Using protobuf` instead of `Using protobuf <version>`.

Reviewed By: kbobyrev

Differential Revision: https://reviews.llvm.org/D99405
2021-03-26 19:33:06 +03:00
Vladislav Vinogradov
c7fbf3b5e8 [CMAKE] Fix cross-compilation build
Call `get_errc_messages` only if `LLVM_INCLUDE_TESTS` was set.

Reviewed By: zero9178, abhina.sreeskantharajan, jhenderson

Differential Revision: https://reviews.llvm.org/D98861
2021-03-23 13:24:08 +03:00
Martin Storsjö
489faf0333 [cmake] Disable GCC 9's -Wpessimizing-move
Similar to the existing code for disabling GCC's -Wredudant-move,
also check for the -Wpessimizing-move option and disable it if
possible.

This silences another bunch of noisy warnings when building LLVM
with GCC 9.

As noted for -Wredundant-move, the code can't be fixed to silence the
warnings while retaining support for older compilers.

Differential Revision: https://reviews.llvm.org/D98942
2021-03-22 15:14:46 +02:00
Jinsong Ji
7a834ebbd0 [AIX] Update rpath for BUILD_SHARED_LIBS
BUILD_SHARED_LIBS build llvm component as shared library,
which can reduce the size a lot.

Normally, the binary use ORIGIN../lib to load component libraries,
unfortunatly, ORIGIN is not supported by AIX ld.

We hardcoded the build lib and install lib path in rpath for now
to enable BUILD_SHARED_LIBS build.

Understand that this is not perfect solution,
we can update this when we find better solution.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D98901
2021-03-20 20:31:43 +00:00
Martin Storsjö
4ac2184d3a [cmake] Enable Clang warnings about redundant semicolons
This matches what GCC warns about when -pedantic is enabled.

This should avoid such redundant semicolons creeping into the codebase.

Differential Revision: https://reviews.llvm.org/D98941
2021-03-19 18:49:05 +02:00
Markus Böck
23b462c030 [CMake] Use compiler-rt location instead of resource directory to find clang-cls runtime directory
The current cmake script attempts to add the path containing clangs various runtime systems by getting the resource directory and then appending the hardcoded value /lib/windows to it. This works for a normal clang-cl build but fails for a build of clang using LLVM_ENABLE_PER_TARGET_RUNTIME_DIR, such as the builds from llvm/runtimes.

This patch instead uses -print-libgcc-file-name in conjunction with --rtlib=compiler-rt, and instead adds the containing directory as library path.

For non per-target runtime directory builds, such as the release builds, there is no change. Even if the builtins library were to be deleted or moved it would output the same path as before.
For per-target runtime builds that also have the builtins library, this now finds the correct directory containing all of clang runtime libraries.

Only case still not handled by this change, is if a per-target runtime directory build is used, but the builtins library was not built.
I believe that is the best we can do for now however, without modifying clang.

Differential Revision: https://reviews.llvm.org/D98786
2021-03-18 09:24:49 +01:00
Markus Böck
1a004a81cb [test] Make sure the test program in GetErrcMessages.cmake exits normally.
If for some reason the test program does not exit normally it'd currently lead to a false positive and it's stdout output being assigned to the output variable.

Instead, check the test program exited normally before assigning the process output to the out variable.

Follow up on rGaf2796c76d2ff4b73165ed47959afd35a769beee
Fixes an issue discovered post commit in https://reviews.llvm.org/D98278
2021-03-16 12:22:40 +01:00
Markus Böck
848f365839 [test][NFC] Minor formatting and comment adjustments in GetErrcMessages.cmake
These changes address post-commit review comments discussed in https://reviews.llvm.org/D98278
2021-03-16 11:08:57 +01:00
Kirill Bobyrev
da5206f100 [clangd] Optionally add reflection for clangd-index-server
This was originally landed without the optional part and reverted later:

8080ea4c4b

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D98404
2021-03-15 21:07:25 +01:00
Markus Böck
1be4884f17 [test] Add ability to get error messages from CMake for errc substitution
Visual Studios implementation of the C++ Standard Library does not use strerror to produce a message for std::error_code unlike other standard libraries such as libstdc++ or libc++ that might be used.

This patch adds a cmake script that through running a C++ program gets the error messages for the POSIX error codes and passes them onto lit through an optional config parameter.

If the config parameter is not set, or getting the messages failed, due to say a cross compiling configuration without an emulator, it will fall back to using pythons strerror functions.

Differential Revision: https://reviews.llvm.org/D98278
2021-03-15 20:56:08 +01:00
Christopher Tetreault
909d35077f [CMake] Require python 3.6 if enabling LLVM test targets
The lit test suite uses python 3.6 features. Rather than a strange
python syntax error upon running the lit tests, we will require the
correct version in CMake.

Reviewed By: serge-sans-paille, yln

Differential Revision: https://reviews.llvm.org/D95635
2021-03-15 09:50:39 -07:00
Dave Lee
01ffce4e06 Revert "[cmake] Enable -Werror=return-type"
This reverts commit ce94a161651d0edd313d0fa65571eb53d3a34d13.
2021-03-10 14:47:08 -08:00
Kadir Cetinkaya
63824b39f0 Revert "[clangd] Enable reflection for clangd-index-server"
This reverts commit 8080ea4c4b8c456c72c617587cc32f174b3105c1.

As discussed offline we should only do that for debug builds.
2021-03-10 14:12:37 +01:00
Kirill Bobyrev
ae45d1cec4 [clangd] Enable reflection for clangd-index-server
This allows sending requests through CLI and more debugging
opportunities. Example:

```bash
$ grpc_cli ls localhost:50051
clang.clangd.remote.v1.SymbolIndex
grpc.reflection.v1alpha.ServerReflection
grpc.health.v1.Health
```
2021-03-10 09:07:39 +01:00
Dave Lee
e6ad3413ca [cmake] Enable -Werror=return-type
Turn `-Wreturn-type` into an error.

This is currently used by libcxx, libcxxabi, and libunwind, and would be a good default
for all of llvm. I'm not aware of any cases where this shouldn't be an error. This
ensures different build configs, merges, and downstream branches catch issues sooner.

Differential Revision: https://reviews.llvm.org/D98224
2021-03-09 13:51:09 -08:00
Min-Yih Hsu
269e3c32a0 [M68k](3/8) Skeleton and target description files
- Infrastructure for the target (i.e. build files, target triple etc.)
 - All of the target description TableGen file

Authors: myhsu, m4yers, glaubitz

Differential Revision: https://reviews.llvm.org/D88389
2021-03-08 12:30:57 -08:00
Raul Tambre
8f820ce4a5 [runtimes] Fix crosscompiling after a7cad6680b4087eff8994f1f99ac40c661a6621f (D97451)
It moved the logic for CMake target arguments into llvm_ExternalProject_Add().
No handling was added for CMAKE_CROSSCOMPILING, which has a separate set of compiler_args.
This broke crosscompiling, as now the runtimes builds defaulted to the compiler's default.

I've also added passing of CMAKE_ASM_COMPILER, which was missing before although we were passing the triple for it.

Reviewed By: zero9178

Differential Revision: https://reviews.llvm.org/D97855
2021-03-06 11:35:14 +02:00
Xiangling Liao
67363ad920 [CMake][AIX] Adjust plugin library extension used on AIX
As stated in the CMake manual, we are supposed to use MODULE rules to generate
plugin libraries:

"MODULE libraries are plugins that are not linked into other targets but may be
loaded dynamically at runtime using dlopen-like functionality"

Besides, LLVM's plugin infrastructure fits with the AIX treatment of .so
shared objects more than it fits with the AIX treatment of .a library archives
(which may contain shared objects).

Differential revision: https://reviews.llvm.org/D96282
2021-03-04 11:23:06 -05:00
Markus Böck
20787e83b0 [PR48898][CMake] Support MinGW Toolchain tool sin llvm_ExternalProject_Add
Windows is in the unique position of having two drivers, clang-cl and normal GNU clang, depending on whether a GNU or MSVC target is used. The current implementation with the USE_TOOLCHAIN argument assumes that when CMAKE_SYSTEM_NAME is set to Windows that clang-cl should be used, which is the incorrect choice when targeting a GNU environment.

This patch solves this problem by adding an optional TARGET_TRIPLE argument to llvm_ExternalProject_Add, which sets the various CMAKE_<LANG>_COMPILER_TARGET variables. Additionally, if the triple is detected as an MSVC environment, clang-cl and similar MSVC specific tools will be used instead of the GNU tools.
2021-03-02 22:45:05 +01:00
Arthur Eubanks
8a704d6525 [CMake] Don't optimize tests so much under ThinLTO
This drops check-llvm under -DLLVM_ENABLE_LTO=Thin from 13m to 10m20s on Windows and 20m to 15m35s on Linux.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D96618
2021-02-22 15:13:49 -08:00
Alex Hoppen
60a660675e [cmake] Move check for libproc to config-ix.cmake
As suggested by Nico in https://reviews.llvm.org/D96049, move check for libproc
from CMakeLists to config-ix.cmake

Reviewed By: thakis

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

Note: Also removes the CMAKE_REQUIRED_LIBRARIES which doesn't appear to
be necessary.
2021-02-18 10:54:27 +01:00
Nico Weber
a1fbabfd4c build: Add LLVM_WINSYSROOT to make setting /winsysroot easy on Win
Also add a script for sysroot management. For now, it can only create
fake sysroots that just symlink to local folders. This is useful for
testing.

Differential Revision: https://reviews.llvm.org/D96868
2021-02-17 10:27:25 -05:00
Mircea Trofin
c2ccde3171 [mlgo] Fetch models from path / URL
Allow custom location for pre-trained models used when AOT-compiling
policies.

Differential Revision: https://reviews.llvm.org/D96796
2021-02-16 22:47:14 -08:00
Stella Stamenova
51ae9734a2 Support multi-configuration generators correctly in several config files
Multi-configuration generators (such as Visual Studio and Xcode) allow the specification of a build flavor at build time instead of config time, so the lit configuration files need to support that - and they do for the most part. There are several places that had one of two issues (or both!):

1) Paths had %(build_mode)s set up, but then not configured, resulting in values that would not work correctly e.g. D:/llvm-build/%(build_mode)s/bin/dsymutil.exe
2) Paths did not have %(build_mode)s set up, but instead contained $(Configuration) (which is the value for Visual Studio at configuration time, for Xcode they would have had the equivalent) e.g. "D:/llvm-build/$(Configuration)/lib".

This seems to indicate that we still have a lot of fragility in the configurations, but also that a number of these paths are never used (at least on Windows) since the errors appear to have been there a while.

This patch fixes the configurations and it has been tested with Ninja and Visual Studio to generate the correct paths. We should consider removing some of these settings altogether.

Reviewed By: JDevlieghere, mehdi_amini

Differential Revision: https://reviews.llvm.org/D96427
2021-02-11 09:32:20 -08:00
Tom Stellard
3495902fa7 [CMake] Remove some dead code in llvm_install_library_symlink()
Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D95666
2021-02-10 10:13:04 -08:00
Ta-Wei Tu
ca74e6236d Fix deprecated usage of mallinfo
glibc deprecates `mallinfo` in the latest version of 2.33. This patch replaces the usage of `mallinfo` with the new `mallinfo2` when it's available.

Reviewed By: lattner

Differential Revision: https://reviews.llvm.org/D96359
2021-02-10 13:53:57 +08:00
Markus Böck
818751bb56 [CMake] [MinGW] Enable use of LLVM_USE_SANITIZER in a MinGW environment
Currently using LLVM_USE_SANITIZER with a MinGW target leads to a fatal
configuration error due to an unsupported platform. MinGW targets on
clang however implement a few sanitizers, currently ASAN and UBSAN.

This patch enables LLVM_USE_SANITIZER in a MinGW environment as well.

Differential Revision: https://reviews.llvm.org/D95750
2021-02-08 23:04:50 +02:00
Mehdi Amini
63a3fb08ab Fix CMake LLVM_TARGETS_TO_BUILD "Native" option to work with JIT
LLVM_TARGETS_TO_BUILD accepts both "host" or "Native" for auto-selecting
the target from the environment. However the way "Native" was plumbed
would lead to the JIT environment being disabled. This patch is making
"Native" works just as "host".

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D95837
2021-02-02 18:47:15 +00:00
Raphael Isemann
ef98e70100 Reland [lldb][docs] Use sphinx instead of epydoc to generate LLDB's Python reference
The build server should now have the missing dependencies.

Original summary:

Currently LLDB uses epydoc to generate the Python API reference for the website.
epydoc however is unmaintained since more than a decade and no longer works with
Python 3. Also whatever setup we had once for generating the documentation on
the website server no longer seems to work, so the current website documentation
has been stale since more than a year.

This patch replaces epydoc with sphinx and its automodapi plugin that can
generate Python API references. LLVM already uses sphinx for the rest of the
documentation, so this way we are more consistent with the rest of LLVM. The
only new dependency is the automodapi plugin for sphinx.

This patch effectively does the following things:
* Remove the epydoc code.
* Make a new dummy Python API page in our website that just calls the Sphinx
  command for generated the API documentation.
* Add a mock _lldb module that is only used when generating the Python API.
 This way we don't have to build all of LLDB to generate the API reference.

Some notes:
* The long list of skips is necessary due to boilerplate functions that SWIG
  is generating. Sadly automodapi is not really scriptable from what I can see,
  so we have to blacklist this stuff manually.
* The .gitignore change because automodapi wants a subfolder of our
  documentation directory to place generated documentation files there. The path
  is also what is used on the website, so we can't really workaround this
  (without copying the whole `docs` dir somewhere else when we build).
* We have to use environment variables to pass our build path to our sphinx
  configuration. Sphinx doesn't support passing variables onto that script.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94489
2021-01-17 12:13:01 +01:00
Raphael Isemann
79aa560add Revert "[lldb][docs] Use sphinx instead of epydoc to generate LLDB's Python reference"
This reverts commit bab121a1b66e85390cad019ec921febcba35519d. It seems the
docs buildbot doesn't have the required Python headers.
2021-01-15 14:07:45 +01:00
Raphael Isemann
b9583453c6 [lldb][docs] Use sphinx instead of epydoc to generate LLDB's Python reference
Currently LLDB uses epydoc to generate the Python API reference for the website.
epydoc however is unmaintained since more than a decade and no longer works with
Python 3. Also whatever setup we had once for generating the documentation on
the website server no longer seems to work, so the current website documentation
has been stale since more than a year.

This patch replaces epydoc with sphinx and its automodapi plugin that can
generate Python API references. LLVM already uses sphinx for the rest of the
documentation, so this way we are more consistent with the rest of LLVM. The
only new dependency is the automodapi plugin for sphinx.

This patch effectively does the following things:
* Remove the epydoc code.
* Make a new dummy Python API page in our website that just calls the Sphinx
  command for generated the API documentation.
* Add a mock _lldb module that is only used when generating the Python API.
 This way we don't have to build all of LLDB to generate the API reference.

Some notes:
* The long list of skips is necessary due to boilerplate functions that SWIG
  is generating. Sadly automodapi is not really scriptable from what I can see,
  so we have to blacklist this stuff manually.
* The .gitignore change because automodapi wants a subfolder of our
  documentation directory to place generated documentation files there. The path
  is also what is used on the website, so we can't really workaround this
  (without copying the whole `docs` dir somewhere else when we build).
* We have to use environment variables to pass our build path to our sphinx
  configuration. Sphinx doesn't support passing variables onto that script.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94489
2021-01-15 13:26:42 +01:00
Raul Tambre
6b1d01045f [CMake] Fix incorrect rpath for tests if LLVM_LOCAL_RPATH isn't set
d9ce31ae7d (D94322) removed the check because I thought it was dead
due to checking the existance of a variable (which always existed).

This causes LLDB tests to fail as they set NO_INSTALL_RPATH because
they're never meant to be installed, but we still would end up using
the install rpath.

Add the check back and make it explicitly check for an empty value
to make the purpose clearer and avoid implicit test for a false/true
value.

Differential Revision: https://reviews.llvm.org/D94326
2021-01-08 21:24:18 +02:00
Raul Tambre
103ca3f4a4 Re-land "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"
Reverted check for empty CMAKE_BUILD_RPATH fixed.

When `BUILD_WITH_INSTALL_RPATH` is enabled it prevents using a custom rpath only
for the build tree as the install rpath will be used. This makes it impossible to run a
runtimes build when compiling with Clang and wanting the installed rpath to be
empty (i.e. `-DCMAKE_BUILD_RPATH="<some path>" -DCMAKE_SKIP_INSTALL_RPATH=ON`).

Disable `BUILD_WITH_INSTALL_RPATH` when `CMAKE_BUILD_RPATH` is non-empty to
allow for such build scenarios.

Differential Revision: https://reviews.llvm.org/D94322
2021-01-08 20:26:08 +02:00
Raul Tambre
066963805a Revert "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"
This reverts commit 0ebc1fb29f278db0665423f15c53e6ee9601dddb.

The behaviour should have been the same as before unless specifying CMAKE_BUILD_RPATH,
which was previously broken.
However, this seems to have broken builds for some people that don't specify it.
Reverting until I can investigate.

Differential Revision: https://reviews.llvm.org/D94319
2021-01-08 19:59:20 +02:00