diff options
-rwxr-xr-x | scripts/trylink | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/trylink b/scripts/trylink index 6905f8626..4ee5d8255 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
@@ -9,7 +9,6 @@ try() { | |||
9 | $debug && echo "Trying: $*" | 9 | $debug && echo "Trying: $*" |
10 | "$@" >>$EXE.out 2>&1 | 10 | "$@" >>$EXE.out 2>&1 |
11 | exitcode=$? | 11 | exitcode=$? |
12 | cat $EXE.out | ||
13 | return $exitcode | 12 | return $exitcode |
14 | } | 13 | } |
15 | 14 | ||
@@ -33,7 +32,6 @@ try $CC $LDFLAGS \ | |||
33 | -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ | 32 | -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ |
34 | -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ | 33 | -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ |
35 | $l_list \ | 34 | $l_list \ |
36 | >/dev/null \ | ||
37 | || { | 35 | || { |
38 | echo "Failed: $* $l_list" | 36 | echo "Failed: $* $l_list" |
39 | cat $EXE.out | 37 | cat $EXE.out |
@@ -76,7 +74,7 @@ done | |||
76 | # Make the binary with final, minimal list of libs | 74 | # Make the binary with final, minimal list of libs |
77 | echo "Final link with: $LDLIBS" | 75 | echo "Final link with: $LDLIBS" |
78 | l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` | 76 | l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` |
79 | test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose" | 77 | test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group" |
80 | # --verbose gives us gobs of info to stdout (e.g. linker script used) | 78 | # --verbose gives us gobs of info to stdout (e.g. linker script used) |
81 | if ! test -f busybox_ldscript; then | 79 | if ! test -f busybox_ldscript; then |
82 | try $CC $LDFLAGS \ | 80 | try $CC $LDFLAGS \ |
@@ -121,7 +119,6 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then | |||
121 | $l_list -Wl,--verbose \ | 119 | $l_list -Wl,--verbose \ |
122 | -Wl,-soname="libbusybox.so.$BB_VER" \ | 120 | -Wl,-soname="libbusybox.so.$BB_VER" \ |
123 | -Wl,-z,combreloc \ | 121 | -Wl,-z,combreloc \ |
124 | >/dev/null \ | ||
125 | || { | 122 | || { |
126 | echo "Linking $EXE failed" | 123 | echo "Linking $EXE failed" |
127 | cat $EXE.out | 124 | cat $EXE.out |
@@ -140,7 +137,6 @@ if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then | |||
140 | -Wl,--start-group $O_FILES -Wl,--end-group \ | 137 | -Wl,--start-group $O_FILES -Wl,--end-group \ |
141 | -Wl,--verbose \ | 138 | -Wl,--verbose \ |
142 | -L"$sharedlib_dir" -lbusybox \ | 139 | -L"$sharedlib_dir" -lbusybox \ |
143 | >/dev/null \ | ||
144 | || { | 140 | || { |
145 | echo "Linking $EXE failed" | 141 | echo "Linking $EXE failed" |
146 | cat $EXE.out | 142 | cat $EXE.out |
@@ -176,10 +172,9 @@ int main(int argc, char **argv) | |||
176 | -o $EXE \ | 172 | -o $EXE \ |
177 | -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ | 173 | -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ |
178 | -L"$sharedlib_dir" -lbusybox \ | 174 | -L"$sharedlib_dir" -lbusybox \ |
179 | >/dev/null \ | ||
180 | || { | 175 | || { |
181 | echo "Linking $EXE failed" | 176 | echo "Linking $EXE failed" |
182 | cat -- $EXE.out | 177 | cat $EXE.out |
183 | exit 1 | 178 | exit 1 |
184 | } | 179 | } |
185 | rm -- "$sharedlib_dir/applet.c" $EXE.out | 180 | rm -- "$sharedlib_dir/applet.c" $EXE.out |
@@ -190,4 +185,5 @@ fi | |||
190 | 185 | ||
191 | # libbusybox.so is needed only for -lbusybox at link time, | 186 | # libbusybox.so is needed only for -lbusybox at link time, |
192 | # it is not needed at runtime. Deleting to reduce confusion. | 187 | # it is not needed at runtime. Deleting to reduce confusion. |
193 | rm "$sharedlib_dir"/libbusybox.so >/dev/null | 188 | rm "$sharedlib_dir"/libbusybox.so 2>/dev/null |
189 | exit 0 # or else we may confuse make | ||