0010-sync-with-OE-libtool-changes.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. From 84fc4ceafcbfad4c6ddc9d65f6a425bd62dd062e Mon Sep 17 00:00:00 2001
  2. From: Ross Burton <ross.burton@intel.com>
  3. Date: Mon, 6 Mar 2017 23:33:27 -0800
  4. Subject: [PATCH] sync with OE libtool changes
  5. Apply these patches from our libtool patches as not only are redundant RPATHs a
  6. waste of space but they can cause incorrect linking when native packages are
  7. restored from sstate.
  8. fix-rpath.patch:
  9. We don't want to add RPATHS which match default linker
  10. search paths, they're a waste of space. This patch
  11. filters libtools list and removes the ones we don't need.
  12. norm-rpath.patch:
  13. Libtool may be passed link paths of the form "/usr/lib/../lib", which
  14. fool its detection code into thinking it should be included as an
  15. RPATH in the generated binary. Normalize before comparision.
  16. Upstream-Status: Inappropriate
  17. Signed-off-by: Ross Burton <ross.burton@intel.com>
  18. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  19. ---
  20. ltmain.sh | 34 ++++++++++++++++++++++++++++------
  21. 1 file changed, 28 insertions(+), 6 deletions(-)
  22. diff --git a/ltmain.sh b/ltmain.sh
  23. index 11ee684cccf..3b19ac15328 100644
  24. --- a/ltmain.sh
  25. +++ b/ltmain.sh
  26. @@ -8053,8 +8053,16 @@ EOF
  27. esac
  28. fi
  29. else
  30. - eval flag=\"$hardcode_libdir_flag_spec\"
  31. - func_append dep_rpath " $flag"
  32. + # We only want to hardcode in an rpath if it isn't in the
  33. + # default dlsearch path.
  34. + func_normal_abspath "$libdir"
  35. + libdir_norm=$func_normal_abspath_result
  36. + case " $sys_lib_dlsearch_path " in
  37. + *" $libdir_norm "*) ;;
  38. + *) eval flag=\"$hardcode_libdir_flag_spec\"
  39. + func_append dep_rpath " $flag"
  40. + ;;
  41. + esac
  42. fi
  43. elif test -n "$runpath_var"; then
  44. case "$perm_rpath " in
  45. @@ -8790,8 +8798,16 @@ EOF
  46. esac
  47. fi
  48. else
  49. - eval flag=\"$hardcode_libdir_flag_spec\"
  50. - func_append rpath " $flag"
  51. + # We only want to hardcode in an rpath if it isn't in the
  52. + # default dlsearch path.
  53. + func_normal_abspath "$libdir"
  54. + libdir_norm=$func_normal_abspath_result
  55. + case " $sys_lib_dlsearch_path " in
  56. + *" $libdir_norm "*) ;;
  57. + *) eval flag=\"$hardcode_libdir_flag_spec\"
  58. + rpath+=" $flag"
  59. + ;;
  60. + esac
  61. fi
  62. elif test -n "$runpath_var"; then
  63. case "$perm_rpath " in
  64. @@ -8841,8 +8857,14 @@ EOF
  65. esac
  66. fi
  67. else
  68. - eval flag=\"$hardcode_libdir_flag_spec\"
  69. - func_append rpath " $flag"
  70. + # We only want to hardcode in an rpath if it isn't in the
  71. + # default dlsearch path.
  72. + case " $sys_lib_dlsearch_path " in
  73. + *" $libdir "*) ;;
  74. + *) eval flag=\"$hardcode_libdir_flag_spec\"
  75. + func_append rpath " $flag"
  76. + ;;
  77. + esac
  78. fi
  79. elif test -n "$runpath_var"; then
  80. case "$finalize_perm_rpath " in