diff --git a/Makefile b/Makefile index 4534cf829f..9331b5dec5 100644 --- a/Makefile +++ b/Makefile @@ -97,10 +97,18 @@ ifeq ($(USE_RUST_LIBM),) else $(AR) -rcs "$(DESTDIR)/lib/libm.a" endif - # Empty libraries for dl, pthread, and rt + # Empty compatibility archives. relibc implements these APIs inside libc + # itself, but build systems still pass -ldl/-lpthread/-lrt/-lcrypt/-lutil + # because that is where glibc puts them. Shipping empty archives lets the + # link resolve and the symbols come from libc -- the same approach musl + # takes. Without libcrypt.a, KDE's kcm_users fails with + # ld: cannot find -lcrypt: No such file or directory + # even though libc.a exports both crypt and crypt_r. $(AR) -rcs "$(DESTDIR)/lib/libdl.a" $(AR) -rcs "$(DESTDIR)/lib/libpthread.a" $(AR) -rcs "$(DESTDIR)/lib/librt.a" + $(AR) -rcs "$(DESTDIR)/lib/libcrypt.a" + $(AR) -rcs "$(DESTDIR)/lib/libutil.a" install-tests: tests $(MAKE) -C tests