aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-09-02 14:51:54 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-09-02 14:51:54 +0000
commit8d91c13df5ecd4e2e2f7e4bea6bf5bec9495e1ca (patch)
treed170d2548e805037f3c1b31317f8f7c4b67fe114
parent7bc5360bba5ae057771200e2d5ae55c45f178c0d (diff)
downloadbusybox-w32-8d91c13df5ecd4e2e2f7e4bea6bf5bec9495e1ca.tar.gz
busybox-w32-8d91c13df5ecd4e2e2f7e4bea6bf5bec9495e1ca.tar.bz2
busybox-w32-8d91c13df5ecd4e2e2f7e4bea6bf5bec9495e1ca.zip
- fix bug where we linked again -lm even though it is not needed.
For BBOX_LIB_LIST="crypt m" trylink ... with just applet true, we pulled in libm because in this case we tried to use invalid flags (plain "-l" without a lib) which of course failed, thus the script thought that -lm was needed. The fix is not to pass "-l" without a lib if we are about to check if any or the last remaining lib is really needed.
-rwxr-xr-xscripts/trylink13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/trylink b/scripts/trylink
index 4eaa334d5..69473076b 100755
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -39,8 +39,17 @@ while test "$BBOX_LIB_LIST"; do
39 for one in $BBOX_LIB_LIST; do 39 for one in $BBOX_LIB_LIST; do
40 without_one=`echo " $BBOX_LIB_LIST " | sed "s/ $one / /g" | xargs` 40 without_one=`echo " $BBOX_LIB_LIST " | sed "s/ $one / /g" | xargs`
41 l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/'` 41 l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/'`
42 $debug && echo "Trying -l options: $l_list" 42 # If l_list is just "-l" without a lib, then make sure to test the
43 if try "-Wl,--start-group $l_list -Wl,--end-group" "$@"; then 43 # correct thing to fail: just using -l will fail, so the last lib
44 # (usually m in my case) will incorrectly be added as needed.
45 if test "x$without_one" != "x"; then
46 l_list="-Wl,--start-group $l_list -Wl,--end-group"
47 else
48 # without_one is empty, so l_list has to be empty too
49 l_list=""
50 fi
51 $debug && echo "Trying -l options: '$l_list'"
52 if try "$l_list" "$@"; then
44 echo "Library $one is not needed" 53 echo "Library $one is not needed"
45 BBOX_LIB_LIST="$without_one" 54 BBOX_LIB_LIST="$without_one"
46 all_needed=false 55 all_needed=false