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

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 20208fe7aaaf65837d06bd00a5550134075a2b22 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. Upstream-Status: Pending
  11. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  12. ---
  13. compiler-rt/cmake/config-ix.cmake | 2 +-
  14. llvm/cmake/modules/FindTerminfo.cmake | 2 +-
  15. 2 files changed, 2 insertions(+), 2 deletions(-)
  16. diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
  17. index 5f51befc1973..55c04b76908e 100644
  18. --- a/compiler-rt/cmake/config-ix.cmake
  19. +++ b/compiler-rt/cmake/config-ix.cmake
  20. @@ -179,7 +179,7 @@ else()
  21. set(MAYBE_REQUIRED)
  22. endif()
  23. if(LLVM_ENABLE_TERMINFO)
  24. - find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED})
  25. + find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  26. endif()
  27. if(COMPILER_RT_TERMINFO_LIB)
  28. set(LLVM_ENABLE_TERMINFO 1)
  29. diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake
  30. index eef1f95853eb..b3b330dd3d59 100644
  31. --- a/llvm/cmake/modules/FindTerminfo.cmake
  32. +++ b/llvm/cmake/modules/FindTerminfo.cmake
  33. @@ -11,7 +11,7 @@
  34. # Additionally, the following import target will be defined:
  35. # Terminfo::terminfo
  36. -find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw)
  37. +find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  38. if(Terminfo_LIBRARIES)
  39. include(CMakePushCheckState)