0005-configure-use-LD-instead-of-hard-coding-ld.patch 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From d77e5f3d45b0cbae850e3a6e23d52edc137be803 Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Wed, 8 Feb 2023 13:52:05 +0100
  4. Subject: [PATCH] configure: use ${LD} instead of hard-coding 'ld'
  5. When doing cross-compilation, we do not want to use the native tools to
  6. test, but the target tools.
  7. Note that the weird quoting is inherited from a legacy patch in
  8. Buildroot, which dates back ages (at least 2006), and as it has not been
  9. identified as breaking things, we keep it as-is... Meh...
  10. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
  11. ---
  12. configure | 12 ++++++------
  13. configure.ac | 12 ++++++------
  14. 2 files changed, 12 insertions(+), 12 deletions(-)
  15. diff --git a/configure b/configure
  16. index 810636e..30a7ea3 100755
  17. --- a/configure
  18. +++ b/configure
  19. @@ -4377,12 +4377,12 @@ if ac_fn_c_try_compile "$LINENO"; then :
  20. ac_cv_shared_link_args='# Could not configure shlib linking'
  21. enable_shlib=no
  22. fi
  23. - elif (ld -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
  24. - ac_cv_shared_link_args='ld -shared --whole-archive -soname $@ -o $@.t'
  25. - elif (ld -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
  26. - ac_cv_shared_link_args='ld -shared -o $@.t -all -soname $@ -none -lc -all'
  27. - elif (ld -G -o conftest.so.t conftest.a) 2>&5; then
  28. - ac_cv_shared_link_args='ld -G -o $@.t'
  29. + elif (${LD-ld} -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
  30. + ac_cv_shared_link_args="${LD-ld}"' -shared --whole-archive -soname $@ -o $@.t'
  31. + elif (${LD-ld} -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
  32. + ac_cv_shared_link_args="${LD-ld}"' -shared -o $@.t -all -soname $@ -none -lc -all'
  33. + elif (${LD-ld} -G -o conftest.so.t conftest.a) 2>&5; then
  34. + ac_cv_shared_link_args="${LD-ld}"' -G -o $@.t'
  35. else
  36. # oh well, toss an error
  37. ac_cv_shared_link_args='# Could not configure shlib linking'
  38. diff --git a/configure.ac b/configure.ac
  39. index 51bdf4d..0d80a78 100644
  40. --- a/configure.ac
  41. +++ b/configure.ac
  42. @@ -169,12 +169,12 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ int foo(int val) { return val + 1; } ])],[
  43. ac_cv_shared_link_args='# Could not configure shlib linking'
  44. enable_shlib=no
  45. fi
  46. - elif (ld -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
  47. - ac_cv_shared_link_args='ld -shared --whole-archive -soname $@ -o $@.t'
  48. - elif (ld -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
  49. - ac_cv_shared_link_args='ld -shared -o $@.t -all -soname $@ -none -lc -all'
  50. - elif (ld -G -o conftest.so.t conftest.a) 2>&5; then
  51. - ac_cv_shared_link_args='ld -G -o $@.t'
  52. + elif (${LD-ld} -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
  53. + ac_cv_shared_link_args="${LD-ld}"' -shared --whole-archive -soname $@ -o $@.t'
  54. + elif (${LD-ld} -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
  55. + ac_cv_shared_link_args="${LD-ld}"' -shared -o $@.t -all -soname $@ -none -lc -all'
  56. + elif (${LD-ld} -G -o conftest.so.t conftest.a) 2>&5; then
  57. + ac_cv_shared_link_args="${LD-ld}"' -G -o $@.t'
  58. else
  59. # oh well, toss an error
  60. ac_cv_shared_link_args='# Could not configure shlib linking'
  61. --
  62. 2.25.1