initial import
[patches.git] / trylinkbug.diff
1 --- trylink 2007-11-24 05:31:28.000000000 +0100
2 +++ trylink2 2007-11-10 02:40:48.000000000 +0100
3 @@ -46,14 +46,6 @@
4 return $exitcode
5 }
6
7 -check_cc() {
8 - if $CC $1 -shared -o /dev/null -xc /dev/null > /dev/null 2>&1; then
9 - echo "$1";
10 - else
11 - echo "$2";
12 - fi
13 -}
14 -
15 EXE="$1"
16 CC="$2"
17 LDFLAGS="$3"
18 @@ -61,9 +53,6 @@
19 A_FILES="$5"
20 LDLIBS="$6"
21
22 -# The -Wl,--sort-section option is not supported by older versions of ld
23 -SORT_SECTION=`check_cc "-Wl,--sort-section -Wl,alignment" ""`
24 -
25 # Sanitize lib list (dups, extra spaces etc)
26 LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs`
27
28 @@ -75,7 +64,7 @@
29 try $CC $LDFLAGS \
30 -o $EXE \
31 -Wl,--sort-common \
32 - $SORT_SECTION \
33 + -Wl,--sort-section -Wl,alignment \
34 -Wl,--gc-sections \
35 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
36 $l_list \
37 @@ -99,7 +88,7 @@
38 try $CC $LDFLAGS \
39 -o $EXE \
40 -Wl,--sort-common \
41 - $SORT_SECTION \
42 + -Wl,--sort-section -Wl,alignment \
43 -Wl,--gc-sections \
44 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
45 $l_list
46 @@ -128,7 +117,7 @@
47 try $CC $LDFLAGS \
48 -o $EXE \
49 -Wl,--sort-common \
50 - $SORT_SECTION \
51 + -Wl,--sort-section -Wl,alignment \
52 -Wl,--gc-sections \
53 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
54 $l_list \
55 @@ -150,7 +139,7 @@
56 try $CC $LDFLAGS \
57 -o $EXE \
58 -Wl,--sort-common \
59 - $SORT_SECTION \
60 + -Wl,--sort-section -Wl,alignment \
61 -Wl,--gc-sections \
62 -Wl,-T -Wl,busybox_ldscript \
63 -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
64 @@ -185,7 +174,7 @@
65 -Wl,-soname="libbusybox.so.$BB_VER" \
66 -Wl,--undefined=lbb_main \
67 -Wl,--sort-common \
68 - $SORT_SECTION \
69 + -Wl,--sort-section -Wl,alignment \
70 -Wl,--start-group $A_FILES -Wl,--end-group \
71 $l_list \
72 -Wl,--warn-common \
73 @@ -206,7 +195,7 @@
74 try $CC $LDFLAGS \
75 -o $EXE \
76 -Wl,--sort-common \
77 - $SORT_SECTION \
78 + -Wl,--sort-section -Wl,alignment \
79 -Wl,--gc-sections \
80 -Wl,--start-group $O_FILES -Wl,--end-group \
81 -L"$sharedlib_dir" -lbusybox \
82 @@ -245,7 +234,7 @@
83 try $CC $LDFLAGS "$sharedlib_dir/applet.c" \
84 -o $EXE \
85 -Wl,--sort-common \
86 - $SORT_SECTION \
87 + -Wl,--sort-section -Wl,alignment \
88 -Wl,--gc-sections \
89 -L"$sharedlib_dir" -lbusybox \
90 -Wl,--warn-common \