--- trylink	2007-11-24 05:31:28.000000000 +0100
+++ trylink2	2007-11-10 02:40:48.000000000 +0100
@@ -46,14 +46,6 @@
     return $exitcode
 }
 
-check_cc() {
-    if $CC $1 -shared -o /dev/null -xc /dev/null > /dev/null 2>&1; then
-        echo "$1";
-    else
-        echo "$2";
-    fi
-}
-
 EXE="$1"
 CC="$2"
 LDFLAGS="$3"
@@ -61,9 +53,6 @@
 A_FILES="$5"
 LDLIBS="$6"
 
-# The -Wl,--sort-section option is not supported by older versions of ld
-SORT_SECTION=`check_cc "-Wl,--sort-section -Wl,alignment" ""`
-
 # Sanitize lib list (dups, extra spaces etc)
 LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs`
 
@@ -75,7 +64,7 @@
 try $CC $LDFLAGS \
 	-o $EXE \
 	-Wl,--sort-common \
-	$SORT_SECTION \
+	-Wl,--sort-section -Wl,alignment \
 	-Wl,--gc-sections \
 	-Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
 	$l_list \
@@ -99,7 +88,7 @@
 	try $CC $LDFLAGS \
 		-o $EXE \
 		-Wl,--sort-common \
-		$SORT_SECTION \
+		-Wl,--sort-section -Wl,alignment \
 		-Wl,--gc-sections \
 		-Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
 		$l_list
@@ -128,7 +117,7 @@
     try $CC $LDFLAGS \
 	    -o $EXE \
 	    -Wl,--sort-common \
-	    $SORT_SECTION \
+	    -Wl,--sort-section -Wl,alignment \
 	    -Wl,--gc-sections \
 	    -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
 	    $l_list \
@@ -150,7 +139,7 @@
     try $CC $LDFLAGS \
 	    -o $EXE \
 	    -Wl,--sort-common \
-	    $SORT_SECTION \
+	    -Wl,--sort-section -Wl,alignment \
 	    -Wl,--gc-sections \
 	    -Wl,-T -Wl,busybox_ldscript \
 	    -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
@@ -185,7 +174,7 @@
 	    -Wl,-soname="libbusybox.so.$BB_VER" \
 	    -Wl,--undefined=lbb_main \
 	    -Wl,--sort-common \
-	    $SORT_SECTION \
+	    -Wl,--sort-section -Wl,alignment \
 	    -Wl,--start-group $A_FILES -Wl,--end-group \
 	    $l_list \
 	    -Wl,--warn-common \
@@ -206,7 +195,7 @@
     try $CC $LDFLAGS \
 	    -o $EXE \
 	    -Wl,--sort-common \
-	    $SORT_SECTION \
+	    -Wl,--sort-section -Wl,alignment \
 	    -Wl,--gc-sections \
 	    -Wl,--start-group $O_FILES -Wl,--end-group \
 	    -L"$sharedlib_dir" -lbusybox \
@@ -245,7 +234,7 @@
 	try $CC $LDFLAGS "$sharedlib_dir/applet.c" \
 		-o $EXE \
 		-Wl,--sort-common \
-		$SORT_SECTION \
+		-Wl,--sort-section -Wl,alignment \
 		-Wl,--gc-sections \
 		-L"$sharedlib_dir" -lbusybox \
 		-Wl,--warn-common \
