Build Failure: gnutls 3.7.8 latest snapshot

Hi all,

I'm currently having issues building for the past 24 hrs (using latest master as of this writing). My builds are failing when it tries to build gnutls 3.7.8 for x86 (x86_64) and ramips (mipsel_24kc).

As for trying to figure out the issue, I tried compiling the package manually using

make package/feeds/packages/gnutls/{clean,compile} V=sc

Error output for x86

make[3]: Entering directory '/home/xxxxxxxx/openwrt/openwrt/build_dir/target-x86_64_musl/gnutls-3.7.8'
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/xxxxxxxx/openwrt/openwrt/build_dir/target-x86_64_musl/gnutls-3.7.8/build-aux/missing aclocal-1.16 -I m4 -I src/gl/m4 -I lib/unistring/m4 --install
m4/gnulib-comp.m4:427: warning: macro 'AM_STDBOOL_H' not found in library
src/gl/m4/gnulib-comp.m4:802: warning: macro 'AM_STDBOOL_H' not found in library
lib/unistring/m4/gnulib-comp.m4:166: warning: macro 'AM_STDBOOL_H' not found in library
missing file gl/stdio-read.c
configure.ac:480: error: expected source file, required through AC_LIBSOURCES, not found
./lib/autoconf/general.m4:2437: AC_FATAL is expanded from...
m4/gnulib-comp.m4:180: gl_INIT is expanded from...
configure.ac:480: the top level
autom4te: error: /home/xxxxxxxx/openwrt/openwrt/staging_dir/host/bin/m4 failed with exit status: 1
aclocal.real: error: autom4te failed with exit status: 1
make[3]: *** [Makefile:2217: aclocal.m4] Error 1
make[3]: Leaving directory '/home/xxxxxxxx/openwrt/openwrt/build_dir/target-x86_64_musl/gnutls-3.7.8'
make[2]: *** [Makefile:269: /home/xxxxxxxx/openwrt/openwrt/build_dir/target-x86_64_musl/gnutls-3.7.8/.built] Error 2
make[2]: Leaving directory '/home/xxxxxxxx/openwrt/openwrt/feeds/packages/libs/gnutls'
time: package/feeds/packages/gnutls/compile#58.77#18.47#74.77
    ERROR: package/feeds/packages/gnutls failed to build.
make[1]: *** [package/Makefile:116: package/feeds/packages/gnutls/compile] Error 1
make[1]: Leaving directory '/home/xxxxxxxx/openwrt/openwrt'
make: *** [/home/xxxxxxxx/openwrt/openwrt/include/toplevel.mk:231: package/feeds/packages/gnutls/compile] Error 2

Error output for ramips

make[3]: Entering directory '/home/xxxxxxxx/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/gnutls-3.7.8'
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/xxxxxxxx/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/gnutls-3.7.8/build-aux/missing aclocal-1.16 -I m4 -I src/gl/m4 -I lib/unistring/m4 --install
m4/gnulib-comp.m4:427: warning: macro 'AM_STDBOOL_H' not found in library
src/gl/m4/gnulib-comp.m4:802: warning: macro 'AM_STDBOOL_H' not found in library
lib/unistring/m4/gnulib-comp.m4:166: warning: macro 'AM_STDBOOL_H' not found in library
missing file gl/stdio-read.c
configure.ac:480: error: expected source file, required through AC_LIBSOURCES, not found
./lib/autoconf/general.m4:2437: AC_FATAL is expanded from...
m4/gnulib-comp.m4:180: gl_INIT is expanded from...
configure.ac:480: the top level
autom4te: error: /home/xxxxxxxx/openwrt/openwrt/staging_dir/host/bin/m4 failed with exit status: 1
aclocal.real: error: autom4te failed with exit status: 1
make[3]: *** [Makefile:2217: aclocal.m4] Error 1
make[3]: Leaving directory '/home/xxxxxxxx/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/gnutls-3.7.8'
make[2]: *** [Makefile:269: /home/xxxxxxxx/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/gnutls-3.7.8/.built] Error 2
make[2]: Leaving directory '/home/xxxxxxxx/openwrt/openwrt/feeds/packages/libs/gnutls'
time: package/feeds/packages/gnutls/compile#59.34#18.28#74.60
    ERROR: package/feeds/packages/gnutls failed to build.
make[1]: *** [package/Makefile:116: package/feeds/packages/gnutls/compile] Error 1
make[1]: Leaving directory '/home/xxxxxxxx/openwrt/openwrt'
make: *** [/home/xxxxxxxx/openwrt/openwrt/include/toplevel.mk:231: package/feeds/packages/gnutls/compile] Error 2

I've even tried a couple of times deleting all build related directories (tmp, bin, build_dir, and staging_dir) but same error is happening. I'm stomped on what to do.

I was able to build with no errors rolling back to commit: https://github.com/openwrt/openwrt/commit/4fa9ec125ac5b4dfbccdf440e156feb18fb896d0

I'll do additional testings on commits onwards one by one to see which one broke the build process.

git bisect depending on distance to go.

1 Like

Hello, I have same issue with building from latest master, i think it's because https://github.com/openwrt/openwrt/commit/fe33d5ba13370027165b9acf2bd895f5b4d9a4ea

