120-strip-unsafe-dirs-for-relinking.patch 999 B

12345678910111213141516171819202122232425
  1. From 7f2b8a1ab4fa1475eeeddfb84eb5b92594bfce43 Mon Sep 17 00:00:00 2001
  2. From: Eneas U de Queiroz <cotequeiroz@gmail.com>
  3. Date: Tue, 20 Jul 2021 16:54:12 -0300
  4. Subject: librecmc: strip unsave directories from relink command
  5. strip unsave directories from relink command, nuke every -L that looks
  6. like /usr/lib or /lib
  7. This was originally commited to librecmc by Jo-Philipp Wich
  8. <jow@openwrt.org>.
  9. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
  10. --- a/build-aux/ltmain.in
  11. +++ b/build-aux/ltmain.in
  12. @@ -2400,6 +2400,9 @@ func_mode_install ()
  13. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  14. fi
  15. + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
  16. + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
  17. +
  18. func_warning "relinking '$file'"
  19. func_show_eval "$relink_command" \
  20. 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'