aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-05-21 12:11:34 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-05-21 12:11:34 +0200
commita88585a931c7e81d4d3d393127d8ad8c0fe73fb5 (patch)
treea1d6b1b85efaacbe94413d45bf8cdd3d38c381dc
parente91bc53d0c2e8de7dc4fbdb888ab0a4923c2b475 (diff)
downloadbusybox-w32-a88585a931c7e81d4d3d393127d8ad8c0fe73fb5.tar.gz
busybox-w32-a88585a931c7e81d4d3d393127d8ad8c0fe73fb5.tar.bz2
busybox-w32-a88585a931c7e81d4d3d393127d8ad8c0fe73fb5.zip
trylink: gold may not support --sort-common (yet)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rwxr-xr-xscripts/trylink17
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/trylink b/scripts/trylink
index 8c8854679..164f5274c 100755
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -85,6 +85,9 @@ LDLIBS="$7"
85# The --sort-section option is not supported by older versions of ld 85# The --sort-section option is not supported by older versions of ld
86SORT_SECTION=`check_cc "-Wl,--sort-section,alignment" ""` 86SORT_SECTION=`check_cc "-Wl,--sort-section,alignment" ""`
87 87
88# gold may not support --sort-common (yet)
89SORT_COMMON=`check_cc "-Wl,--sort-common" ""`
90
88# Static linking against glibc produces buggy executables 91# Static linking against glibc produces buggy executables
89# (glibc does not cope well with ld --gc-sections). 92# (glibc does not cope well with ld --gc-sections).
90# See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 93# See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
@@ -114,7 +117,7 @@ l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
114test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group" 117test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group"
115try $CC $CFLAGS $LDFLAGS \ 118try $CC $CFLAGS $LDFLAGS \
116 -o $EXE \ 119 -o $EXE \
117 -Wl,--sort-common \ 120 $SORT_COMMON \
118 $SORT_SECTION \ 121 $SORT_SECTION \
119 $GC_SECTIONS \ 122 $GC_SECTIONS \
120 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ 123 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
@@ -139,7 +142,7 @@ while test "$LDLIBS"; do
139 $debug && echo "Trying -l options: '$l_list'" 142 $debug && echo "Trying -l options: '$l_list'"
140 try $CC $CFLAGS $LDFLAGS \ 143 try $CC $CFLAGS $LDFLAGS \
141 -o $EXE \ 144 -o $EXE \
142 -Wl,--sort-common \ 145 $SORT_COMMON \
143 $SORT_SECTION \ 146 $SORT_SECTION \
144 $GC_SECTIONS \ 147 $GC_SECTIONS \
145 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ 148 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
@@ -171,7 +174,7 @@ test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group"
171if ! test -f busybox_ldscript; then 174if ! test -f busybox_ldscript; then
172 try $CC $CFLAGS $LDFLAGS \ 175 try $CC $CFLAGS $LDFLAGS \
173 -o $EXE \ 176 -o $EXE \
174 -Wl,--sort-common \ 177 $SORT_COMMON \
175 $SORT_SECTION \ 178 $SORT_SECTION \
176 $GC_SECTIONS \ 179 $GC_SECTIONS \
177 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ 180 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
@@ -193,7 +196,7 @@ else
193 # Hmm, "ld --sort-section alignment" should do it too. 196 # Hmm, "ld --sort-section alignment" should do it too.
194 try $CC $CFLAGS $LDFLAGS \ 197 try $CC $CFLAGS $LDFLAGS \
195 -o $EXE \ 198 -o $EXE \
196 -Wl,--sort-common \ 199 $SORT_COMMON \
197 $SORT_SECTION \ 200 $SORT_SECTION \
198 $GC_SECTIONS \ 201 $GC_SECTIONS \
199 -Wl,-T,busybox_ldscript \ 202 -Wl,-T,busybox_ldscript \
@@ -228,7 +231,7 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then
228 -Wl,-z,combreloc \ 231 -Wl,-z,combreloc \
229 -Wl,-soname="libbusybox.so.$BB_VER" \ 232 -Wl,-soname="libbusybox.so.$BB_VER" \
230 -Wl,--undefined=lbb_main \ 233 -Wl,--undefined=lbb_main \
231 -Wl,--sort-common \ 234 $SORT_COMMON \
232 $SORT_SECTION \ 235 $SORT_SECTION \
233 -Wl,--start-group $A_FILES -Wl,--end-group \ 236 -Wl,--start-group $A_FILES -Wl,--end-group \
234 $l_list \ 237 $l_list \
@@ -249,7 +252,7 @@ if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then
249 EXE="$sharedlib_dir/busybox_unstripped" 252 EXE="$sharedlib_dir/busybox_unstripped"
250 try $CC $CFLAGS $LDFLAGS \ 253 try $CC $CFLAGS $LDFLAGS \
251 -o $EXE \ 254 -o $EXE \
252 -Wl,--sort-common \ 255 $SORT_COMMON \
253 $SORT_SECTION \ 256 $SORT_SECTION \
254 $GC_SECTIONS \ 257 $GC_SECTIONS \
255 -Wl,--start-group $O_FILES -Wl,--end-group \ 258 -Wl,--start-group $O_FILES -Wl,--end-group \
@@ -288,7 +291,7 @@ int main(int argc, char **argv)
288 EXE="$sharedlib_dir/$name" 291 EXE="$sharedlib_dir/$name"
289 try $CC $CFLAGS $LDFLAGS "$sharedlib_dir/applet.c" \ 292 try $CC $CFLAGS $LDFLAGS "$sharedlib_dir/applet.c" \
290 -o $EXE \ 293 -o $EXE \
291 -Wl,--sort-common \ 294 $SORT_COMMON \
292 $SORT_SECTION \ 295 $SORT_SECTION \
293 $GC_SECTIONS \ 296 $GC_SECTIONS \
294 -L"$sharedlib_dir" -lbusybox \ 297 -L"$sharedlib_dir" -lbusybox \