I'm still doing some build test to see where the issue is coming from. I'll check to see if not including that build fixes it.

I've already filed a bug in the github: https://github.com/openwrt/openwrt/issues/12542 and you can check/track progress of the issue.

But latest observation, the more you try to do a clean build (doing make clean or clearing out build dirs) the more the build error happens. I'll do a post in the github issue to explain this.

1 Like

oh wait... there's a PR already for GNUTLS version 3.8.0 that looks like will fix the issue. I'll try the PR in my next test build to see if it works.

Here is the PR: https://github.com/openwrt/packages/pull/20940

1 Like

This is confirmed fixed with the PR for the updated gnutls v3.8.0: https://github.com/openwrt/packages/pull/20940

If you want to test you can see comment from PR author here: https://github.com/openwrt/openwrt/issues/12542#issuecomment-1537232297

1 Like

if anyone is trying to build this with the SDK there is an additional problem with gettext (gnutls apparently needs it) that should be fixed soon

at some point I will be looking to remove the patch for gnutls and other m4 patches since they won't be necessary now that gnulib is in master. it shouldn't be necessary to run autoreconf on it at all since that was the only patch it seems. it might build successfully just by removing the patch and fixup in the Makefile before the bump to 3.8

1 Like
OpenWrt-libtool: link: aarch64-openwrt-linux-musl-gcc -fno-builtin-strcmp -Os -pipe -mcpu=generic -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/openwrt/master/openwrt/build_dir/target-aarch64_generic_musl/gnutls-3.8.0=gnutls-3.8.0 -Wformat -Werror=for
mat-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z -Wl,now -Wl,-z -Wl,relro -znow -zrelro -o .libs/psktool psk.o  -L/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/usr/lib -L/home/openwrt/master/openwrt/staging_dir/toolchain-aarch
64_generic_gcc-13.1.0_musl/lib ../lib/.libs/libgnutls.so -L/home/openwrt/master/openwrt/staging_dir/target-aarch64_generic_musl/usr/lib -lnettle -lhogweed -lgmp ./.libs/libcmd-psk.a ../gl/.libs/libgnu.a gl/.libs/libgnu_gpl.a
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `u8_check'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Sc'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uc_general_category_and_not'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_So'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Cc'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Sm'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Sk'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Pe'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Pc'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Pi'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uc_is_property_not_a_character'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Ps'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `u16_to_u8'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uc_decomposition'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Lt'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Po'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Ll'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Mn'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `u8_to_u16'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_No'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uc_is_general_category'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `u32_to_u8'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uc_is_property_join_control'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uc_is_property_default_ignorable_code_point'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Pd'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Lm'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Pf'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `u8_to_u32'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `u16_normalize'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Lu'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uninorm_nfc'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Lo'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Me'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Mc'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `u32_normalize'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Nd'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Zs'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `UC_CATEGORY_Nl'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uninorm_nfkc'
/home/openwrt/master/openwrt/staging_dir/toolchain-aarch64_generic_gcc-13.1.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.1.0/../../../../aarch64-openwrt-linux-musl/bin/ld: ../lib/.libs/libgnutls.so: undefined reference to `uc_general_category_or'
collect2: error: ld returned 1 exit status
make[7]: *** [Makefile:2637: psktool] Error 1
make[7]: Leaving directory '/home/openwrt/master/openwrt/build_dir/target-aarch64_generic_musl/gnutls-3.8.0/src'

@mpratt14 - Other packages (zile) dependent on gnulib are not building either. What patches should we be looking at to fix these problems. I haven't looked at the full package build output for other failures because of this change but this particular one affects me.

is it failing in a normal buildroot or SDK? as far as I know the only problem is when using SDK right now, other than the error that was first posted here.

do you mean it's dependent on gettext? only things dependent on gnulib right now are the tools that were committed to recently

I put a PR yesterday

Same error as OP (see below) using buildroot. Only difference is the line number in configure.ac. If I get some time, I comb all the buildbot logs for other packages failing.

missing file gl/stdio-read.c
configure.ac:480: error: expected source file, required through AC_LIBSOURCES, not found
./lib/autoconf/general.m4:2437: AC_FATAL is expanded from...
m4/gnulib-comp.m4:180: gl_INIT is expanded from...
configure.ac:480: the top level

This seems to help:

diff --git a/libs/gnutls/Makefile b/libs/gnutls/Makefile
index dc94591c2dd4..f45304aaf12f 100644
--- a/libs/gnutls/Makefile
+++ b/libs/gnutls/Makefile
@@ -98,7 +98,7 @@ endef
 define Package/libgnutls
 $(call Package/gnutls/Default)
   TITLE+= (library)
-  DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit +GNUTLS_CRYPTODEV:kmod-cryptodev +libatomic
+  DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit +GNUTLS_CRYPTODEV:kmod-cryptodev +libatomic +libunistring
 endef

 define Package/libgnutls-dane
@@ -131,7 +131,6 @@ CONFIGURE_ARGS+= \
        --enable-local-libopts \
        --without-idn \
        --with-default-trust-store-dir=/etc/ssl/certs/ \
-       --with-included-unistring \
        --with-librt-prefix="$(LIBRT_ROOT_DIR)/" \
        --with-pic \
        --with-system-priority-file="" \
1 Like