[PATCH] D74793: Patch to specify the library containing terminfo symbols

Glenn Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 13:58:31 PST 2020


glennpj created this revision.
Herald added subscribers: llvm-commits, mgorny.
Herald added a project: LLVM.

When compiling LLVM on Spack, I saw library linking to my system libtinfo rather than the spack built ncurses. This is because the search path in config-ix.cmake list tinfo first.

The atttached patch creates a new variable to use to specify the library that contains the tinfo symbols, and then makes sure that it is first in the list. This may need to have a conditional relationship with LLVM_ENABLE_TERMINFO but that is not done in this patch.


https://reviews.llvm.org/D74793

Files:
  compiler-rt/cmake/config-ix.cmake
  llvm/CMakeLists.txt
  llvm/cmake/config-ix.cmake


Index: llvm/cmake/config-ix.cmake
===================================================================
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -127,7 +127,7 @@
     endif()
     if(LLVM_ENABLE_TERMINFO)
       set(HAVE_TERMINFO 0)
-      foreach(library terminfo tinfo curses ncurses ncursesw)
+      foreach(library ${CURSES_TINFO} terminfo tinfo curses ncurses ncursesw)
         string(TOUPPER ${library} library_suffix)
         check_library_exists(${library} setupterm "" HAVE_TERMINFO_${library_suffix})
         if(HAVE_TERMINFO_${library_suffix})
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -338,6 +338,7 @@
   CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.")
 
 option(LLVM_ENABLE_TERMINFO "Use terminfo database if available." ON)
+set(CURSES_TINFO "" CACHE STRING "Set library where tinfo symbols are.")
 
 set(LLVM_ENABLE_LIBXML2 "ON" CACHE STRING "Use libxml2 if available. Can be ON, OFF, or FORCE_ON")
 
Index: compiler-rt/cmake/config-ix.cmake
===================================================================
--- compiler-rt/cmake/config-ix.cmake
+++ compiler-rt/cmake/config-ix.cmake
@@ -129,7 +129,7 @@
 
 # Look for terminfo library, used in unittests that depend on LLVMSupport.
 if(LLVM_ENABLE_TERMINFO)
-  foreach(library terminfo tinfo curses ncurses ncursesw)
+    foreach(library ${CURSES_TINFO} terminfo tinfo curses ncurses ncursesw)
     string(TOUPPER ${library} library_suffix)
     check_library_exists(
       ${library} setupterm "" COMPILER_RT_HAS_TERMINFO_${library_suffix})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74793.245254.patch
Type: text/x-patch
Size: 1679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200218/b2992c48/attachment.bin>


More information about the llvm-commits mailing list