Host dosfstools fails on openwrt-22.03

Greetings,

I'm trying to build openwrt-22.03 on my desktop and I get this error:

/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find @LIBICONV@: No such file or directory
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:449: fsck.fat] Error 1
make[5]: Leaving directory '/home/dagg/workspace/router/openwrt.git/build_dir/host/dosfstools-4.2/src'
make[4]: *** [Makefile:412: all-recursive] Error 1
make[4]: Leaving directory '/home/dagg/workspace/router/openwrt.git/build_dir/host/dosfstools-4.2'
make[3]: *** [Makefile:28: /home/dagg/workspace/router/openwrt.git/build_dir/host/dosfstools-4.2/.built] Error 2
make[3]: Leaving directory '/home/dagg/workspace/router/openwrt.git/tools/dosfstools'
time: tools/dosfstools/compile#2.45#0.31#11.84
    ERROR: tools/dosfstools failed to build.

the distro is gentoo, glibc version is 2.35 based

anyone knows it is fixed anywhere?

Seems you're missing something...

AM_ICONV is missing, cannot seem to find where it comes from

from what I understand, that macro comes from iconv.m4 which is part of gettext, e.g. gettext need to be installed,
I assume I need to create a makefile under tools/gettext however I'm not sure how to set the order as it needs to get build before dosfstools

Hello, have you solved the problem? I faced the similar problem like this what the error message is that:

make[5]: Entering directory '/Volumes/OpenWrt/openwrt/build_dir/host/dosfstools-4.2/src'
gcc -DPACKAGE_NAME=\"dosfstools\" -DPACKAGE_TARNAME=\"dosfstools\" -DPACKAGE_VERSION=\"4.2\" -DPACKAGE_STRING=\"dosfstools\ 4.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"dosfstools\" -DVERSION=\"4.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D__EXTENSIONS__=1 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 -D_TANDEM_SOURCE=1 -DHAVE_ERR_H=1 -DHAVE_SYS_DISK_H=1 -DHAVE_SYS_IOCCOM_H=1 -DHAVE_SYS_QUEUE_H=1 -DHAVE_ENDIAN_H=1 -DHAVE_LIBKERN_OSBYTEORDER_H=1 -DHAVE_VASPRINTF=1 -DHAVE_DECL_GETMNTENT=0 -DHAVE_DECL_GETMNTINFO=1 -I.  -I./blkdev -I/Volumes/OpenWrt/openwrt/staging_dir/host/include  -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -O2 -I/Volumes/OpenWrt/openwrt/staging_dir/host/include  -UHAVE_ENDIAN_H -MT testdevinfo-device_info.o -MD -MP -MF .deps/testdevinfo-device_info.Tpo -c -o testdevinfo-device_info.o `test -f 'device_info.c' || echo './'`device_info.c
mv -f .deps/testdevinfo-device_info.Tpo .deps/testdevinfo-device_info.Po
gcc -DPACKAGE_NAME=\"dosfstools\" -DPACKAGE_TARNAME=\"dosfstools\" -DPACKAGE_VERSION=\"4.2\" -DPACKAGE_STRING=\"dosfstools\ 4.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"dosfstools\" -DVERSION=\"4.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D__EXTENSIONS__=1 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 -D_TANDEM_SOURCE=1 -DHAVE_ERR_H=1 -DHAVE_SYS_DISK_H=1 -DHAVE_SYS_IOCCOM_H=1 -DHAVE_SYS_QUEUE_H=1 -DHAVE_ENDIAN_H=1 -DHAVE_LIBKERN_OSBYTEORDER_H=1 -DHAVE_VASPRINTF=1 -DHAVE_DECL_GETMNTENT=0 -DHAVE_DECL_GETMNTINFO=1 -I.  -I./blkdev -I/Volumes/OpenWrt/openwrt/staging_dir/host/include  -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -O2 -I/Volumes/OpenWrt/openwrt/staging_dir/host/include  -UHAVE_ENDIAN_H -MT blkdev/testdevinfo-blkdev.o -MD -MP -MF blkdev/.deps/testdevinfo-blkdev.Tpo -c -o blkdev/testdevinfo-blkdev.o `test -f 'blkdev/blkdev.c' || echo './'`blkdev/blkdev.c
mv -f blkdev/.deps/testdevinfo-blkdev.Tpo blkdev/.deps/testdevinfo-blkdev.Po
gcc -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -O2 -I/Volumes/OpenWrt/openwrt/staging_dir/host/include  -UHAVE_ENDIAN_H  -L/Volumes/OpenWrt/openwrt/staging_dir/host/lib  -o testdevinfo testdevinfo-testdevinfo.o testdevinfo-device_info.o blkdev/testdevinfo-blkdev.o blkdev/testdevinfo-linux_version.o  
gcc -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -O2 -I/Volumes/OpenWrt/openwrt/staging_dir/host/include  -UHAVE_ENDIAN_H  -L/Volumes/OpenWrt/openwrt/staging_dir/host/lib  -o fsck.fat check.o file.o fsck.fat.o lfn.o boot.o common.o fat.o io.o charconv.o @LIBICONV@ 
clang: error: no such file or directory: '@LIBICONV@'
make[5]: *** [Makefile:449: fsck.fat] Error 1
make[5]: Leaving directory '/Volumes/OpenWrt/openwrt/build_dir/host/dosfstools-4.2/src'
make[4]: *** [Makefile:399: all-recursive] Error 1
make[4]: Leaving directory '/Volumes/OpenWrt/openwrt/build_dir/host/dosfstools-4.2'
make[3]: *** [Makefile:28: /Volumes/OpenWrt/openwrt/build_dir/host/dosfstools-4.2/.built] Error 2
make[3]: Leaving directory '/Volumes/OpenWrt/openwrt/tools/dosfstools'
time: tools/dosfstools/compile#0.13#0.11#0.30
    ERROR: tools/dosfstools failed to build.
make[2]: *** [tools/Makefile:168: tools/dosfstools/compile] Error 1
make[2]: Leaving directory '/Volumes/OpenWrt/openwrt'
make[1]: *** [tools/Makefile:164: /Volumes/OpenWrt/openwrt/staging_dir/host/stamp/.tools_compile_yyynyyynnyyyyynyyyyyynyynyyynynyyyyyyyyyyyyyyyyynynnyyyyyyy] Error 2
make[1]: Leaving directory '/Volumes/OpenWrt/openwrt'
make: *** [/Volumes/OpenWrt/openwrt/include/toplevel.mk:230: world] Error 2

I built it from my macos.