# Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
# "-xc": C language. "/dev/null" is an empty source file.
# Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
# "-xc": C language. "/dev/null" is an empty source file.
START_GROUP="-Wl,--start-group"
END_GROUP="-Wl,--end-group"
START_GROUP="-Wl,--start-group"
END_GROUP="-Wl,--end-group"
INFO_OPTS="-Wl,--warn-common -Wl,-Map,$EXE.map -Wl,--verbose"
# gold may not support --sort-common (yet)
INFO_OPTS="-Wl,--warn-common -Wl,-Map,$EXE.map -Wl,--verbose"
# gold may not support --sort-common (yet)
# First link with all libs. If it fails, bail out
echo "Trying libraries: $LDLIBS"
# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
# First link with all libs. If it fails, bail out
echo "Trying libraries: $LDLIBS"
# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
for one in $LDLIBS; do
without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs`
# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
for one in $LDLIBS; do
without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs`
# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
test x"$l_list" != x"" && l_list="$START_GROUP $l_list $END_GROUP"
$debug && echo "Trying -l options: '$l_list'"
try $CC $CFLAGS $LDFLAGS \
test x"$l_list" != x"" && l_list="$START_GROUP $l_list $END_GROUP"
$debug && echo "Trying -l options: '$l_list'"
try $CC $CFLAGS $LDFLAGS \
# Make the binary with final, minimal list of libs
echo "Final link with: ${LDLIBS:-<none>}"
# Make the binary with final, minimal list of libs
echo "Final link with: ${LDLIBS:-<none>}"
test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
# --verbose gives us gobs of info to stdout (e.g. linker script used)
if ! test -f busybox_ldscript; then
test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
# --verbose gives us gobs of info to stdout (e.g. linker script used)
if ! test -f busybox_ldscript; then
if test "$CONFIG_FEATURE_INDIVIDUAL" = y; then
echo "Linking individual applets against libbusybox (see $sharedlib_dir/*)"
if test "$CONFIG_FEATURE_INDIVIDUAL" = y; then
echo "Linking individual applets against libbusybox (see $sharedlib_dir/*)"
}
rm -- "$sharedlib_dir/applet.c" $EXE.out
$STRIP -s --remove-section=.note --remove-section=.comment $EXE
}
rm -- "$sharedlib_dir/applet.c" $EXE.out
$STRIP -s --remove-section=.note --remove-section=.comment $EXE