Errors During BusyBox Compilation

Hi,
I encountered following errors while building BusyBox.
Im using busybox
and latest cross compiler toolchain

I am building BusyBox with static binaries, selected via menuconfig. The steps I followed for building BusyBox are:
1.make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- defconfig
2.make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- CONFIG_PREFIX=/home/fastbit/EMB_LS_WS/workspace/RFS_Static install

However, I encountered the following errors,

networking/tc.c: In function ‘cbq_print_opt’:
networking/tc.c:236:27: error: ‘TCA_CBQ_MAX’ undeclared (first use in this function); did you mean ‘TCA_CBS_MAX’?
236 | struct rtattr *tb[TCA_CBQ_MAX+1];
| ^~~~~~~~~~~
| TCA_CBS_MAX
networking/tc.c:236:27: note: each undeclared identifier is reported only once for each function it appears in
networking/tc.c:249:16: error: ‘TCA_CBQ_RATE’ undeclared (first use in this function); did you mean ‘TCA_TBF_RATE64’?
249 | if (tb[TCA_CBQ_RATE]) {
| ^~~~~~~~~~~~
| TCA_TBF_RATE64
networking/tc.c:255:16: error: ‘TCA_CBQ_LSSOPT’ undeclared (first use in this function)
255 | if (tb[TCA_CBQ_LSSOPT]) {
| ^~~~~~~~~~~~~~
networking/tc.c:256:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_lssopt’
256 | if (RTA_PAYLOAD(tb[TCA_CBQ_LSSOPT]) < sizeof(*lss))
| ^
networking/tc.c:261:16: error: ‘TCA_CBQ_WRROPT’ undeclared (first use in this function)
261 | if (tb[TCA_CBQ_WRROPT]) {
| ^~~~~~~~~~~~~~
networking/tc.c:262:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_wrropt’
262 | if (RTA_PAYLOAD(tb[TCA_CBQ_WRROPT]) < sizeof(*wrr))
| ^
networking/tc.c:267:16: error: ‘TCA_CBQ_FOPT’ undeclared (first use in this function)
267 | if (tb[TCA_CBQ_FOPT]) {
| ^~~~~~~~~~~~
networking/tc.c:268:59: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_fopt’
268 | if (RTA_PAYLOAD(tb[TCA_CBQ_FOPT]) < sizeof(*fopt))
| ^
networking/tc.c:273:16: error: ‘TCA_CBQ_OVL_STRATEGY’ undeclared (first use in this function)
273 | if (tb[TCA_CBQ_OVL_STRATEGY]) {
| ^~~~~~~~~~~~~~~~~~~~
networking/tc.c:274:67: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_ovl’
274 | if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(*ovl))
| ^
networking/tc.c:277:50: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_ovl’
277 | (unsigned) sizeof(*ovl));
| ^
networking/tc.c:293:23: error: invalid use of undefined type ‘struct tc_cbq_lssopt’
293 | if (lss && lss->flags) {
| ^~
networking/tc.c:296:24: error: invalid use of undefined type ‘struct tc_cbq_lssopt’
296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) {
| ^~
networking/tc.c:296:32: error: ‘TCF_CBQ_LSS_BOUNDED’ undeclared (first use in this function)
296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) {
| ^~~~~~~~~~~~~~~~~~~
networking/tc.c:300:24: error: invalid use of undefined type ‘struct tc_cbq_lssopt’
300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) {
| ^~
networking/tc.c:300:32: error: ‘TCF_CBQ_LSS_ISOLATED’ undeclared (first use in this function)
300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) {
| ^~~~~~~~~~~~~~~~~~~~
networking/tc.c:308:24: error: invalid use of undefined type ‘struct tc_cbq_wrropt’
308 | if (wrr->priority != TC_CBQ_MAXPRIO)
| ^~
networking/tc.c:308:38: error: ‘TC_CBQ_MAXPRIO’ undeclared (first use in this function)
308 | if (wrr->priority != TC_CBQ_MAXPRIO)
| ^~~~~~~~~~~~~~
networking/tc.c:309:46: error: invalid use of undefined type ‘struct tc_cbq_wrropt’
309 | printf(“prio %u”, wrr->priority);
| ^~
networking/tc.c:313:43: error: invalid use of undefined type ‘struct tc_cbq_wrropt’
313 | printf("/%u ", wrr->cpriority);
| ^~
networking/tc.c:314:32: error: invalid use of undefined type ‘struct tc_cbq_wrropt’
314 | if (wrr->weight != 1) {
| ^~
networking/tc.c:315:65: error: invalid use of undefined type ‘struct tc_cbq_wrropt’
315 | print_rate(buf, sizeof(buf), wrr->weight);
| ^~
networking/tc.c:318:32: error: invalid use of undefined type ‘struct tc_cbq_wrropt’
318 | if (wrr->allot)
| ^~
networking/tc.c:319:57: error: invalid use of undefined type ‘struct tc_cbq_wrropt’
319 | printf("allot %ub ", wrr->allot);
| ^~
networking/tc.c:236:24: warning: unused variable ‘tb’ [-Wunused-variable]
236 | struct rtattr *tb[TCA_CBQ_MAX+1];
| ^~
make[1]: *** [scripts/Makefile.build:198: networking/tc.o] Error 1
make: *** [Makefile:744: networking] Error 2

I would appreciate any guidance on resolving this issue.

Thanks in advance.

I don’t use busybox to build with, however, your error messages appear to from a missing header.

Go to the top of the tree you are building out of and try this:

$awk '/TCA_CQB_MAX/ {print}' /path/to/file

If you can find that you will need to figure out how to modify the search paths/add to them or what ever it may take.
If that is totally missing from the tree you are working from, you have a much greater problem.

Hello foxsquirrel,
Thanks for your response and support.

i executed the command
$awk ‘/TCA_CQB_MAX/ {print}’ networking/tc.c/

but there is no definition of the macro “TCA_CQB_MAX”.

Not good, that would make one assume its not in the package.
All I might do in this situation is try make solid guesses, like versions, config variables.

First I would build an image that is known to work and establish a base. That would indicate you have the framework properly installed and can proceed with new material. That will eliminate the framework, then proceed to your build. Do the most simple and bare minimum and if it works add tiny pieces at a time until it breaks. That will get you closer.

I most certainly do not have a very good answer for you on this. Sometimes you spend days trying to get things going, that costs money.

If busybox has a forum most certainly reach out to them before trying anything else, it might just be a very simple fix.

One last thought, back peddle to mid 5.x kernels and try that, it takes a while for changes to propagate down stream. If that macro is not even found something is wrong, branch maybe??

Hi foxsquirrel,

Thank you so much for your detailed response. I really appreciate the guidance and the steps you suggested to troubleshoot the issue. Your advice on building a known working image first and then adding components incrementally makes a lot of sense.

I’ll definitely try reaching out to the BusyBox forum as well for further assistance. Your suggestion to revert to mid 5.x kernels is also noted.

Thanks again for your help and for sharing your insights!

Best regards,
Anil.