Commit Graph

433 Commits

Author SHA1 Message Date
Jonas Devlieghere
f6ce39cf1d
[lldb] Remove tools copied into LLDB.framework before install
CMake supports building Framework bundles for Apple platforms. We rely
on this functionality to create LLDB.framework. From CMake's
perspective, a framework is associated with a single target. In reality,
this is often not the case. In addition to a main library (liblldb) the
frameworks often contains associated resources that are their own CMake
targets, such as debugserver and lldb-argdumper.

When building and using the framework to run the test suite, those
binaries are expected to be in LLDB.framework. We have a function
(lldb_add_to_buildtree_lldb_framework) that copies those targets into
the framework.

When CMake installs a framework, it copies over the content of the
framework directory and "installs" the associated target. In addition to
copying the target, installing also means updating the RPATH. However,
the RPATH is only updated for the target associated with the framework.
Everything else is naively copied over, including executables or
libraries that have a different build and install RPATH. This means that
those tools need to have their own install rules.

If the framework is installed first, the aforementioned tools are copied
over with build RPATHs from the build tree. And when the tools
themselves are installed, the binaries get overwritten and the RPATHs
updated to the install RPATHs.

The problem is that CMake provides no guarantees when it comes to the
order in which components get installed. If those tools get installed
first, the inverse happens and the binaries get overwritten with the
ones that have build RPATHs.

lldb_add_to_buildtree_lldb_framework has a comment correctly stating
that those copied binaries should be removed before install. This patch
adds a custom target (lldb-framework-cleanup) that will be run before
the install phase and remove those files from LLDB.framework in the
build tree.

Differential revision: https://reviews.llvm.org/D141021
2023-01-10 11:22:47 -08:00
Jonas Devlieghere
b5467ecc0f
[lldb] Use LLDB_ENABLE_SWIG as the canonical CMake variable
Use LLDB_ENABLE_SWIG instead of SWIG_EXECUTABLE or SWIG_FOUND as the
canonical CMake variable to determine whether we have SWIG available in
LLDB. This is a follow-up to b3c978e850.
2022-11-30 12:46:13 -08:00
Jonas Devlieghere
b3c978e850
[lldb] Make SWIG an auto-detected dependency
This patch makes SWIG itself an auto-detected dependency. This allows us
to look for SWIG once in a centralized place and makes it easier
downstream to detect whether to use the static bindings.

Differential revision: https://reviews.llvm.org/D138879
2022-11-29 09:07:11 -08:00
Alex Langford
58d38b3ff8 [lldb] Restore default setting of LLDB_INCLUDE_TESTS in standalone builds
In 52f39853ab the option LLDB_INCLUDE_TESTS was
moved above the inclusion of LLDBStandalone. This isn't a problem per-se, but
it changes the default value of LLDB_INCLUDE_TESTS in standalone builds.
LLDBStandalone explicitly sets LLVM_INCLUDE_TESTS to true, indicating that
for standalone builds this is considered the default behavior.
This patch restores said default behavior.

Differential Revision: https://reviews.llvm.org/D138237
2022-11-18 09:05:08 -08:00
Jim Ingham
0ec24e1f95 Only use major version in the clang resource directory for standalone builds.
Commit e1b88c8a09 changed the name of the clang resource directory so that
it was "lib/clang/<MajorVersion>" but missed the place in the LLDB standalone
build where we search for the resource directory.  That was still looking for
<Major>.<Minor>.<Patch>.  The standalone lldb bot has been failing since this
commit.
2022-11-16 16:00:26 -08:00
Michał Górny
c899b243f6 [lldb] [cmake] Fix another typo in third-party/unittest path 2022-11-12 10:35:19 +01:00
Michał Górny
2d2854c7d5 [lldb] [cmake] Fix typo in unittest directory path
Fix a typo in a11cd0d94e that resulted
in additional "}" in unittest directory path, e.g.:

    CMake Error at cmake/modules/LLDBStandalone.cmake:104 (add_subdirectory):
      add_subdirectory given source
      "/var/tmp/portage/dev-util/lldb-16.0.0_pre20221111/work/lldb/../third-party}/utils/unittest"
      which is not an existing directory.
    Call Stack (most recent call first):
      CMakeLists.txt:29 (include)
