100-libdir-fixes.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. From 67ffe8e8582a7ba1f1d1307a419098e6dd88bdaf Mon Sep 17 00:00:00 2001
  2. From: Eneas U de Queiroz <[email protected]>
  3. Date: Tue, 20 Jul 2021 16:41:11 -0300
  4. Subject: openwrt: cross-compilation path adjustments
  5. Comments from the patch:
  6. Adding 'libdir' from the .la file to our library search paths
  7. breaks crosscompilation horribly. We cheat here and don't add
  8. it, instead adding the path where we found the .la. -CL
  9. OE sets installed=no in staging. We need to look in $objdir and $absdir,
  10. preferring $objdir. RP 31/04/2008
  11. This was originally commited to openwrt by Jo-Philipp Wich
  12. <[email protected]>.
  13. Signed-off-by: Eneas U de Queiroz <[email protected]>
  14. --- a/libltdl/config/ltmain.m4sh
  15. +++ b/libltdl/config/ltmain.m4sh
  16. @@ -5731,8 +5731,14 @@ func_mode_link ()
  17. absdir="$abs_ladir"
  18. libdir="$abs_ladir"
  19. else
  20. - dir="$lt_sysroot$libdir"
  21. - absdir="$lt_sysroot$libdir"
  22. + # Adding 'libdir' from the .la file to our library search paths
  23. + # breaks crosscompilation horribly. We cheat here and don't add
  24. + # it, instead adding the path where we found the .la. -CL
  25. + dir="$lt_sysroot$abs_ladir"
  26. + absdir="$abs_ladir"
  27. + libdir="$abs_ladir"
  28. + #dir="$libdir"
  29. + #absdir="$lt_sysroot$libdir"
  30. fi
  31. test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  32. else
  33. @@ -6130,8 +6136,6 @@ func_mode_link ()
  34. add="$libdir/$linklib"
  35. fi
  36. else
  37. - # We cannot seem to hardcode it, guess we'll fake it.
  38. - add_dir="-L$libdir"
  39. # Try looking first in the location we're being installed to.
  40. if test -n "$inst_prefix_dir"; then
  41. case $libdir in
  42. @@ -6286,7 +6290,17 @@ func_mode_link ()
  43. fi
  44. ;;
  45. *)
  46. - path="-L$absdir/$objdir"
  47. + # OE sets installed=no in staging. We need to look in $objdir and $absdir,
  48. + # preferring $objdir. RP 31/04/2008
  49. + if test -f "$absdir/$objdir/$depdepl" ; then
  50. + depdepl="$absdir/$objdir/$depdepl"
  51. + path="-L$absdir/$objdir"
  52. + elif test -f "$absdir/$depdepl" ; then
  53. + depdepl="$absdir/$depdepl"
  54. + path="-L$absdir"
  55. + else
  56. + path="-L$absdir/$objdir"
  57. + fi
  58. ;;
  59. esac
  60. else
  61. --- a/libltdl/config/ltmain.sh
  62. +++ b/libltdl/config/ltmain.sh
  63. @@ -6518,8 +6518,14 @@ func_mode_link ()
  64. absdir="$abs_ladir"
  65. libdir="$abs_ladir"
  66. else
  67. - dir="$lt_sysroot$libdir"
  68. - absdir="$lt_sysroot$libdir"
  69. + # Adding 'libdir' from the .la file to our library search paths
  70. + # breaks crosscompilation horribly. We cheat here and don't add
  71. + # it, instead adding the path where we found the .la. -CL
  72. + dir="$lt_sysroot$abs_ladir"
  73. + absdir="$abs_ladir"
  74. + libdir="$abs_ladir"
  75. + #dir="$libdir"
  76. + #absdir="$lt_sysroot$libdir"
  77. fi
  78. test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  79. else
  80. @@ -6917,8 +6923,6 @@ func_mode_link ()
  81. add="$libdir/$linklib"
  82. fi
  83. else
  84. - # We cannot seem to hardcode it, guess we'll fake it.
  85. - add_dir="-L$libdir"
  86. # Try looking first in the location we're being installed to.
  87. if test -n "$inst_prefix_dir"; then
  88. case $libdir in
  89. @@ -7073,7 +7077,17 @@ func_mode_link ()
  90. fi
  91. ;;
  92. *)
  93. - path="-L$absdir/$objdir"
  94. + # OE sets installed=no in staging. We need to look in $objdir and $absdir,
  95. + # preferring $objdir. RP 31/04/2008
  96. + if test -f "$absdir/$objdir/$depdepl" ; then
  97. + depdepl="$absdir/$objdir/$depdepl"
  98. + path="-L$absdir/$objdir"
  99. + elif test -f "$absdir/$depdepl" ; then
  100. + depdepl="$absdir/$depdepl"
  101. + path="-L$absdir"
  102. + else
  103. + path="-L$absdir/$objdir"
  104. + fi
  105. ;;
  106. esac
  107. else