Busybox not compiling

Hi all,

make[4]: Entering directory '/home/zack/openwrt/build_dir/target-x86_64_musl/busybox-1.31.1'                                            
  CC      editors/vi.o                                                                                                                  
editors/vi.c: In function 'char_search':                                                                                                                                                                                                                                        
editors/vi.c:2153:2: error: 're_syntax_options' undeclared (first use in this function)                                                 
  re_syntax_options = RE_SYNTAX_POSIX_EXTENDED;                                                                                         
  ^~~~~~~~~~~~~~~~~                                                                                                                     
editors/vi.c:2153:2: note: each undeclared identifier is reported only once for each function it appears in                             
editors/vi.c:2153:22: error: 'RE_SYNTAX_POSIX_EXTENDED' undeclared (first use in this function); did you mean 'IF_FEATURE_NAMEIF_EXTENDED'?                                                                                                                                     
  re_syntax_options = RE_SYNTAX_POSIX_EXTENDED;                                                                                                                                                                                                                                 
                      ^~~~~~~~~~~~~~~~~~~~~~~~                                                                                          
                      IF_FEATURE_NAMEIF_EXTENDED                                                                                        
editors/vi.c:2155:50: error: 'RE_ICASE' undeclared (first use in this function); did you mean 'REG_ICASE'?                              
   re_syntax_options = RE_SYNTAX_POSIX_EXTENDED | RE_ICASE;                                                                                                                                                                                                                     
                                                  ^~~~~~~~                                                                              
                                                  REG_ICASE                                                                             
editors/vi.c:2158:8: error: implicit declaration of function 're_compile_pattern'; did you mean 'recursive_action'? [-Werror=implicit-function-declaration]                                                                                                                     
  err = re_compile_pattern(pat, strlen(pat), &preg);                                                                                    
        ^~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                      
        recursive_action                                                                                                                
editors/vi.c:2158:6: error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]                                                                                                                                          
  err = re_compile_pattern(pat, strlen(pat), &preg);                                                                                    
      ^              
editors/vi.c:2192:6: error: implicit declaration of function 're_search'; did you mean 'bsearch'? [-Werror=implicit-function-declaration]                                                                                                                                       
  i = re_search(&preg, q, size, /*start:*/ 0, range, /*struct re_registers*:*/ NULL);
      ^~~~~~~~~
      bsearch
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:198: editors/vi.o] Error 1
make[4]: *** [Makefile:743: editors] Error 2
make[4]: Leaving directory '/home/zack/openwrt/build_dir/target-x86_64_musl/busybox-1.31.1'
make[3]: *** [Makefile:126: /home/zack/openwrt/build_dir/target-x86_64_musl/busybox-1.31.1/.built] Error 2                              
make[3]: Leaving directory '/home/zack/openwrt/package/utils/busybox'
time: package/utils/busybox/compile#1.38#1.41#2.60
make[2]: *** [package/Makefile:113: package/utils/busybox/compile] Error 2

This seems to be happening for me since the update to busybox 1.31.1: 5b3f0e70a10e551afce27aeb826caaee3889829c

Any ideas?

Thanks.

Try make toolchain/clean and then try again.

Would clean (and then distclean) have done the same thing? Trying anyway.. thank youu

How do I rebuild the toolchain? make toolchain says up-to-date.

