ifeq (elf,$(subdir))
$(objpfx)librtld.os: $(rpcuserlibs:.so=_pic.a)
endif
+
+# We need these libs to link static programs in the libc source tree, too.
+ifeq (yes,$(build-static))
+link-libc-static := -Wl,-\( \
+ $(patsubst %,$(common-objpfx)%.a,\
+ libc mach/libmachuser hurd/libhurduser) \
+ $(gnulib) -Wl,-\)
+else
+ifeq (yes,$(build-shared))
+# We can try to link the programs with lib*_pic.a...
+link-libc-static := $(link-libc) -Wl,-\( \
+ $(patsubst %,$(common-objpfx)%_pic.a,\
+ libc mach/libmachuser hurd/libhurduser) \
+ $(gnulib) -Wl,-\)
+endif
+endif
\f
ifeq (hurd, $(subdir))
sysdep_routines += cthreads