2022-11-11 20:40:37 +01:00
Tom Stellard
a11cd0d94e Move googletest to the third-party directory
Rre-commit of 59052468c3 with a typo
fix in compiler-rt/CMakeLists.txt
2022-11-09 15:28:08 -08:00
Tom Stellard
8a084f68c8 Revert "Move googletest to the third-party directory"
This reverts commit 59052468c3.

It looks like this patch breaks the build when compiler-rt is passed to
LLVM_ENABLE_PROJECTS instead of LLVM_ENABLE_RUNTIMES.
2022-11-09 11:34:59 -08:00
Tom Stellard
59052468c3 Move googletest to the third-party directory
This will help improve the project's layering, so that sub-projects
that don't actually need any llvm code can still use googletest
without having to reference code in the llvm directory.

This will also make it easier to consolidate and simplify the standalone
build configurations.

Reviewed By: stellaraccident, lattner, probinson, phosek

Differential Revision: https://reviews.llvm.org/D131919
2022-11-09 11:10:26 -08:00
Michał Górny
9dd01a5241 Harmonize cmake_policy() across standalone builds of all projects
Move `cmake_policy()` settings from `llvm/CMakeLists.txt` into a shared
`cmake/modules/CMakePolicy.cmake`.  Include it from all relevant
projects that support standalone builds, in order to ensure that
the policies are consistently set whether they are built in-tree
or stand-alone.

Differential Revision: https://reviews.llvm.org/D136572
2022-10-28 08:46:48 +02:00
Michał Górny
687e5bccf8 Revert "Harmonize cmake_policy() across standalone builds of all projects"
This reverts commit 88d7508dc4.
It's reported to break builds when symlinking other projects inside
the `tools` directory.
2022-10-27 14:30:44 +02:00
Michał Górny
88d7508dc4 Harmonize cmake_policy() across standalone builds of all projects
Move `cmake_policy()` settings from `llvm/CMakeLists.txt` into a shared
`cmake/modules/CMakePolicy.cmake`.  Include it from all relevant
projects that support standalone builds, in order to ensure that
the policies are consistently set whether they are built in-tree
or stand-alone.

Differential Revision: https://reviews.llvm.org/D136572
2022-10-27 13:46:56 +02:00
Michał Górny
52f39853ab [lldb] Include gtest in standalone build only if LLDB_INCLUDE_TESTS
Build gtest targets when building standalone only if LLDB_INCLUDE_TESTS
is true.  Prior to this change, they were built whenever
LLVM_MAIN_SRC_DIR was available, independently whether tests themselves
would be run.

Differential Revision: https://reviews.llvm.org/D136551
2022-10-24 15:51:43 +02:00
Michał Górny
d15239388c [lldb] Add LLVM include dirs prior to gtest target in standalone build
Move include_directories() declaration before gtest targets are created
in standalone build.  This fixes build failure due to gtest targets
being unable to find LLVM headers, e.g.:

    /var/tmp/portage/dev-util/lldb-16.0.0_pre20221023/work/llvm/utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h:43:10: fatal error: llvm/ADT/Optional.h: No such file or directory

Differential Revision: https://reviews.llvm.org/D136552
2022-10-24 12:18:14 +02:00
Jonas Devlieghere
01470b68f3
[lldb] Fix hard-coded argument to set_target_properties
The call to `set_target_properties` should use the target passed to
`add_lldb_library` instead of a hard-coded value. Upstream `liblldb` is
the only target for which this matters, but downstream we have
LLDBRPC.framework which needs this as well.
2022-10-06 11:43:52 -07:00
John Ericson
3a1c81e327 [CMake] Avoid LLVM_BINARY_DIR when other more specific variable are better-suited, part 2
A simple sed doing these substitutions:

- `${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}\>` -> `${LLVM_LIBRARY_DIR}`
- `${LLVM_BINARY_DIR}/bin\>` -> `${LLVM_TOOLS_BINARY_DIR}`

where `\>` means "word boundary".

The only manual modifications were reverting changes in

- `runtimes/CMakeLists.txt`

because these were "entry points" where we wanted to tread carefully not not introduce a "loop" which would end with an undefined variable being expanded to nothing.

