macOS 14.5 - Failed to build toolchain/gcc/initial

Hi,

I am trying to build openwrt 23.05 but I am getthing this error:

ERROR: toolchain/gcc/initial failed to build.

When I run with make -j1 world V=sc, this is the stack trace I see at the end:

make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gdb'
g++ -x c++ -std=gnu++11   -I. -I. -I./config -DLOCALEDIR="\"/Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../readline/readline/.. -I./../zlib -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./../intl -I./../gnulib/import -I../gnulib/import -I./.. -I.. -I./../libbacktrace/ -I../libbacktrace/  -DTUI=1 -I/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/include    -I./.. -pthread  -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-mismatched-tags -Wno-error=deprecated-register -Wsuggest-override -Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -Wmissing-declarations -Wmissing-prototypes -Wformat -Wformat-nonliteral   -c -o gdb.o -MT gdb.o -MMD -MP -MF ./.deps/gdb.Tpo gdb.c
In file included from gdb.c:19:
In file included from ./defs.h:65:
./../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
    integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type
                                                   ^
1 error generated.
make[6]: *** [Makefile:1655: gdb.o] Error 1
make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gdb'
make[5]: *** [Makefile:11485: all-gdb] Error 2
make[5]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1'
make[4]: *** [Makefile:1031: all] Error 2
make[4]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1'
make[3]: *** [Makefile:75: /Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/.built] Error 2
make[3]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/toolchain/gdb'
time: toolchain/gdb/compile#1.43#0.64#2.68
    ERROR: toolchain/gdb failed to build.
make[2]: *** [toolchain/Makefile:93: toolchain/gdb/compile] Error 1
make[2]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt'
make[1]: *** [toolchain/Makefile:89: /Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl/stamp/.toolchain_compile] Error 2
make[1]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt'
make: *** [/Volumes/OpenWrt-23.05/openwrt/include/toplevel.mk:232: world] Error 2

I have updated all brew packages but still not luck. I am starting from a "fresh" pull from gitlab, so nothing special but it fails.
Anyone has an idea how to fix it?

Thanks

Please attach whole log, diffconfig etc.

Thanks brada4 for looking.
I attached all the logs.

env

PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"
PATH="/opt/homebrew/opt/gettext/bin:$PATH"
PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"
export PATH

diffconfig

CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_generic=y
CONFIG_TARGET_ath79_generic_DEVICE_8dev_carambola2=y

