575b5fd24bbfcaf307c746a1ba3734aabe6ea2f1
[openwrt/staging/hauke.git] / tools / libtool / patches / 120-strip-unsafe-dirs-for-relinking.patch
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: openwrt: strip unsave directories from relink command
5
6 strip unsave directories from relink command, nuke every -L that looks
7 like /usr/lib or /lib
8
9 This was originally commited to openwrt by Jo-Philipp Wich
10 <jow@openwrt.org>.
11
12 Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
13
14 --- a/libltdl/config/ltmain.m4sh
15 +++ b/libltdl/config/ltmain.m4sh
16 @@ -2186,6 +2186,9 @@ func_mode_install ()
17 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
18 fi
19
20 + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
21 + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
22 +
23 func_warning "relinking \`$file'"
24 func_show_eval "$relink_command" \
25 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
26 --- a/libltdl/config/ltmain.sh
27 +++ b/libltdl/config/ltmain.sh
28 @@ -2973,6 +2973,9 @@ func_mode_install ()
29 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
30 fi
31
32 + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
33 + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
34 +
35 func_warning "relinking \`$file'"
36 func_show_eval "$relink_command" \
37 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'