0020-llvm-Do-not-use-find_library-for-ncurses.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From fd5760df7696cd9c6ec9ef38ed6cbab19d70e3ac Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sun, 7 Feb 2021 23:58:41 -0800
  4. Subject: [PATCH] llvm: Do not use find_library for ncurses
  5. This ensures that it lets OE to decide which lib to link
  6. otherwise it adds absolute paths to linker cmdline and confuses it
  7. horribly with native and target libs when build clang for target
  8. TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format
  9. clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
  10. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  11. ---
  12. compiler-rt/cmake/config-ix.cmake | 2 +-
  13. llvm/cmake/modules/FindTerminfo.cmake | 2 +-
  14. 2 files changed, 2 insertions(+), 2 deletions(-)
  15. diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
  16. index 4299a0589a7b..cb53b6fd14bd 100644
  17. --- a/compiler-rt/cmake/config-ix.cmake
  18. +++ b/compiler-rt/cmake/config-ix.cmake
  19. @@ -149,7 +149,7 @@ else()
  20. set(MAYBE_REQUIRED)
  21. endif()
  22. if(LLVM_ENABLE_TERMINFO)
  23. - find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED})
  24. + find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  25. endif()
  26. if(COMPILER_RT_TERMINFO_LIB)
  27. set(LLVM_ENABLE_TERMINFO 1)
  28. diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake
  29. index 65edb80fa69a..a58180be8926 100644
  30. --- a/llvm/cmake/modules/FindTerminfo.cmake
  31. +++ b/llvm/cmake/modules/FindTerminfo.cmake
  32. @@ -11,7 +11,7 @@
  33. # Additionally, the following import target will be defined:
  34. # Terminfo::terminfo
  35. -find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw)
  36. +find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  37. if(Terminfo_LIBRARIES)
  38. include(CMakePushCheckState)