shadow-maint/shadow

4.14.0-rc4: build broken with option --without-libbsd

fjaell opened this issue · 8 comments

fjaell commented

got the following error with 4.14.0-rc4 and configure --without-libbsd:

...
CCLD login
/usr/bin/ld: ../libmisc/.libs/libmisc.a(libmisc_la-utmp.o): in function is_my_tty': /tmp/shadow/src/shadow-4.14.0-rc4/libmisc/utmp.c:47: undefined reference to strlcpy'
collect2: error: ld returned 1 exit status

hallyn commented

@ikerexxe do you mind doing a patch to add strlcpy to the !libbsd case?

jubalh commented

@fjaell that's because shadow 4.14.0 needs either libbsd or >= glibc 2.38.

do you mind doing a patch to add strlcpy to the !libbsd case?

I think if we take all the functions from libbsd there we rather shouldn't have added those functions but sticked with the ones from standard library. And if we take all of those functions into our code now then at least we should remove the libbsd option again since we took everything.

jubalh commented

The commits introducing strlcpy():

As Michael has already mentioned, that function is available in glibc 2.38, so either projects use that version or they link against libbsd. If I start adding all the missing functions to libbsd in older versions of glibc, I'm afraid I won't finish.

hallyn commented

As Michael has already mentioned, that function is available in glibc 2.38

But that was released in July 2023.

I reproduced the same problem on ubuntu jammy (22.04), which has glibc 2.35. Of course, it has libbsd so it's an artificial issue there.

But that was released in July 2023.

And we are releasing in August 2023, so we can add a release note stating that distributions that want to use shadow-4.14.0 need to use glibc 2.38 or libbsd.

hallyn commented

But then we are discouraging distributions that have long term support from upgrading their shadow. At the risk of offending libc maintainers, upgrading libc seems like a huge regression risk.

I suppose we could add a configure check for glibc version if libbsd is missing, to at least reduce the time spent debugging the problem.

hallyn commented

#788 will warn more clearly