scripts/kconfig/conf  --syncconfig Kconfig
./scripts/gcc-version.sh: line 26: x86_64-openwrt-linux-musl-gcc: command not found
./scripts/gcc-version.sh: line 27: x86_64-openwrt-linux-musl-gcc: command not found
./scripts/gcc-version.sh: line 29: x86_64-openwrt-linux-musl-gcc: command not found
./scripts/gcc-version.sh: line 26: x86_64-openwrt-linux-musl-gcc: command not found
./scripts/gcc-version.sh: line 27: x86_64-openwrt-linux-musl-gcc: command not found
./scripts/gcc-version.sh: line 29: x86_64-openwrt-linux-musl-gcc: command not found
init/Kconfig:17: syntax error
init/Kconfig:16: invalid option
./scripts/clang-version.sh: line 15: x86_64-openwrt-linux-musl-gcc: command not found
./scripts/gcc-plugin.sh: line 11: x86_64-openwrt-linux-musl-gcc: command not found
net/sched/Kconfig:44: warning: menuconfig statement without prompt
make[7]: *** [scripts/kconfig/Makefile:69: syncconfig] Error 1
make[6]: *** [Makefile:539: syncconfig] Error 2
Makefile:626: include/config/auto.conf.cmd: No such file or directory
make[5]: *** [Makefile:638: include/config/auto.conf.cmd] Error 2
make[5]: Leaving directory '/home/zack/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.82'
make[4]: *** [Makefile:25: /home/zack/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.82/.modules] Error 2
make[4]: Leaving directory '/home/zack/openwrt/target/linux/x86'
make[3]: *** [Makefile:13: compile] Error 2
make[3]: Leaving directory '/home/zack/openwrt/target/linux'
time: target/linux/compile#15.58#13.37#22.89
make[2]: *** [target/Makefile:25: target/linux/compile] Error 2
make[2]: Leaving directory '/home/zack/openwrt'
make[1]: *** [target/Makefile:18: /home/zack/openwrt/staging_dir/target-x86_64_musl/stamp/.target_compile] Error 2
make[1]: Leaving directory '/home/zack/openwrt'
make: *** [/home/zack/openwrt/include/toplevel.mk:227: world] Error 2

If you're using bash make toolchain/{clean,compile}
And no, clean and distclean are way more aggressive. Clean may do the same but disclean will wipe out your configuration and downloaded feeds/source packages.

Ah, thank you.

Found that out the hard way yesterday. :slight_smile: I should have read the docs.. :smiley:

  CC      editors/vi.o
editors/vi.c: In function 'char_search':
editors/vi.c:2153:2: error: 're_syntax_options' undeclared (first use in this function)
  re_syntax_options = RE_SYNTAX_POSIX_EXTENDED;
  ^~~~~~~~~~~~~~~~~
editors/vi.c:2153:2: note: each undeclared identifier is reported only once for each function it appears in
editors/vi.c:2153:22: error: 'RE_SYNTAX_POSIX_EXTENDED' undeclared (first use in this function); did you mean 'IF_FEATURE_NAMEIF_EXTEN
DED'?
  re_syntax_options = RE_SYNTAX_POSIX_EXTENDED;
                      ^~~~~~~~~~~~~~~~~~~~~~~~
                      IF_FEATURE_NAMEIF_EXTENDED
editors/vi.c:2155:50: error: 'RE_ICASE' undeclared (first use in this function); did you mean 'REG_ICASE'?
   re_syntax_options = RE_SYNTAX_POSIX_EXTENDED | RE_ICASE;
                                                  ^~~~~~~~
                                                  REG_ICASE
editors/vi.c:2158:8: error: implicit declaration of function 're_compile_pattern'; did you mean 'recursive_action'? [-Werror=implicit-
function-declaration]
  err = re_compile_pattern(pat, strlen(pat), &preg);
        ^~~~~~~~~~~~~~~~~~
        recursive_action
editors/vi.c:2158:6: error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
  err = re_compile_pattern(pat, strlen(pat), &preg);
      ^
editors/vi.c:2192:6: error: implicit declaration of function 're_search'; did you mean 'bsearch'? [-Werror=implicit-function-declarati
on]
  i = re_search(&preg, q, size, /*start:*/ 0, range, /*struct re_registers*:*/ NULL);
      ^~~~~~~~~
      bsearch
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:198: editors/vi.o] Error 1

The issue still occurs for me. :frowning:

My .config is here https://termbin.com/xy2w, maybe I've enabled contradictory options?

Simplify -- see if you can build without all those options.

If not, it's most likely your build environment.

If so, start adding in options slowly (or keep track with bisection) and find out what is causing you problems.

The problematic option is

CONFIG_BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH=y

Successfully compiling diffconfig: https://paste.ubuntu.com/p/B88sKhQ4Tz/
Not working diffconfig: https://paste.ubuntu.com/p/PHWYZRr6MF/

There appears to be a problem with enabling regex search in busybox vi.

Also mentioned here: https://github.com/openwrt/packages/issues/4453

cat ../package/utils/busybox/config/editors/Config.in | grep -C1 FIXME

You probably want to test some include in vi.c to binutils ( regex.c ? ) ... or similar within Makefile...