Skip to content

Commit 124be68

Browse files
committed
[Support] Remove terminfo dependency
The terminfo dependency introduces a significant nonhermeticity into the build. It doesn't respect `--no-undefined-version` meaning that it's not a dependency that can be built with Clang 17+. This forces maintainers of source-based distributions to implement patches or ignore linker errors. Remove it to reduce the closure size and improve portability of LLVM-based tools. Users can still use command line arguments to toggle color support expliticly. Fixes #75490 Closes #53294 #23355
1 parent ca478bc commit 124be68

File tree

26 files changed

+12
-218
lines changed

26 files changed

+12
-218
lines changed

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ 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 "")
2322
set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
2423
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
2524
set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")

clang/cmake/caches/Fuchsia.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ 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 "")
1615
set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
1716
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
1817
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
@@ -34,7 +33,6 @@ set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
3433
LibXml2_ROOT
3534
LLVM_ENABLE_CURL
3635
LLVM_ENABLE_HTTPLIB
37-
LLVM_ENABLE_TERMINFO
3836
LLVM_ENABLE_LIBEDIT
3937
CURL_ROOT
4038
OpenSSL_ROOT
@@ -47,11 +45,6 @@ set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
4745
CURSES_LIBRARIES
4846
PANEL_LIBRARIES
4947

50-
# Deprecated
51-
Terminfo_ROOT
52-
53-
Terminfo_LIBRARIES
54-
5548
# Deprecated
5649
LibEdit_ROOT
5750

clang/cmake/caches/VectorEngine.cmake

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

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

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-
"-DLLVM_ENABLE_TERMINFO=OFF -DCLANG_ENABLE_ARCMT=OFF "
57+
"-DCLANG_ENABLE_ARCMT=OFF "
5858
"-DCLANG_ENABLE_STATIC_ANALYZER=ON"
5959
)
6060

compiler-rt/cmake/config-ix.cmake

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,6 @@ 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-
200185
if (ANDROID AND COMPILER_RT_HAS_LIBDL)
201186
# Android's libstdc++ has a dependency on libdl.
202187
list(APPEND CMAKE_REQUIRED_LIBRARIES dl)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ 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 \
143142
-DLLVM_ENABLE_THREADS=OFF \
144143
$LLVM_SRC
145144
fi

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ 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-
6257
# We add the library directories one at a time in our CFLAGS.
6358
foreach (DIR ${LLVM_LIBRARY_DIR})
6459
list(APPEND XRAY_UNITTEST_LINK_FLAGS -L${DIR})

lldb/docs/resources/build.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ 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
481480

482481
(see :ref:`Optional Dependencies` for more)
483482

lldb/source/Core/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ 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()
1714
if (LLVM_BUILD_STATIC)
1815
list(APPEND LLDB_CURSES_LIBS gpm)
1916
endif()

llvm/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,6 @@ 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-
544542
set(LLVM_ENABLE_LIBXML2 "ON" CACHE STRING "Use libxml2 if available. Can be ON, OFF, or FORCE_ON")
545543

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

0 commit comments

Comments
 (0)