Compiling error

Until maybe 10 days ago I had been able to compile master builds with no problem whatsoever. Today I was unable to do so and cannot find the problem.

Was there any change in the prerequisites for compiling? I noticed that openwrt now defaults GCC to version 8.4. Maybe it's something related to it?

This is the compiling error that I keep getting:

make[4]: Leaving directory '/home/roger/Downloads/openwrt/build_dir/host/gmp-6.2.0'
mkdir -p /home/roger/Downloads/openwrt/staging_dir/host/stamp
touch /home/roger/Downloads/openwrt/build_dir/host/gmp-6.2.0/.built
touch /home/roger/Downloads/openwrt/staging_dir/host/stamp/.gmp_installed
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/gmp'
time: tools/gmp/compile#103.82#22.36#87.77
make[2]: Leaving directory '/home/roger/Downloads/openwrt'
make[1]: *** [tools/Makefile:159: /home/roger/Downloads/openwrt/staging_dir/host/stamp/.tools_compile_yynyynnyyynyyyyynyynnyyyynyyyyyyyyyyyyyyynynynnyyynnyyy] Error 2
make[1]: Leaving directory '/home/roger/Downloads/openwrt'
make: *** [/home/roger/Downloads/openwrt/include/toplevel.mk:227: world] Error 2

State the OS you're using, rerun make with V=s -j1 and post full output. What you pasted is not showing the actual error.

make clean to the rescue

I'm using Debian 10. I had tried make clean before but no success. In fact, the error appears even after a fresh git clone command.

Anyway, this is the output of make V=s -j1:

roger@debian:~/Downloads/openwrt$ make clean
 make[1] clean