There are some `${LLVM_BINARY_DIR}/lib` without the `${LLVM_LIBDIR_SUFFIX}`, but these refer to the lib subdirectory of the source (`llvm/lib`). That `lib` is automatically appended to make the local `CMAKE_CURRENT_BINARY_DIR` value by `add_subdirectory`; since the directory name in the source tree is fixed without any suffix, the corresponding `CMAKE_CURRENT_BINARY_DIR` will also be. We therefore do not replace it but leave it as-is.

This picks up where D133828 left off, getting the occurrences with*out* `CMAKE_CFG_INTDIR`. But this is difficult to do correctly and so not done in the (retroactively) previous diff.

This hopefully increases readability overall, and also decreases the usages of `LLVM_LIBDIR_SUFFIX`, preparing us for D130586.

Reviewed By: sebastian-ne

Differential Revision: https://reviews.llvm.org/D132316
2022-09-14 15:48:58 -04:00
John Ericson
34fe6ddce1 Revert "[CMake] Avoid LLVM_BINARY_DIR when other more specific variable are better-suited"
This reverts commit ad8c34bc30.
2022-08-25 11:13:46 -04:00
John Ericson
ad8c34bc30 [CMake] Avoid LLVM_BINARY_DIR when other more specific variable are better-suited
A simple sed doing these substitutions:

- `${LLVM_BINARY_DIR}/(\$\{CMAKE_CFG_INTDIR}/)?lib(${LLVM_LIBDIR_SUFFIX})?\>` -> `${LLVM_LIBRARY_DIR}`
- `${LLVM_BINARY_DIR}/(\$\{CMAKE_CFG_INTDIR}/)?bin\>` -> `${LLVM_TOOLS_BINARY_DIR}`

where `\>` means "word boundary".

The only manual modifications were reverting changes in

