libbb: mark scripted_main() as externally visible
authorRon Yorston <rmy@pobox.com>
Sat, 30 Mar 2019 07:47:12 +0000 (07:47 +0000)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 30 Mar 2019 15:46:27 +0000 (16:46 +0100)
Building with individual binaries enabled fails when embedded
script applets are included:

   /tmp/ccIvMFZg.o: In function `main':
   applet.c:(.text.main+0x20): undefined reference to `scripted_main'

Mark scripted_main() as externally visible.

Reported-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
include/libbb.h
libbb/appletlib.c

index e0d5521e489ee1b1cae419885b7bbd040f429491..a20d5e4032286062ac95d230e288236778cfc9d2 100644 (file)
@@ -1347,7 +1347,7 @@ void bb_logenv_override(void) FAST_FUNC;
 
 /* Embedded script support */
 char *get_script_content(unsigned n) FAST_FUNC;
-int scripted_main(int argc, char** argv);
+int scripted_main(int argc, char** argv) MAIN_EXTERNALLY_VISIBLE;
 
 /* Applets which are useful from another applets */
 int bb_cat(char** argv) FAST_FUNC;
index c15014a343ac83ac61e53b3e0532be03d01cbbf1..fa19e848889938a0d625b94d9a31a77168705e10 100644 (file)
@@ -770,6 +770,7 @@ static int find_script_by_name(const char *name)
        return -1;
 }
 
+int scripted_main(int argc UNUSED_PARAM, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int scripted_main(int argc UNUSED_PARAM, char **argv)
 {
        int script = find_script_by_name(applet_name);