roger@debian:~/Downloads/openwrt$ make V=s -j1
time: target/linux/prereq#0.33#0.10#0.43
make[1]: Entering directory '/home/roger/Downloads/openwrt'
make[2]: Entering directory '/home/roger/Downloads/openwrt'
+ mkdir -p /home/roger/Downloads/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi
+ cd /home/roger/Downloads/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi
+ mkdir -p bin lib stamp
mkdir -p /home/roger/Downloads/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp
touch /home/roger/Downloads/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/.prepared
+ mkdir -p /home/roger/Downloads/openwrt/staging_dir/host
+ cd /home/roger/Downloads/openwrt/staging_dir/host
+ mkdir -p bin lib stamp
mkdir -p /home/roger/Downloads/openwrt/build_dir/host/stamp /home/roger/Downloads/openwrt/staging_dir/host/include/sys
install -m0644 /home/roger/Downloads/openwrt/tools/include/*.h /home/roger/Downloads/openwrt/staging_dir/host/include/
install -m0644 /home/roger/Downloads/openwrt/tools/include/sys/*.h /home/roger/Downloads/openwrt/staging_dir/host/include/sys/
ln -snf lib /home/roger/Downloads/openwrt/staging_dir/host/lib64
touch /home/roger/Downloads/openwrt/staging_dir/host/.prepared
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/flock'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/flock'
time: tools/flock/compile#0.05#0.02#0.08
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/xz'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/xz'
time: tools/xz/compile#0.06#0.03#0.10
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/sed'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/sed'
time: tools/sed/compile#0.07#0.02#0.09
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/patch'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/patch'
time: tools/patch/compile#0.07#0.02#0.09
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/tar'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/tar'
time: tools/tar/compile#0.09#0.04#0.15
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/m4'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/m4'
time: tools/m4/compile#0.11#0.06#0.17
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/autoconf'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/autoconf'
time: tools/autoconf/compile#0.09#0.03#0.14
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/pkgconf'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/pkgconf'
time: tools/pkgconf/compile#0.15#0.07#0.24
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/automake'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/automake'
time: tools/automake/compile#0.09#0.07#0.18
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/missing-macros'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/missing-macros'
time: tools/missing-macros/compile#0.06#0.02#0.11
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/libtool'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/libtool'
time: tools/libtool/compile#0.10#0.05#0.25
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/gmp'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/gmp'
time: tools/gmp/compile#0.18#0.04#0.22
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/mpfr'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/mpfr'
time: tools/mpfr/compile#0.09#0.01#0.11
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/mpc'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/mpc'
time: tools/mpc/compile#0.06#0.03#0.09
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/libelf'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/libelf'
time: tools/libelf/compile#0.07#0.02#0.12
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/expat'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/expat'
time: tools/expat/compile#0.11#0.05#0.17
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/flex'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/flex'
time: tools/flex/compile#0.08#0.04#0.17
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/bison'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/bison'
time: tools/bison/compile#0.11#0.07#0.19
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/mklibs'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/mklibs'
time: tools/mklibs/compile#0.10#0.04#0.20
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/libressl'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/libressl'
time: tools/libressl/compile#0.20#0.04#0.22
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/cmake'
GCC version greater or equal to 6.0 detected, no workaround set for CCACHE
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/cmake'
time: tools/cmake/compile#0.35#0.19#0.39
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/zlib'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/zlib'
time: tools/zlib/compile#0.08#0.02#0.15
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/sstrip'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/sstrip'
time: tools/sstrip/compile#0.07#0.03#0.13
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/make-ext4fs'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/make-ext4fs'
time: tools/make-ext4fs/compile#0.24#0.14#0.40
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/e2fsprogs'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/e2fsprogs'
time: tools/e2fsprogs/compile#0.17#0.06#0.32
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/mtd-utils'
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/mtd-utils'
time: tools/mtd-utils/compile#0.10#0.03#0.14
make[3]: Entering directory '/home/roger/Downloads/openwrt/tools/mkimage'
make -C /home/roger/Downloads/openwrt/build_dir/host/u-boot-2019.07 HOSTCFLAGS="-O2 -I/home/roger/Downloads/openwrt/staging_dir/host/include " HOSTLDFLAGS="-L/home/roger/Downloads/openwrt/staging_dir/host/lib " no-dot-config-targets=tools-only CONFIG_MKIMAGE_DTC_PATH=dtc CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000 tools-only
make[4]: Entering directory '/home/roger/Downloads/openwrt/build_dir/host/u-boot-2019.07'
  HOSTCC  scripts/basic/fixdep
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  HOSTCC  tools/mkenvimage.o
In file included from include/stdlib.h:9:0,
                 from ././include/compiler.h:23,
                 from <command-line>:0:
include/malloc.h:875:22: error: missing binary operator before token "("
 #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
                      ^
include/malloc.h:955:8: error: unknown type name 'ulong'
 extern ulong mem_malloc_start;
        ^
include/malloc.h:956:8: error: unknown type name 'ulong'
 extern ulong mem_malloc_end;
        ^
include/malloc.h:957:8: error: unknown type name 'ulong'
 extern ulong mem_malloc_brk;
        ^
include/malloc.h:959:22: error: unknown type name 'ulong'
 void mem_malloc_init(ulong start, ulong size);
                      ^
include/malloc.h:959:35: error: unknown type name 'ulong'
 void mem_malloc_init(ulong start, ulong size);
                                   ^
In file included from ././include/compiler.h:25:0,
                 from <command-line>:0:
include/stdio.h:18:14: error: expected declaration specifiers or '...' before numeric constant
 int __printf(1, 2) printf(const char *fmt, ...);
              ^
include/stdio.h:18:17: error: expected declaration specifiers or '...' before numeric constant
 int __printf(1, 2) printf(const char *fmt, ...);
                 ^
include/stdio.h:53:14: error: expected declaration specifiers or '...' before numeric constant
 int __printf(2, 3) fprintf(int file, const char *fmt, ...);
              ^
include/stdio.h:53:17: error: expected declaration specifiers or '...' before numeric constant
 int __printf(2, 3) fprintf(int file, const char *fmt, ...);
                 ^
In file included from include/string.h:1:0,
                 from ././include/compiler.h:26,
                 from <command-line>:0:
include/linux/string.h:21:24: fatal error: asm/string.h: No such file or directory
compilation terminated.
make[5]: *** [scripts/Makefile.host:114: tools/mkenvimage.o] Error 1
make[4]: *** [Makefile:1788: tools-only] Error 2
make[4]: Leaving directory '/home/roger/Downloads/openwrt/build_dir/host/u-boot-2019.07'
make[3]: *** [Makefile:49: /home/roger/Downloads/openwrt/build_dir/host/u-boot-2019.07/.built] Error 2
make[3]: Leaving directory '/home/roger/Downloads/openwrt/tools/mkimage'
time: tools/mkimage/compile#0.68#0.25#1.08
make[2]: *** [tools/Makefile:163: tools/mkimage/compile] Error 2
make[2]: Leaving directory '/home/roger/Downloads/openwrt'
make[1]: *** [tools/Makefile:159: /home/roger/Downloads/openwrt/staging_dir/host/stamp/.tools_compile_yynyynnyyynyyyyynyynnyyyynyyyyyyyyyyyyyyynynynnyyynnyyy] Error 2
make[1]: Leaving directory '/home/roger/Downloads/openwrt'
make: *** [/home/roger/Downloads/openwrt/include/toplevel.mk:227: world] Error 2

Found the culprit. A few days ago I installed Homebrew and the installation messed up with the $PATH variable. All good now.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.