- `compiler-rt/cmake/Modules/CompilerRTUtils.cmake
- `runtimes/CMakeLists.txt`

because these were "entry points" where we wanted to tread carefully not not introduce a "loop" which would end with an undefined variable being expanded to nothing.

This hopefully increases readability overall, and also decreases the usages of `LLVM_LIBDIR_SUFFIX`, preparing us for D130586.

Reviewed By: sebastian-ne

Differential Revision: https://reviews.llvm.org/D132316
2022-08-24 10:14:05 -04:00
John Ericson
3adda398ce [clang][lldb][cmake] Use new *_INSTALL_LIBDIR_BASENAME CPP macro
Use this instead of `*_LIBDIR_SUFFIX`, from which it is computed.

This gets us ready for D130586, in which `*_LIBDIR_SUFFIX` is
deprecated.

Differential Revision: https://reviews.llvm.org/D132300
2022-08-20 12:52:21 -04:00
John Ericson
e941b031d3 Revert "[cmake] Use CMAKE_INSTALL_LIBDIR too"
This reverts commit f7a33090a9.

Unfortunately this causes a number of failures that didn't show up in my
local build.
2022-08-18 22:46:32 -04:00
John Ericson
f7a33090a9 [cmake] Use CMAKE_INSTALL_LIBDIR too
We held off on this before as `LLVM_LIBDIR_SUFFIX` conflicted with it.
Now we return this.

`LLVM_LIBDIR_SUFFIX` is kept as a deprecated way to set
`CMAKE_INSTALL_LIBDIR`. The other `*_LIBDIR_SUFFIX` are just removed
entirely.

I imagine this is too potentially-breaking to make LLVM 15. That's fine.
I have a more minimal version of this in the disto (NixOS) patches for
LLVM 15 (like previous versions). This more expansive version I will
test harder after the release is cut.

Reviewed By: sebastian-ne, ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D130586
2022-08-18 15:33:35 -04:00
Tom Stellard
9c6c4d675b lldb: Disable unittests if llvm_gtest target does not exist
This fixes the stand-alone build configuration where LLVM_MAIN_SRC_DIR
does not exist.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D124314
2022-08-10 16:56:08 -07:00
Jonas Devlieghere
f179f403c8
[lldb] Disable modules in Apple-lldb-base
The LLDB website recommends using the CMake caches to build on macOS.
Although modules result in a faster build, this configuration tends to
break occasionally because it's specific to our platform. I don't expect
newcomers to be able to deal with those kind of breakages so don't
enable them by default.
2022-05-24 17:17:14 -07:00
Tobias Ribizel
b1aed14bfe [llvm][lldb] use FindLibEdit.cmake everywhere
Currently, LLVM's LineEditor and LLDB both use libedit, but find them in different (inconsistent) ways.
This causes issues e.g. when you are using a locally installed version of libedit, which will not be used
by clang-query, but by lldb if picked up by FindLibEdit.cmake

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D124673
2022-05-12 15:59:41 -07:00
Martin Storsjö
5560b9e884 [lldb] [CMake] Disable GCC's -Wstringop-truncation warning. NFC.
This warning gives false positives about lldb's correct use of
strncpy to fill fixed length fields that don't need null termination,
in lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp, like this:

    In file included from /usr/include/string.h:495,
                     from /usr/include/c++/9/cstring:42,
                     from ../include/llvm/ADT/StringRef.h:19,
                     from ../tools/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:10:
    In function ‘char* strncpy(char*, const char*, size_t)’,
        inlined from ‘lldb::offset_t CreateAllImageInfosPayload(const ProcessSP&, lldb::offset_t, lldb_private::StreamString&, lldb::SaveCoreStyle)’ at ../tools/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:6341:16:
    /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 16 equals destination size [-Wstringop-truncation]
      106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

The warning could be squelched locally with

    #pragma GCC diagnostic ignored "-Wstringop-truncation"

too, but Clang also interprets those GCC pragmas, and produces
a -Wunknown-warning-option warning instead. That could be remedied
by wrapping the pragma in an "#ifndef __clang__" - but that makes
things even more messy. Instead, just silence this warning entirely.

Differential Revision: https://reviews.llvm.org/D123254
2022-04-07 12:09:01 +03:00
Martin Storsjö
e546bbfda0 [lldb] Fix detecting warning options for GCC
If testing for a warning option like -Wno-<foo> with GCC, GCC won't
print any diagnostic at all, leading to the options being accepted
incorrectly. However later, if compiling a file that actually prints
another warning, GCC will also print warnings about these -Wno-<foo>
options being unrecognized.

This avoids warning spam like this, for every lldb source file that
produces build warnings with GCC:

    At global scope:
    cc1plus: warning: unrecognized command line option ‘-Wno-vla-extension’
    cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-register’

This matches how such warning options are detected and added in
llvm/cmake/modules/HandleLLVMOptions.cmake, e.g. like this:

    check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
    append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS)

Differential Revision: https://reviews.llvm.org/D123202
2022-04-06 22:50:07 +03:00
Pavel Labath
6c99a3469d [lldb] Add support for a "global" lldbinit file
This patch adds introduces a new kind of an lldbinit file. Unlike the
lldbinit in the home directory (useful for customizing lldb to the needs
of a particular user), or the cwd lldbinit file (useful for
project-specific settings), this file can be used to customize an entire
lldb installation to a particular environment.

The feature is enabled at build time, by setting the
LLDB_GLOBAL_INIT_DIRECTORY variable to a path to a directory which
should contain an "lldbinit" file. Lldb will then load the file at
startup, if it exists, and if automatic init loading has not been
disabled. Relative paths will be resolved (at runtime) relative to the
location of the lldb library (liblldb or LLDB.framework).

The system-wide lldbinit file will be loaded first, before any
$HOME/.lldbinit and $CWD/.lldbinit files are processed, so that those
can override any system-wide settings.

More information can be found on the RFC thread at
<https://discourse.llvm.org/t/rfc-system-wide-lldbinit/59933>.

Differential Revision: https://reviews.llvm.org/D119831
2022-02-18 12:30:22 +01:00
John Ericson
df31ff1b29 [cmake] Make include(GNUInstallDirs) always below project(..)
Its defaulting logic must go after `project(..)` to work correctly,  but `project(..)` is often in a standalone condition making this
awkward, since the rest of the condition code may also need GNUInstallDirs.

The good thing is there are the various standalone booleans, which I had missed before. This makes splitting the conditional blocks less awkward.

Reviewed By: arichardson, phosek, beanz, ldionne, #libunwind, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D117639
2022-01-20 18:59:17 +00:00
John Ericson
9531146899 [lldb] Use GNUInstallDirs to support custom installation dirs.
Extracted from D99484. My new plan is to start from the outside and work
inward.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D115570
2021-12-22 00:28:53 +00:00
Michał Górny
209ec8e2ee [lldb] Silence CMake warnings about missing FindFBSDVMCore
Pass QUIET to find_package() in order to quiet the warning about missing
FindFBSDVMCore.cmake.  FBSDVMCore always provides native CMake config
files, therefore providing a fallback module serves no purpose.

Differential Revision: https://reviews.llvm.org/D115882
2021-12-16 18:01:51 +01:00
Michał Górny
9c7fbc3f9b [lldb] Introduce a FreeBSDKernel plugin for vmcores
Introduce a FreeBSDKernel plugin that provides the ability to read
FreeBSD kernel core dumps.  The plugin utilizes libfbsdvmcore to provide
support for both "full memory dump" and minidump formats across variety
of architectures supported by FreeBSD.  It provides the ability to read
kernel memory, as well as the crashed thread status with registers
on arm64, i386 and x86_64.

Differential Revision: https://reviews.llvm.org/D114911
2021-12-14 22:07:20 +01:00
Michał Górny
76c876e7e6 Revert "[lldb] Introduce a FreeBSDKernel plugin for vmcores"
This reverts commit aedb328a4d.
I have failed to make the new tests conditional to the presence
of libfbsdvmcore.
2021-12-14 18:17:54 +01:00
Michał Górny
aedb328a4d [lldb] Introduce a FreeBSDKernel plugin for vmcores
Introduce a FreeBSDKernel plugin that provides the ability to read
FreeBSD kernel core dumps.  The plugin utilizes libfbsdvmcore to provide
support for both "full memory dump" and minidump formats across variety
of architectures supported by FreeBSD.  It provides the ability to read
kernel memory, as well as the crashed thread status with registers
on arm64, i386 and x86_64.

Differential Revision: https://reviews.llvm.org/D114911
2021-12-14 18:03:38 +01:00
John Ericson
ddcc02dbcc Quote some more destination paths with variables
Just defensive CMake-ing. I pulled this from D115544 and D99484 which
are blocked on some lldb CI failures I don't yet understand. Hoping to land
something smaller in the meantime.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D115566
2021-12-13 17:29:08 +00:00
Med Ismail Bennani
30fc88bf1d Revert "Revert "Revert "Use GNUInstallDirs to support custom installation dirs. -- LLVM"""
This reverts commit 492de35df4.

I tried to apply John's changes in 8d897ec915 that were expected to
fix his patch but that didn't work unfortunately.

Reverting this again to fix the macOS bots and leave him more time to
investigate the issue.
2021-12-10 17:33:54 -08:00
John Ericson
492de35df4 Revert "Revert "Use GNUInstallDirs to support custom installation dirs. -- LLVM""
This reverts commit 797b50d4be.

See the original D99484. @mib who noticed the original problem could not longer
reproduce it, after I tried and also failed. We are threfore hoping it went
away on its own!

Reviewed By: mib

Differential Revision: https://reviews.llvm.org/D115544
2021-12-10 20:59:43 +00:00
Med Ismail Bennani
797b50d4be Revert "Use GNUInstallDirs to support custom installation dirs. -- LLVM"
This reverts commit 6fd2db04d0 since it
broke GreenDragon LLDB-Incremental bot:

https://green.lab.llvm.org/green/job/lldb-cmake/37560/console

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2021-11-02 19:11:44 +01:00
John Ericson
6fd2db04d0 Use GNUInstallDirs to support custom installation dirs. -- LLVM
This is a new draft of D28234. I previously did the unorthodox thing of
pushing to it when I wasn't the original author, but since this version

- Uses `GNUInstallDirs`, rather than mimics it, as the original author
  was hesitant to do but others requested.

- Is much broader, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I am using this patch (and many back-ports) as the basis of
https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS). It
looked like people were generally on board in D28234, but I make note of
this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM
already has some partial support for these sorts of things. For example
`LLVM_LIBDIR_SUFFIX`, or `COMPILER_RT_INSTALL_PATH`. Because it's not
quite clear yet what to do about those, we are holding off on changing
libdirs and `compiler-rt`. for this initial PR.

---

On the advice of @lebedev.ri, I am splitting this up a bit per
subproject, starting with LLVM. To allow it to be more easily reviewed. This and the subsequent patch must be landed together, as this will not build alone. But the rest can be landed on their own.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D100810
2021-11-02 10:23:30 -04:00
Dave Lee
65dae8b2f2 [lldb] Configure CMake policy CMP0116 for standalone builds
Using CMake >=3.20 results in many warnings about this new policy. This change silences the warnings by explicitly declaring use of the "OLD" behavior.

This applies D101083 to LLDBStandalone.cmake.

Differential Revision: https://reviews.llvm.org/D112497
2021-10-25 16:29:36 -07:00
Siger Yang
6de63b3ba5 [lldb/lua] Force Lua version to be 5.3
Due to CMake cache, find_package in FindLuaAndSwig.cmake
will be ignored. This commit adds EXACT and REQUIRED flags
to it and removes find_package in Lua ScriptInterpreter.

Signed-off-by: Siger Yang <sigeryeung@gmail.com>

Reviewed By: tammela, JDevlieghere

Differential Revision: https://reviews.llvm.org/D108515
2021-10-12 21:34:15 +08:00
Alfonso Gregory
a2c319fdc6 [LLVM][CMake][NFC] Resolve FIXME: Rename LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project
This way, we do not need to set LLVM_CMAKE_PATH to LLVM_CMAKE_DIR when (NOT LLVM_CONFIG_FOUND)

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D107717
2021-09-16 18:29:57 +02:00
Siger Yang
49229bb92b Revert "[lldb/lua] Force Lua version to be 5.3"
This commit causes buildbot failures if SWIG is available but Lua is
not present.

This reverts commit 7bb42dc6b1.
2021-09-03 17:31:25 +08:00
Siger Yang
7bb42dc6b1 [lldb/lua] Force Lua version to be 5.3
Due to CMake cache, find_package in FindLuaAndSwig.cmake
will be ignored. This commit adds EXACT and REQUIRED flags
to it and removes find_package in Lua ScriptInterpreter.

Signed-off-by: Siger Yang <sigeryeung@gmail.com>

Reviewed By: tammela, JDevlieghere

Differential Revision: https://reviews.llvm.org/D108515
2021-09-03 15:22:57 +08:00
Michał Górny
614c7d0387 [lldb] [cmake] Add LLVM_LIT_ARGS override support for standalone builds
Add a LLVM_LIT_ARGS cached variable in order to make it possible
to override lit arguments when doing standalone builds.  Without that,
the user variable is ignored and the default options are always used.

Based on a similar solution found in clang.

Differential Revision: https://reviews.llvm.org/D107700
2021-08-09 23:36:01 +02:00
Neal Sidhwaney
55fd6f292f Revert "D106035: Remove conditional compilation for WCHAR support in libedit"
This reverts commit 7529f0e3e1.
2021-08-05 02:55:10 -07:00
Neal Sidhwaney
7529f0e3e1 D106035: Remove conditional compilation for WCHAR support in libedit
This change moves to using narrow character types and libedit APIs in
Editline, because those are the same types that the rest of LLVM/LLDB
uses, and it's generally considered better practice to use UTF-8
encoded in char than it is to use wider characters. However, for
character input, the change leaves in using a wchar to enable input of
multi-byte characters.

Differential Revision: https://reviews.llvm.org/D106035
2021-08-05 00:29:54 -07:00
Nico Weber
bf3383501f [lldb] Get rid of HAVE_SYS_TYPES_H
LLVM includes this header unconditionally on all platforms
(including Windows), so this define should no longer be necessary.

No behavior change.

Differential Revision: https://reviews.llvm.org/D107338
2021-08-03 22:14:56 +02:00
Nico Weber
82dc463bb3 [lldb] Get rid of HAVE_SIGACTION
The .cpp file uses SIGNAL_POLLING_UNSUPPORTED to guard the call
to sigaction, so use it in the .h file too. (LLVM also calls
sigaction without a guard on non-Windows.)

No behavior change.

Differential Revision: https://reviews.llvm.org/D107255
2021-08-02 20:11:35 +02:00
Richard Howell
969eefd98e [lldb] add LLDB_SKIP_DSYM option
Add an option to skip generating a dSYM when installing the LLDB framework on Darwin.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D103124
2021-05-26 09:32:59 -07:00