trylink: automatically use custom link script if user provides one
vinfo_msg: one user (info_msg), incorporate in it *: style fixes
This commit is contained in:
parent
a1120a8ea2
commit
dbe6e66d6a
@ -656,7 +656,6 @@ extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2
|
||||
/* These are used internally -- you shouldn't need to use them */
|
||||
extern void bb_verror_msg(const char *s, va_list p, const char *strerr);
|
||||
extern void bb_vperror_msg(const char *s, va_list p);
|
||||
extern void bb_vinfo_msg(const char *s, va_list p);
|
||||
|
||||
|
||||
/* applets which are useful from another applets */
|
||||
|
@ -88,7 +88,6 @@ lib-y += vdprintf.o
|
||||
lib-y += verror_msg.o
|
||||
lib-y += vfork_daemon_rexec.o
|
||||
lib-y += vherror_msg.o
|
||||
lib-y += vinfo_msg.o
|
||||
lib-y += vperror_msg.o
|
||||
lib-y += warn_ignoring_args.o
|
||||
lib-y += wfopen.o
|
||||
|
@ -7,13 +7,24 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
|
||||
#include <syslog.h>
|
||||
#include "libbb.h"
|
||||
|
||||
void bb_info_msg(const char *s, ...)
|
||||
{
|
||||
va_list p;
|
||||
/* va_copy is used because it is not portable
|
||||
* to use va_list p twice */
|
||||
va_list p2;
|
||||
|
||||
va_start(p, s);
|
||||
bb_vinfo_msg(s, p);
|
||||
va_copy(p2, p);
|
||||
if (logmode & LOGMODE_STDIO) {
|
||||
vprintf(s, p);
|
||||
fputs(msg_eol, stdout);
|
||||
}
|
||||
if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG))
|
||||
vsyslog(LOG_INFO, s, p2);
|
||||
va_end(p2);
|
||||
va_end(p);
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Utility routines.
|
||||
*
|
||||
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
|
||||
*
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include <syslog.h>
|
||||
|
||||
void bb_vinfo_msg(const char *s, va_list p)
|
||||
{
|
||||
/* va_copy is used because it is not portable
|
||||
* to use va_list p twice */
|
||||
va_list p2;
|
||||
va_copy(p2, p);
|
||||
if (logmode & LOGMODE_STDIO) {
|
||||
vprintf(s, p);
|
||||
fputs(msg_eol, stdout);
|
||||
}
|
||||
if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG))
|
||||
vsyslog(LOG_INFO, s, p2);
|
||||
va_end(p2);
|
||||
}
|
@ -64,16 +64,18 @@ done
|
||||
echo "Final link with: $BBOX_LIB_LIST"
|
||||
l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/'`
|
||||
# --verbose gives us gobs of info to stdout (e.g. linker script used)
|
||||
if ! test -f busybox_ldscript; then
|
||||
try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose" "$@" >busybox_ld.out ####|| exit 1
|
||||
#
|
||||
else
|
||||
echo "Custom linker script 'busybox_ldscript' found, using it"
|
||||
# Add SORT_BY_ALIGNMENT to linker script (found in busybox_ld.out):
|
||||
# .rodata : { *(.rodata SORT_BY_ALIGNMENT(.rodata.*) .gnu.linkonce.r.*) }
|
||||
# *(.data SORT_BY_ALIGNMENT(.data.*) .gnu.linkonce.d.*)
|
||||
# *(.bss SORT_BY_ALIGNMENT(.bss.*) .gnu.linkonce.b.*)
|
||||
# This will eliminate most of the data padding. Use linker script
|
||||
# by commenting "try" above and uncommenting this one (tested on i386):
|
||||
#try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose -Wl,-T -Wl,busybox_ldscript" "$@" >busybox_ld.out
|
||||
#
|
||||
try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose -Wl,-T -Wl,busybox_ldscript" "$@" >busybox_ld.out
|
||||
fi
|
||||
####}
|
||||
####rm busybox_ld.err
|
||||
####exit 0 # Ensure "success" exit code
|
||||
|
Loading…
x
Reference in New Issue
Block a user