feeds

Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git^063b2393cbc3e5aab9d2b40b2911cab1c3967c59' ...
Cloning into './feeds/packages'...
remote: Enumerating objects: 205195, done.
remote: Counting objects: 100% (205195/205195), done.
remote: Compressing objects: 100% (86165/86165), done.
remote: Total 205195 (delta 120185), reused 191391 (delta 108402), pack-reused 0
Receiving objects: 100% (205195/205195), 53.66 MiB | 6.23 MiB/s, done.
Resolving deltas: 100% (120185/120185), done.
Updating files: 100% (4608/4608), done.
Switched to a new branch '063b2393cbc3e5aab9d2b40b2911cab1c3967c59'
/Volumes/OpenWrt-23.05/openwrt
Updating feed 'luci' from 'https://git.openwrt.org/project/luci.git^b07cf9dcfc37e021e5619a41c847e63afbd5d34a' ...
Cloning into './feeds/luci'...
remote: Enumerating objects: 39044, done.
remote: Counting objects: 100% (39044/39044), done.
remote: Compressing objects: 100% (6878/6878), done.
remote: Total 476812 (delta 34113), reused 33008 (delta 29606), pack-reused 437768
Receiving objects: 100% (476812/476812), 224.29 MiB | 6.67 MiB/s, done.
Resolving deltas: 100% (283852/283852), done.
Updating files: 100% (5178/5178), done.
Updating files: 100% (2919/2919), done.
Switched to a new branch 'b07cf9dcfc37e021e5619a41c847e63afbd5d34a'
/Volumes/OpenWrt-23.05/openwrt
Updating feed 'routing' from 'https://git.openwrt.org/feed/routing.git^648753932d5a7deff7f2bdb33c000018a709ad84' ...
Cloning into './feeds/routing'...
remote: Enumerating objects: 11402, done.
remote: Counting objects: 100% (11402/11402), done.
remote: Compressing objects: 100% (6913/6913), done.
remote: Total 11402 (delta 5245), reused 9082 (delta 3826), pack-reused 0
Receiving objects: 100% (11402/11402), 2.61 MiB | 1.52 MiB/s, done.
Resolving deltas: 100% (5245/5245), done.
Switched to a new branch '648753932d5a7deff7f2bdb33c000018a709ad84'
/Volumes/OpenWrt-23.05/openwrt
Updating feed 'telephony' from 'https://git.openwrt.org/feed/telephony.git^86af194d03592121f5321474ec9918dd109d3057' ...
Cloning into './feeds/telephony'...
remote: Enumerating objects: 11819, done.
remote: Counting objects: 100% (11819/11819), done.
remote: Compressing objects: 100% (7190/7190), done.
remote: Total 11819 (delta 6650), reused 8150 (delta 4394), pack-reused 0
Receiving objects: 100% (11819/11819), 2.39 MiB | 1.52 MiB/s, done.
Resolving deltas: 100% (6650/6650), done.
Switched to a new branch '86af194d03592121f5321474ec9918dd109d3057'
/Volumes/OpenWrt-23.05/openwrt
Create index file './feeds/packages.index'
Checking 'true'... ok.
Checking 'false'... ok.
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'proper-umask'... ok.
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses.h'... ok.
Checking 'git'... ok.
Checking 'rsync'... ok.
Checking 'perl-data-dumper'... ok.
Checking 'perl-findbin'... ok.
Checking 'perl-file-copy'... ok.
Checking 'perl-file-compare'... ok.
Checking 'perl-thread-queue'... ok.
Checking 'tar'... ok.
Checking 'find'... ok.
Checking 'bash'... ok.
Checking 'xargs'... ok.
Checking 'patch'... ok.
Checking 'diff'... ok.
Checking 'cp'... ok.
Checking 'seq'... ok.
Checking 'awk'... ok.
Checking 'grep'... ok.
Checking 'egrep'... ok.
Checking 'getopt'... ok.
Checking 'realpath'... ok.
Checking 'stat'... ok.
Checking 'gzip'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'install'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'python3'... ok.
Checking 'python3-distutils'... ok.
Checking 'python3-stdlib'... ok.
Checking 'file'... ok.
Checking 'which'... ok.
Checking 'ldconfig-stub'... ok.
Collecting package info: done
Collecting target info: done
Create index file './feeds/luci.index'
Collecting package info: done
Collecting target info: done
Create index file './feeds/routing.index'
Collecting package info: done
Collecting target info: done
Create index file './feeds/telephony.index'
Collecting package info: done
Collecting target info: done

make menuconfig

Collecting package info: done
Collecting target info: done
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

make

WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist
make[2]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/scripts/config'
cc -O2 -I/opt/homebrew/opt/php@5.6-debug/include -c -o conf.o conf.c
cc conf.o confdata.o expr.o lexer.lex.o menu.o parser.tab.o preprocess.o symbol.o util.o -o conf
make[2]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/scripts/config'
make[4]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/target/linux'
make[5]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/target/linux/ath79'
make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/target/linux/ath79/image'
make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/target/linux/ath79/image'
make[5]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/target/linux/ath79'
make[4]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/target/linux'
time: target/linux/prereq#1.40#0.10#1.54
make[1] world
make[2] tools/compile
make[2] package/cleanup
make[3] -C tools/flock compile
make[3] -C tools/xz compile
make[3] -C tools/sed compile
make[3] -C tools/libdeflate compile
make[3] -C tools/patch compile
make[3] -C tools/tar compile
make[3] -C tools/zlib compile
make[3] -C tools/ninja compile
make[3] -C tools/autoconf-archive compile
make[3] -C tools/gnulib compile
make[3] -C tools/lzma compile
make[3] -C tools/cpio compile
make[3] -C tools/expat compile
make[3] -C tools/m4 compile
make[3] -C tools/mtools compile
make[3] -C tools/patch-image compile
make[3] -C tools/sstrip compile
make[3] -C tools/zip compile
make[3] -C tools/lzma-old compile
make[3] -C tools/bash compile
make[3] -C tools/make-ext4fs compile
make[3] -C tools/squashfs3-lzma compile
make[3] -C tools/meson compile
make[3] -C tools/zstd compile
make[3] -C tools/pkgconf compile
make[3] -C tools/libressl compile
make[3] -C tools/autoconf compile
make[3] -C tools/automake compile
make[3] -C tools/missing-macros compile
make[3] -C tools/libtool compile
make[3] -C tools/dosfstools compile
make[3] -C tools/cmake compile
make[3] -C tools/e2fsprogs compile
make[3] -C tools/flex compile
make[3] -C tools/mklibs compile
make[3] -C tools/gmp compile
make[3] -C tools/patchelf compile
make[3] -C tools/gengetopt compile
make[3] -C tools/fakeroot compile
make[3] -C tools/mtd-utils compile
make[3] -C tools/bison compile
make[3] -C tools/mpfr compile
make[3] -C tools/mpc compile
make[3] -C tools/mkimage compile
make[3] -C tools/bc compile
make[3] -C tools/coreutils compile
make[3] -C tools/findutils compile
make[3] -C tools/quilt compile
make[3] -C tools/padjffs2 compile
make[3] -C tools/firmware-utils compile
make[3] -C tools/squashfs4 compile
make[2] toolchain/compile
make[3] -C toolchain/fortify-headers compile
make[3] -C toolchain/gdb compile
make[3] -C toolchain/binutils compile
make[3] -C toolchain/gcc/initial compile
ERROR: toolchain/gdb failed to build.
ERROR: toolchain/gcc/initial failed to build.
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/Volumes/OpenWrt-23.05/openwrt/include/toplevel.mk:232: world] Error 1

make debug

WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist
make[2]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/scripts/config'
make[1]: Entering directory '/Volumes/OpenWrt-23.05/openwrt'
make[2]: Entering directory '/Volumes/OpenWrt-23.05/openwrt'

  • mkdir -p /Volumes/OpenWrt-23.05/openwrt/staging_dir/target-mips_24kc_musl
  • cd /Volumes/OpenWrt-23.05/openwrt/staging_dir/target-mips_24kc_musl
  • mkdir -p bin lib stamp usr/include usr/lib
    mkdir -p /Volumes/OpenWrt-23.05/openwrt/build_dir/target-mips_24kc_musl/stamp
    touch /Volumes/OpenWrt-23.05/openwrt/staging_dir/target-mips_24kc_musl/.prepared
    make[3]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/toolchain/gdb'
    CFLAGS="-O2 -I/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/include " CPPFLAGS="-I/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/include " CXXFLAGS="" LDFLAGS="-L/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/lib " make -C /Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1
    make[4]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1'
    make[5]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libiberty'
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libiberty/testsuite'
    make[7]: Nothing to be done for 'all'.
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libiberty/testsuite'
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libiberty'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/intl'
    rm -f stamp-h1
    /usr/bin/env bash ./config.status config.h
    config.status: creating config.h
    config.status: config.h is unchanged
    test -f config.h || (rm -f stamp-h1 && make stamp-h1)
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/intl'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/zlib'
    true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-O2 -I/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/include " "CXXFLAGS=" "CFLAGS_FOR_BUILD=-O2 -I/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/include " "CFLAGS_FOR_TARGET=-g -O2 -minterlink-mips16" "INSTALL=/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/bin/ginstall -c" "INSTALL_DATA=/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/bin/ginstall -c -m 644" "INSTALL_PROGRAM=/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/bin/ginstall -c" "INSTALL_SCRIPT=/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/bin/ginstall -c" "LDFLAGS=-L/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/lib " "LIBCFLAGS=-O2 -I/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/include " "LIBCFLAGS_FOR_TARGET=-g -O2 -minterlink-mips16" "MAKE=make" "MAKEINFO=/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/missing makeinfo --split-size=5000000 --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/usr/bin/env bash" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl" "infodir=/Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl/share/info" "libdir=/Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl/lib" "prefix=/Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl" "tooldir=/Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl/mips-openwrt-linux-musl" "AR=ar " "AS=as" "CC=gcc" "CXX=g++" "LD=/Library/Developer/CommandLineTools/usr/bin/ld" "LIBCFLAGS=-O2 -I/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/include " "NM=nm" "PICFLAG=" "RANLIB=ranlib " "DESTDIR=" DO=all multi-do # make
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/zlib'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd'
    Making info in po
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd/po'
    make[7]: Nothing to be done for 'info'.
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd/po'
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd'
    make[7]: Circular doc/bfd.stamp <- doc/bfd.texi dependency dropped.
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd'
    make all-recursive
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd'
    Making all in po
    make[8]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd/po'
    make[8]: Nothing to be done for 'all'.
    make[8]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd/po'
    make[8]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd'
    make[8]: Circular doc/bfd.stamp <- doc/bfd.texi dependency dropped.
    make[8]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd'
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd'
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/bfd'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/opcodes'
    make all-recursive
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/opcodes'
    Making all in .
    make[8]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/opcodes'
    make[8]: Nothing to be done for 'all-am'.
    make[8]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/opcodes'
    Making all in po
    make[8]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/opcodes/po'
    make[8]: Nothing to be done for 'all'.
    make[8]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/opcodes/po'
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/opcodes'
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/opcodes'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/etc'
    make[6]: Nothing to be done for 'all'.
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/etc'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libbacktrace'
    make all-am
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libbacktrace'
    true DO=all multi-do # make
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libbacktrace'
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libbacktrace'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libdecnumber'
    make[6]: Nothing to be done for 'all'.
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libdecnumber'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/readline'
    Making all in readline
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/readline/readline'
    make[7]: Nothing to be done for 'all'.
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/readline/readline'
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/readline'
    make[7]: Nothing to be done for 'all-am'.
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/readline'
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/readline'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib'
    make all-recursive
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib'
    Making all in import
    make[8]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib/import'
    make all-recursive
    make[9]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib/import'
    make[10]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib/import'
    make[10]: Nothing to be done for 'all-am'.
    make[10]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib/import'
    make[9]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib/import'
    make[8]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib/import'
    make[8]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib'
    make[8]: Nothing to be done for 'all-am'.
    make[8]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib'
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib'
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gnulib'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gdbsupport'
    make all-am
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gdbsupport'
    make[7]: Nothing to be done for 'all-am'.
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gdbsupport'
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gdbsupport'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libctf'
    make all-am
    make[7]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libctf'
    make[7]: Nothing to be done for 'all-am'.
    make[7]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libctf'
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/libctf'
    make[6]: Entering directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gdb'
    g++ -x c++ -std=gnu++11 -I. -I. -I./config -DLOCALEDIR=""/Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl/share/locale"" -DHAVE_CONFIG_H -I./../include/opcode -I./../readline/readline/.. -I./../zlib -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./../intl -I./../gnulib/import -I../gnulib/import -I./.. -I.. -I./../libbacktrace/ -I../libbacktrace/ -DTUI=1 -I/Volumes/OpenWrt-23.05/openwrt/staging_dir/host/include -I./.. -pthread -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-mismatched-tags -Wno-error=deprecated-register -Wsuggest-override -Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -Wmissing-declarations -Wmissing-prototypes -Wformat -Wformat-nonliteral -c -o gdb.o -MT gdb.o -MMD -MP -MF ./.deps/gdb.Tpo gdb.c
    In file included from gdb.c:19:
    In file included from ./defs.h:65:
    ./../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
    integer_for_size<sizeof (T), static_cast(T (-1) < T (0))>::type
    ^
    1 error generated.
    make[6]: *** [Makefile:1655: gdb.o] Error 1
    make[6]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/gdb'
    make[5]: *** [Makefile:11485: all-gdb] Error 2
    make[5]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1'
    make[4]: *** [Makefile:1031: all] Error 2
    make[4]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1'
    make[3]: *** [Makefile:75: /Volumes/OpenWrt-23.05/openwrt/build_dir/toolchain-mips_24kc_gcc-12.3.0_musl/gdb-12.1/.built] Error 2
    make[3]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt/toolchain/gdb'
    time: toolchain/gdb/compile#1.42#0.46#2.29
    ERROR: toolchain/gdb failed to build.
    make[2]: *** [toolchain/Makefile:93: toolchain/gdb/compile] Error 1
    make[2]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt'
    make[1]: *** [toolchain/Makefile:89: /Volumes/OpenWrt-23.05/openwrt/staging_dir/toolchain-mips_24kc_gcc-12.3.0_musl/stamp/.toolchain_compile] Error 2
    make[1]: Leaving directory '/Volumes/OpenWrt-23.05/openwrt'
    make: *** [/Volumes/OpenWrt-23.05/openwrt/include/toplevel.mk:232: world] Error 2

