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

Oliver Webb aquahobbyist at proton.me
Wed Feb 21 17:24:04 PST 2024


On Wednesday, February 21st, 2024 at 17:56, Rob Landley <rob at landley.net> wrote:
> 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.

When trying to make a minimal config, it's often more convenient to work UP from allnoconfig, than taking 
stuff out of defconfig (or allyesconfig) until you have what you want. When I said "minimal builds" I was more talking about
builds with the shell and a few other commands (Which from my knowledge of the build infrastructure, "make sh" 
can't replicate since it unsets $DEPENDS before scanning for stuff) than builds with only the shell.

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

Works perfectly, Thanks.

> Rob

-   Oliver Webb <aquahobbyist at proton.me>


More information about the Toybox mailing list