If you `make allnoconfig menuconfig' and switch the shell on, the build will 
fail because test_main() isn't being built:

./sbin/ld: generated/obj/main.o:(.data.rel.toy_list+0xa8): undefined reference 
to `test_main'
/sbin/ld: generated/obj/main.o:(.data.rel.toy_list+0xc8): undefined reference 
to `test_main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:17: toybox] Error 1

This makes doing minimal builds of toybox with the shell more annoying since 
you have to make sure to switch on test.
The solution is to add "select TEST" into the config for the shell (CONFIG_SH).

Note: this would be the only time the "select" option is used by any config 
symbol in toybox.

-   Oliver Webb <aquahobby...@proton.me>
From 3b0f812f9980c70348937e095107e2f99ffe5565 Mon Sep 17 00:00:00 2001
From: Oliver Webb <aquahobby...@proton.me>
Date: Wed, 21 Feb 2024 16:10:27 -0600
Subject: [PATCH] toysh cannot build without test_main, make kconfig notice
 this

---
 toys/pending/sh.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/toys/pending/sh.c b/toys/pending/sh.c
index 2ca2aa01..2ac0de9e 100644
--- a/toys/pending/sh.c
+++ b/toys/pending/sh.c
@@ -71,6 +71,7 @@ USE_SH(OLDTOY(-bash, sh, 0))
 config SH
   bool "sh (toysh)"
   default n
+  select TEST
   help
     usage: sh [-c command] [script]
 
-- 
2.43.2

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to