0022-llvm-Do-not-use-find_library-for-ncurses.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 1c5c90696fc4edb612157536bad3447370172584 Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Tue, 9 Nov 2021 10:44:53 +0800
  4. Subject: [PATCH 22/34] 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. Rebased to LLVM 14.0.0 by Jun Yuan Tan
  11. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  12. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  13. ---
  14. compiler-rt/cmake/config-ix.cmake | 2 +-
  15. llvm/cmake/config-ix.cmake | 2 +-
  16. 2 files changed, 2 insertions(+), 2 deletions(-)
  17. diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
  18. index 62685f5d6c33..6461735c9dcb 100644
  19. --- a/compiler-rt/cmake/config-ix.cmake
  20. +++ b/compiler-rt/cmake/config-ix.cmake
  21. @@ -149,7 +149,7 @@ else()
  22. set(MAYBE_REQUIRED)
  23. endif()
  24. if(LLVM_ENABLE_TERMINFO)
  25. - find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED})
  26. + set(TERMINFO_LIB tinfo curses ncurses ncursesw)
  27. endif()
  28. if(COMPILER_RT_TERMINFO_LIB)
  29. set(LLVM_ENABLE_TERMINFO 1)
  30. diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
  31. index 3569c2d1389a..8a725d13343f 100644
  32. --- a/llvm/cmake/config-ix.cmake
  33. +++ b/llvm/cmake/config-ix.cmake
  34. @@ -176,7 +176,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
  35. set(MAYBE_REQUIRED)
  36. endif()
  37. if(LLVM_ENABLE_TERMINFO)
  38. - find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED})
  39. + set(TERMINFO_LIB tinfo curses ncurses ncursesw)
  40. endif()
  41. if(TERMINFO_LIB)
  42. set(LLVM_ENABLE_TERMINFO 1)
  43. --
  44. 2.33.1