Not an issue, just a question about nsl library importance
Is it nsl library (libnsl*) important for SDL Hercules (and MVS that it runs) functioning properly?
I'm on the self-assigned quest to build SDL Hercules bin/lib that will work across various Linux distros (to help Rob with his TK5), but Hercules (4.7) in TK5 is not Linux universal, it looks like that it has been built on Debian and it fails where there is no libbz2.so.1.0 (other distros use libbz2.so.1).
I tried my luck with Gentoo x86_64 (I hope to build there for aarch64/arm/x86 as well), but it comes with already present libnsl.so.3 which is not universally available, and it links Hercules to it (AFAIK some other distros, if they have at all preinstalled nsl, use libnsl.so.[1|2])
I decided to remove nsl from Gentoo (I'm aware that this might screw other Gentoo software, but I only care about hercules-helper doing its job).
After removing nsl, I made Hercules build on Gentoo that seems like working on Fedora 42, Debian Trixie and Alt Sisyphus, TK5 MVS does IPL and it shutdown properly on all of the mentioned distros using the same Gentoo based build, but IDK did I screwed something else by not linking nsl?
Thanks!
What is trying to pull in libnsl?
Personally, I've never heard of that library before.
configure checks for -lnsl and if found then it got linked with (at least) hercules. It can be seen in hercules-buildall-[date].log:
" checking for gethostbyname in -lnsl... [no|yes] "
OK, so it's looking for gethostbyname.
Strange that I didn't have libnsl on Alt before, so I installed both "libnsl2 - Public client interface library for NIS(YP) and NIS+" (libnsl.so.2) and "libnsl2-devel - Development files for libnsl" to check will there be any difference with helper builds and yet configure is not picking it up:
"checking for gethostbyname in -lnsl... no"
despite /usr/lib64/pkgconfig/libnsl.pc being present.
So, is it safe to assume that libnsl is not so important for hercules working properly?
I see configure compiles a test pgm with -lnsl to see if gethostbyname() exists and
sets #define HAVE_LIBNSL 1 in config.h if so.
I don't see anywhere in the code where HAVE_LIBNSL is tested.
gethostbyname() is called in various places, and I don't see any checking for its availability.
It's just assumed to be present.
I really don't know what libnsl is or does.
Google says "The libnsl package contains the public client interface for NIS(YP). It replaces the NIS library that used to be in glibc."
Which doesn't help me understand any better. :)
gethostbyname()is called in various places, and I don't see any checking for its availability. It's just assumed to be present.
Looks like that gethostbyname() is defined in libc:
$ nm -D /usr/lib/libc.so.6 | grep gethostbyname
00146830 T gethostbyname@@GLIBC_2.0
00146a60 T gethostbyname2@@GLIBC_2.0
00146c90 T gethostbyname2_r@@GLIBC_2.1.2
00177920 T gethostbyname2_r@GLIBC_2.0
00147140 T gethostbyname_r@@GLIBC_2.1.2
00177960 T gethostbyname_r@GLIBC_2.0
0012dfa0 T _nss_dns_gethostbyname2_r@@GLIBC_PRIVATE
0012df20 T _nss_dns_gethostbyname3_r@@GLIBC_PRIVATE
0012e100 T _nss_dns_gethostbyname4_r@@GLIBC_PRIVATE
0012e050 T _nss_dns_gethostbyname_r@@GLIBC_PRIVATE
00151060 T _nss_files_gethostbyname2_r@@GLIBC_PRIVATE
00150e90 T _nss_files_gethostbyname3_r@@GLIBC_PRIVATE
00151090 T _nss_files_gethostbyname4_r@@GLIBC_PRIVATE
00151030 T _nss_files_gethostbyname_r@@GLIBC_PRIVATE
Vladimir,
Evidently my Gentoo VM has this libnsl installed.
How can I remove the package?
Thanks, Bill
Warning 1: I'm a total noob when comes to Gentoo, installed it for the first time just a week ago.
Warning 2: removing needed pkg/lib can make other things that need that pkg broken; use:
emerge -pv --depclean <package>
to check it first.
Finally, the answer:
Using otherwise very not recommended "-C" was the only way that I could remove it
sudo emerge -C net-libs/libnsl
BTW, I posted a on your hercules-helper git about packages actually needed for helper to successfully build on Gentoo.
@wrljet Is this issue resolved? Should it be closed now?
Closing due to non-response.