Build of OpenWrt 19.07 fails (glibc, tcp_wrappers)

Hello, if I want to build my own firmware for my router the build process fails with the following error message:

x86_64-openwrt-linux-gnu-gcc -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/home/stefan.harbich/Downloads/apu/openwrt/build_dir/target-x86_64_glibc/tcp_wrappers_7.6:tcp_wrappers_7.6 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -Wall -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS      -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10  -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\"   -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len    -fPIC -shared -D_REENTRANT -c myvsyslog.c -o shared/myvsyslog.o
rm -f shared/libwrap.so.0.7.6
x86_64-openwrt-linux-gnu-gcc -o shared/libwrap.so.0.7.6 -shared -Xlinker -soname -Xlinker libwrap.so.0 -lc -lnsl shared/hosts_access.o shared/options.o shared/shell_cmd.o shared/rfc931.o shared/eval.o shared/hosts_ctl.o shared/refuse.o shared/percent_x.o shared/clean_exit.o shared/fromhost.o shared/fix_options.o shared/socket.o shared/tli.o shared/workarounds.o shared/update.o shared/misc.o shared/diag.o shared/percent_m.o shared/myvsyslog.o;
/home/stefan.harbich/Downloads/apu/openwrt/staging_dir/toolchain-x86_64_gcc-7.5.0_glibc/lib/gcc/x86_64-openwrt-linux-gnu/7.5.0/../../../../x86_64-openwrt-linux-gnu/bin/ld: cannot find -lnsl
collect2: error: ld returned 1 exit status
Makefile:743: recipe for target 'shared/libwrap.so.0.7.6' failed
make[4]: *** [shared/libwrap.so.0.7.6] Error 1
make[4]: Leaving directory '/home/stefan.harbich/Downloads/apu/openwrt/build_dir/target-x86_64_glibc/tcp_wrappers_7.6'
Makefile:69: recipe for target '/home/stefan.harbich/Downloads/apu/openwrt/build_dir/target-x86_64_glibc/tcp_wrappers_7.6/.built' failed
make[3]: *** [/home/stefan.harbich/Downloads/apu/openwrt/build_dir/target-x86_64_glibc/tcp_wrappers_7.6/.built] Error 2
make[3]: Leaving directory '/home/stefan.harbich/Downloads/apu/openwrt/feeds/packages/libs/tcp_wrappers'
time: package/feeds/packages/tcp_wrappers/compile#3.19#1.34#4.18
package/Makefile:111: recipe for target 'package/feeds/packages/tcp_wrappers/compile' failed
make[2]: *** [package/feeds/packages/tcp_wrappers/compile] Error 2
make[2]: Leaving directory '/home/stefan.harbich/Downloads/apu/openwrt'
package/Makefile:107: recipe for target '/home/stefan.harbich/Downloads/apu/openwrt/staging_dir/target-x86_64_glibc/stamp/.package_compile' failed
make[1]: *** [/home/stefan.harbich/Downloads/apu/openwrt/staging_dir/target-x86_64_glibc/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/stefan.harbich/Downloads/apu/openwrt'
/home/stefan.harbich/Downloads/apu/openwrt/include/toplevel.mk:225: recipe for target 'world' failed
make: *** [world] Error 2

The problem already existed eglibc-2.15/2.17 r38435 compile failed (tcp_wrappers_7.6 cannot find -lnsl)
Do you still have a tip for what I can do?
Greeting from Stefan

fgrep -r 'lnsl' package/
sed -i -e 's:-lnsl::' package/network/services/hostapd/files/wpa_supplicant-* #<add your file here

What file do I have to specify this? The file "libwrap.so.0.7.6"? With or without a path?

You are building with a nonstandard libc, glibc.
My guess is that the tcpwrappers Makefile needs to be modified somehow. There is exception for musl libc not to require now support, but not for glibc.

Alternatively, you might enable full nls support in your build config. Then you might actually have the now missing nls library.

Hello,
im using the mcproxy package. I have to do this with glibc according to the following information
mcproxy

Which package do I have to select in the make menuconfig?
Why did the build still work in version 18.06.4?
Thank you for the continued support.

Hello, unfortunately this tip was not. I have activated "CONFIG_BUILD_NLS = y" in the /.config. Same error pattern. Why does the picture work in version 18.06.4. You seem to have a mistake in the branch.

rm -f shared/libwrap.so.0.7.6
x86_64-openwrt-linux-gnu-gcc -o shared/libwrap.so.0.7.6 -shared -Xlinker -soname -Xlinker libwrap.so.0 -lc -lnsl shared/hosts_access.o shared/options.o shared/shell_cmd.o shared/rfc931.o shared/eval.o shared/hosts_ctl.o shared/refuse.o shared/percent_x.o shared/clean_exit.o shared/fromhost.o shared/fix_options.o shared/socket.o shared/tli.o shared/workarounds.o shared/update.o shared/misc.o shared/diag.o shared/percent_m.o shared/myvsyslog.o;
/home/stefan.harbich/Downloads/apu/openwrt/staging_dir/toolchain-x86_64_gcc-7.5.0_glibc/lib/gcc/x86_64-openwrt-linux-gnu/7.5.0/../../../../x86_64-openwrt-linux-gnu/bin/ld: cannot find -lnsl
collect2: error: ld returned 1 exit status
Makefile:743: recipe for target 'shared/libwrap.so.0.7.6' failed
make[4]: *** [shared/libwrap.so.0.7.6] Error 1
make[4]: Leaving directory '/home/stefan.harbich/Downloads/apu/openwrt/build_dir/target-x86_64_glibc/tcp_wrappers_7.6'
Makefile:69: recipe for target '/home/stefan.harbich/Downloads/apu/openwrt/build_dir/target-x86_64_glibc/tcp_wrappers_7.6/.built' failed
make[3]: *** [/home/stefan.harbich/Downloads/apu/openwrt/build_dir/target-x86_64_glibc/tcp_wrappers_7.6/.built] Error 2
make[3]: Leaving directory '/home/stefan.harbich/Downloads/apu/openwrt/feeds/packages/libs/tcp_wrappers'
time: package/feeds/packages/tcp_wrappers/compile#3.75#1.26#4.62
package/Makefile:111: recipe for target 'package/feeds/packages/tcp_wrappers/compile' failed
make[2]: *** [package/feeds/packages/tcp_wrappers/compile] Error 2
make[2]: Leaving directory '/home/stefan.harbich/Downloads/apu/openwrt'
package/Makefile:107: recipe for target '/home/stefan.harbich/Downloads/apu/openwrt/staging_dir/target-x86_64_glibc/stamp/.package_compile' failed
make[1]: *** [/home/stefan.harbich/Downloads/apu/openwrt/staging_dir/target-x86_64_glibc/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/stefan.harbich/Downloads/apu/openwrt'
/home/stefan.harbich/Downloads/apu/openwrt/include/toplevel.mk:225: recipe for target 'world' failed
make: *** [world] Error 2

Hello, the following files are shown to me.

fgrep -r 'lnsl' package/
package/network/services/hostapd/files/wpa_supplicant-mini.config:#LIBS += -lsocket -ldlpi -lnsl
package/network/services/hostapd/files/wpa_supplicant-full.config:#LIBS += -lsocket -ldlpi -lnsl
package/network/services/hostapd/files/wpa_supplicant-basic.config:#LIBS += -lsocket -ldlpi -lnsl
package/network/services/hostapd/files/wpa_supplicant-p2p.config:#LIBS += -lsocket -ldlpi -lnsl

All files are not considered in the build. Were not selected in the make menuconfig. Then why should I

sed -i -e 's:-lnsl::' package/network/services/hostapd/files/wpa_supplicant-* #<add your file here

I do not understand that? I would understand it if I had selected one of the files mentioned above in the make menuconfig.

I chose Network / wpad in make menuconfig and not wpa-supplicant- *

uname -a
~/Downloads/apu/openwrt$ uname -a
Linux nmanme01 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
cat package/feeds/packages/tcp_wrappers/Makefile | grep lnsl
( earlier command should have been: fgrep -R "lnsl" ../package/ ) but not really needed anymore...
~/Downloads/apu/openwrt$ cat package/feeds/packages/tcp_wrappers/Makefile | grep lnsl
TARGET_EXTRA_LIBS:=LIBS=-lnsl
~/Downloads/apu/openwrt$ fgrep -R "lnsl" package/
package/feeds/packages/ptunnel-ng/Makefile:PKG_SOURCE_URL:=https://codeload.github.com/lnslbrty/ptunnel-ng/tar.gz/v$(PKG_VERSION)?
package/feeds/packages/ptunnel-ng/Makefile:  URL:=https://github.com/lnslbrty/ptunnel-ng
package/feeds/packages/tcp_wrappers/patches/005-no--lnsl-on-musl.patch: MYLIB=-lnsl
package/feeds/packages/tcp_wrappers/patches/001-debian_subset.patch:+MYLIB=-lnsl
package/feeds/packages/tcp_wrappers/Makefile:TARGET_EXTRA_LIBS:=LIBS=-lnsl
package/feeds/packages/vpnc/patches/001-cross.patch: LIBS += -lnsl -lresolv -lsocket
package/feeds/packages/vsftpd/patches/002-find_libs.patch:+LIBS	=	-lcrypt -lnsl
package/feeds/packages/vsftpd/Makefile:  NLSSTRING:=-lcrypt -lnsl
package/feeds/packages/vsftpd/Makefile:	$(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
package/feeds/packages/vsftpd/Makefile:	$(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
package/feeds/packages/vsftpd/Makefile:	$(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
package/feeds/packages/tac_plus/patches/010-configure-remove-libnsl.patch:-	# XXX: linux libwrap needs -lnsl. configure should check for
package/feeds/packages/tac_plus/patches/010-configure-remove-libnsl.patch:-	LIBS="-lnsl -lcrypt $LIBS"; export LIBS
package/feeds/luci/luci-lib-nixio/axTLS/config/makefile.conf:LDFLAGS += -lsocket -lnsl -lc
package/feeds/luci/luci-lib-nixio/src/Makefile:	NIXIO_LDFLAGS += -lsocket -lnsl -lsendfile
package/feeds/telephony/yate/patches/110-no-libnsl.patch:-MYSQL_LIB="-L$ac_cv_use_mysql/$local_lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm"
package/network/services/hostapd/files/wpa_supplicant-mini.config:#LIBS += -lsocket -ldlpi -lnsl
package/network/services/hostapd/files/wpa_supplicant-full.config:#LIBS += -lsocket -ldlpi -lnsl
package/network/services/hostapd/files/wpa_supplicant-basic.config:#LIBS += -lsocket -ldlpi -lnsl
package/network/services/hostapd/files/wpa_supplicant-p2p.config:#LIBS += -lsocket -ldlpi -lnsl

I just do not understand. Why did it all work in stable version 18.06.4?

Too bad that nobody can help me

Hi there,
after I made the following change under make menuconfig the build works again.
Under Advanced configuration Options / Toolchain Options / C Library implementation / Use msul)
Change from Use glibc to Use musl

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