mgorny created this revision. mgorny added reviewers: krytarowski, dberris, labath. Herald added subscribers: Sanitizers, llvm-commits.
Copy the fix for determining the correct terminfo library from LLVM -- use distinct variables for check_library_exists() calls. Otherwise, the first check (for -ltinfo) populates the variable and no other checks are performed. Effectively, systems with other libraries than the first one listed are presumed not to have terminfo routines at all. This partially fixes undefined symbols when linking XRay tests. It's probably not the best solution to the problem there but as long as the terminfo check stays in config-ix, I thnk it's worth fixing. Repository: rCRT Compiler Runtime https://reviews.llvm.org/D54641 Files: cmake/config-ix.cmake Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -122,9 +122,11 @@ # Look for terminfo library, used in unittests that depend on LLVMSupport. if(LLVM_ENABLE_TERMINFO) foreach(library tinfo terminfo curses ncurses ncursesw) + string(TOUPPER ${library} library_suffix) check_library_exists( - ${library} setupterm "" COMPILER_RT_HAS_TERMINFO) - if(COMPILER_RT_HAS_TERMINFO) + ${library} setupterm "" COMPILER_RT_HAS_TERMINFO_${library_suffix}) + if(COMPILER_RT_HAS_TERMINFO_${library_suffix}) + set(COMPILER_RT_HAS_TERMINFO TRUE) set(COMPILER_RT_TERMINFO_LIB "${library}") break() endif()
Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -122,9 +122,11 @@ # Look for terminfo library, used in unittests that depend on LLVMSupport. if(LLVM_ENABLE_TERMINFO) foreach(library tinfo terminfo curses ncurses ncursesw) + string(TOUPPER ${library} library_suffix) check_library_exists( - ${library} setupterm "" COMPILER_RT_HAS_TERMINFO) - if(COMPILER_RT_HAS_TERMINFO) + ${library} setupterm "" COMPILER_RT_HAS_TERMINFO_${library_suffix}) + if(COMPILER_RT_HAS_TERMINFO_${library_suffix}) + set(COMPILER_RT_HAS_TERMINFO TRUE) set(COMPILER_RT_TERMINFO_LIB "${library}") break() endif()
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits