0009-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 98410efc334e31ccfbdc0080fb293b0e06885454 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Mon, 2 Mar 2015 01:42:38 +0000
  4. Subject: [PATCH] Fix rpath in libtool when sysroot is enabled
  5. Enabling sysroot support in libtool exposed a bug where the final
  6. library had an RPATH encoded into it which still pointed to the
  7. sysroot. This works around the issue until it gets sorted out
  8. upstream.
  9. Fix suggested by Richard Purdie <richard.purdie@linuxfoundation.org>
  10. Upstream-Status: Inappropriate [embedded specific]
  11. Signed-off-by: Scott Garman <scott.a.garman@intel.com>
  12. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  13. ---
  14. ltmain.sh | 10 ++++++++--
  15. 1 file changed, 8 insertions(+), 2 deletions(-)
  16. diff --git a/ltmain.sh b/ltmain.sh
  17. index 70e856e0659..11ee684cccf 100644
  18. --- a/ltmain.sh
  19. +++ b/ltmain.sh
  20. @@ -8035,9 +8035,11 @@ EOF
  21. test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
  22. for libdir in $rpath; do
  23. if test -n "$hardcode_libdir_flag_spec"; then
  24. + func_replace_sysroot "$libdir"
  25. + libdir=$func_replace_sysroot_result
  26. + func_stripname '=' '' "$libdir"
  27. + libdir=$func_stripname_result
  28. if test -n "$hardcode_libdir_separator"; then
  29. - func_replace_sysroot "$libdir"
  30. - libdir=$func_replace_sysroot_result
  31. if test -z "$hardcode_libdirs"; then
  32. hardcode_libdirs="$libdir"
  33. else
  34. @@ -8770,6 +8772,10 @@ EOF
  35. hardcode_libdirs=
  36. for libdir in $compile_rpath $finalize_rpath; do
  37. if test -n "$hardcode_libdir_flag_spec"; then
  38. + func_replace_sysroot "$libdir"
  39. + libdir=$func_replace_sysroot_result
  40. + func_stripname '=' '' "$libdir"
  41. + libdir=$func_stripname_result
  42. if test -n "$hardcode_libdir_separator"; then
  43. if test -z "$hardcode_libdirs"; then
  44. hardcode_libdirs="$libdir"