Skip to content

Commit b054716

Browse files
authored
Revert "[Support] Remove terminfo dependency (#92865)"
This reverts commit 6bf450c.
1 parent 6127f15 commit b054716

File tree

26 files changed

+218
-12
lines changed

26 files changed

+218
-12
lines changed

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set(LLVM_ENABLE_LLD ON CACHE BOOL "")
1919
set(LLVM_ENABLE_LTO ON CACHE BOOL "")
2020
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
2121
set(LLVM_ENABLE_PLUGINS OFF CACHE BOOL "")
22+
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
2223
set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
2324
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
2425
set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")

clang/cmake/caches/Fuchsia.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
1212
set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")
1313
set(LLVM_ENABLE_LIBXML2 OFF CACHE BOOL "")
1414
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
15+
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
1516
set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
1617
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
1718
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
@@ -33,6 +34,7 @@ set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
3334
LibXml2_ROOT
3435
LLVM_ENABLE_CURL
3536
LLVM_ENABLE_HTTPLIB
37+
LLVM_ENABLE_TERMINFO
3638
LLVM_ENABLE_LIBEDIT
3739
CURL_ROOT
3840
OpenSSL_ROOT
@@ -45,6 +47,11 @@ set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
4547
CURSES_LIBRARIES
4648
PANEL_LIBRARIES
4749

50+
# Deprecated
51+
Terminfo_ROOT
52+
53+
Terminfo_LIBRARIES
54+
4855
# Deprecated
4956
LibEdit_ROOT
5057

clang/cmake/caches/VectorEngine.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
# ninja
1414
#
1515

16-
# Disable ZLIB, and ZSTD for VE since there is no pre-compiled libraries.
16+
# Disable TERMINFO, ZLIB, and ZSTD for VE since there is no pre-compiled
17+
# libraries.
18+
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
1719
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
1820
set(LLVM_ENABLE_ZSTD OFF CACHE BOOL "")
1921

clang/utils/analyzer/entrypoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def is_cmake_needed():
5454
"cmake -G Ninja -DCMAKE_BUILD_TYPE=Release "
5555
"-DCMAKE_INSTALL_PREFIX=/analyzer -DLLVM_TARGETS_TO_BUILD=X86 "
5656
'-DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_BUILD_RUNTIME=OFF '
57-
"-DCLANG_ENABLE_ARCMT=OFF "
57+
"-DLLVM_ENABLE_TERMINFO=OFF -DCLANG_ENABLE_ARCMT=OFF "
5858
"-DCLANG_ENABLE_STATIC_ANALYZER=ON"
5959
)
6060

compiler-rt/cmake/config-ix.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,21 @@ check_library_exists(m pow "" COMPILER_RT_HAS_LIBM)
182182
check_library_exists(pthread pthread_create "" COMPILER_RT_HAS_LIBPTHREAD)
183183
check_library_exists(execinfo backtrace "" COMPILER_RT_HAS_LIBEXECINFO)
184184

185+
# Look for terminfo library, used in unittests that depend on LLVMSupport.
186+
if(LLVM_ENABLE_TERMINFO STREQUAL FORCE_ON)
187+
set(MAYBE_REQUIRED REQUIRED)
188+
else()
189+
set(MAYBE_REQUIRED)
190+
endif()
191+
if(LLVM_ENABLE_TERMINFO)
192+
find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED})
193+
endif()
194+
if(COMPILER_RT_TERMINFO_LIB)
195+
set(LLVM_ENABLE_TERMINFO 1)
196+
else()
197+
set(LLVM_ENABLE_TERMINFO 0)
198+
endif()
199+
185200
if (ANDROID AND COMPILER_RT_HAS_LIBDL)
186201
# Android's libstdc++ has a dependency on libdl.
187202
list(APPEND CMAKE_REQUIRED_LIBRARIES dl)

compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ if [[ ! -f ${LLVM_BUILD}/build.ninja ]]; then
139139
-DLLVM_INCLUDE_TESTS=OFF \
140140
-DLLVM_ENABLE_ZLIB=ON \
141141
-DLLVM_ENABLE_ZSTD=OFF \
142+
-DLLVM_ENABLE_TERMINFO=OFF \
142143
-DLLVM_ENABLE_THREADS=OFF \
143144
$LLVM_SRC
144145
fi

compiler-rt/lib/xray/tests/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ set(XRAY_UNITTEST_LINK_FLAGS
5454
${COMPILER_RT_CXX_LINK_LIBS})
5555

5656
if (NOT APPLE)
57+
# Needed by LLVMSupport.
58+
append_list_if(
59+
LLVM_ENABLE_TERMINFO
60+
-l${COMPILER_RT_TERMINFO_LIB} XRAY_UNITTEST_LINK_FLAGS)
61+
5762
# We add the library directories one at a time in our CFLAGS.
5863
foreach (DIR ${LLVM_LIBRARY_DIR})
5964
list(APPEND XRAY_UNITTEST_LINK_FLAGS -L${DIR})

lldb/docs/resources/build.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ further by passing the appropriate cmake options, such as:
477477
-DLLDB_ENABLE_PYTHON=0
478478
-DLLDB_ENABLE_LIBEDIT=0
479479
-DLLDB_ENABLE_CURSES=0
480+
-DLLVM_ENABLE_TERMINFO=0
480481

481482
(see :ref:`Optional Dependencies` for more)
482483

lldb/source/Core/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ set(LLDB_LIBEDIT_LIBS)
1111

1212
if (LLDB_ENABLE_CURSES)
1313
list(APPEND LLDB_CURSES_LIBS ${PANEL_LIBRARIES} ${CURSES_LIBRARIES})
14+
if(LLVM_ENABLE_TERMINFO)
15+
list(APPEND LLDB_CURSES_LIBS ${Terminfo_LIBRARIES})
16+
endif()
1417
if (LLVM_BUILD_STATIC)
1518
list(APPEND LLDB_CURSES_LIBS gpm)
1619
endif()

llvm/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,8 @@ set(FFI_INCLUDE_DIR "" CACHE PATH "Additional directory, where CMake should sear
539539
set(LLVM_TARGET_ARCH "host"
540540
CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.")
541541

542+
option(LLVM_ENABLE_TERMINFO "Use terminfo database if available." ON)
543+
542544
set(LLVM_ENABLE_LIBXML2 "ON" CACHE STRING "Use libxml2 if available. Can be ON, OFF, or FORCE_ON")
543545

544546
option(LLVM_ENABLE_LIBEDIT "Use libedit if available." ON)

0 commit comments

Comments
 (0)