[Toybox] [PATCH] toysh can't build without test_main, get kconfig to do something about this.

Rob Landley rob at landley.net
Wed Feb 21 16:04:04 PST 2024


On 2/21/24 16:47, Oliver Webb via Toybox wrote:
> 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

Sigh, the config is right it's the "what files should the build compile" logic
that's wrong.

> This makes doing minimal builds of toybox with the shell more annoying since you have
> to make sure to switch on test.

"make sh" was handling that. Also, when you do it your way you're missing stuff
like "help" that you might want.

> 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.

Nope, wrong fix. Try commit 1e3708a91268.

Rob


More information about the Toybox mailing list