[bug] busybox fails building in init.c
Erik Hovland
erik at hovland.org
Thu Jun 1 21:07:02 UTC 2006
package: busybox
version: trunk
When I attempt to build busybox using 'make allyesconfig' then disabling
SE Linux, then typing 'make busybox', busybox fails attempting to find
some symbols because they are hidden behind macros.
Make error:
/export/home/build/handhelds/busybox-trunk/init/init.c:178: warning: 'shutdown_signal' used but never defined
/export/home/build/handhelds/busybox-trunk/init/init.c:146: warning: 'got_cont' defined but not used
applets.c:(.text+0x9dcc0): undefined reference to `shutdown_signal.549418'
collect2: ld returned 1 exit status
make[1]: *** [busybox_unstripped] Error 1
make: *** [busybox] Error 2
The attached patch makes the functions available (but will also increase
the size of busybox since they make the functions always compile in).
I should add that this issue is a direct result of svn commit:
--------------------
Author: pgf
Date: 2006-06-01 06:17:49 -0700 (Thu, 01 Jun 2006)
New Revision: 15259
Log:
make halt and poweroff messages more accurate (i.e., claim "we're about
to", rather than "it's done", and combine with reboot handler to save
space.
--------------------
Thanks
E
--
Erik Hovland
mail: erik AT hovland DOT org
web: http://hovland.org/
PGP/GPG public key available on request
-------------- next part --------------
Index: init/init.c
===================================================================
--- init/init.c (revision 15261)
+++ init/init.c (working copy)
@@ -143,7 +143,9 @@
#ifndef CONFIG_SYSLOGD
static char *log_console = VC_5;
#endif
+#if !ENABLE_DEBUG_INIT
static sig_atomic_t got_cont = 0;
+#endif
enum {
LOG = 0x1,
@@ -639,7 +641,6 @@
}
}
-#if !ENABLE_DEBUG_INIT
static void init_reboot(unsigned long magic)
{
pid_t pid;
@@ -695,6 +696,35 @@
sync();
}
+static void shutdown_signal(int sig)
+{
+ char *m;
+ int rb;
+
+ shutdown_system();
+
+ if (sig == SIGTERM) {
+ m = "reboot";
+ rb = RB_AUTOBOOT;
+ } else if (sig == SIGUSR2) {
+ m = "poweroff";
+ rb = RB_POWER_OFF;
+ } else {
+ m = "halt";
+ rb = RB_HALT_SYSTEM;
+ }
+ message(CONSOLE | LOG, "Requesting system %s.", m);
+ sync();
+
+ /* allow time for last message to reach serial console */
+ sleep(2);
+
+ init_reboot(rb);
+
+ loop_forever();
+}
+
+#if !ENABLE_DEBUG_INIT
static void exec_signal(int sig ATTRIBUTE_UNUSED)
{
struct init_action *a, *tmp;
@@ -746,34 +776,6 @@
}
}
-static void shutdown_signal(int sig)
-{
- char *m;
- int rb;
-
- shutdown_system();
-
- if (sig == SIGTERM) {
- m = "reboot";
- rb = RB_AUTOBOOT;
- } else if (sig == SIGUSR2) {
- m = "poweroff";
- rb = RB_POWER_OFF;
- } else {
- m = "halt";
- rb = RB_HALT_SYSTEM;
- }
- message(CONSOLE | LOG, "Requesting system %s.", m);
- sync();
-
- /* allow time for last message to reach serial console */
- sleep(2);
-
- init_reboot(rb);
-
- loop_forever();
-}
-
static void ctrlaltdel_signal(int sig ATTRIBUTE_UNUSED)
{
run_actions(CTRLALTDEL);
More information about the busybox
mailing list