You need to do "install feeds" step then restart at menucinfig.

I am following https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem

So I did:

./scripts/feeds update -a
./scripts/feeds install -a

cd /Volumes/OpenWrt-23.05/openwrt/package
git clone https://github.com/jerrykuku/luci-theme-argon.git
git clone https://github.com/jerrykuku/luci-app-argon-config.git
cd /Volumes/OpenWrt-23.05/openwrt

make menuconfig
make -j$(nproc) world

If I do again ./scripts/feeds install -a after menuconfig, I am still having the same issue

You need full package list available for menuconfig.

sorry, I don't understand.
menuconfig build fine. it's just once I try to build openwrt that if fails on building gcc

this is how I do my build:

./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
# I don't select anything in menuconfig because I just want to build the simplest openwrt
make -j$(nproc) world
# this fails at gcc compile

Last build that worked for me was v23.05.0-rc3 but now this also fails. I update all brew packages but still no luck.
I just tested on a fedora box and it works. so I think it's a version of one the package?

You need to get default build config and select a target device. It is your homebrew compiler not building gdb, probably you need other/older version to succeed.

This is about toolchain gdb for the build system, not about the installable package gbd for the router.

I think that this is about MacOS 14.5 incompatibility, if building on Fedora works, but fails on Mac.

Looking at the 23.05 source code, this specific MacOS issue in 23.05 is supposed to have been fixed by this 23.05 commit.

With the recent macOS update to Ventura, it looks like gdb could not be
compiled with clang16 and newer version, because it fails with:

./../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
    integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type

Are you sure that you have an up-to-date 23.05 HEAD sources?
What does ./scripts/getver.sh say?
You should have r23897-3287d82fcf

perus@ub2404:/OpenWrt/r7800-2305$ ./scripts/getver.sh
r23897-3287d82fcf

Ps. some comment to these pieces of advice...

Feeds are not needed at all, as packages have no role for the toolchain.

For the toolchain itself, the main repo should be enough. (and also the package gdb is in the main repo.)

The build system defaults to first device in ath79 is user does nothing. (like shown in the logs)

Note that there have recently been several MacOS build fixes in the main/master, so it is quite possible that some of those fixes might be needed also for the old 23.05. If you have up-to-date sources and still fail, you might create an issue.

Or actually, I just noticed that there is already an issue about this...

Please comment there, if you still fail with up-to-date OpenWrt 23.05 sources.
(looks like devs think that 23.05 is fixed with the commit I mentioned previously, but not 22.03)

Thanks a lot hnyman, I am trying to compile 23.05 and I see that I have the patch: toolchain/gdb/patches/0001-gdbsupport-ignore-Wenum-constexpr-conversion-in-enum.patch but still getting the error. I will write a comment in the git ticket.

Do I need to do something to apply the patch maybe? That's unclear to me.