summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorBrooks Moses <bmoses@google.com>2013-10-03 10:38:14 -0700
committerBrooks Moses <bmoses@google.com>2013-10-03 10:38:14 -0700
commit5f855e3598a576c35e54623a13b256f3e87fcd4d (patch)
treeba77026f236ca40b764798e0d70001a3fcff58cd /Makefile
parentb7f2d27dbd85f6a0966dc389ad4f8205085b7ae8 (diff)
downloadglibc-5f855e3598a576c35e54623a13b256f3e87fcd4d.tar.gz
glibc-5f855e3598a576c35e54623a13b256f3e87fcd4d.tar.xz
glibc-5f855e3598a576c35e54623a13b256f3e87fcd4d.zip
Fix erroneous (and circular) implied pattern rule for linkobj/libc.so.
[BZ #15915] As described in the bug, the pattern rule for lib%.so files
in Makerules includes linkobj/libc.so as a dependency.  However, the
explicit rule for linkobj/libc.so is in the top-level Makefile.

Thus, the subdirectory makefiles that include Makerules end up with an
erroneous makefile pattern rule for linkobj/libc.so that includes
itself as a dependency.  The result is make warnings whenever rules
for other .so files are resolved -- and, on occasion, actual makefile
failures when a race condition causes the implicit rule to actually be
used.

This patch moves the explicit rules for linkobj/libc.so into Makerules
to clear up this problem.  It also elaborates a couple of comments
that I'd initially found confusing.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 1 insertions, 30 deletions
diff --git a/Makefile b/Makefile
index ba1820d2b2..302a300d48 100644
--- a/Makefile
+++ b/Makefile
@@ -123,36 +123,7 @@ lib-noranlib: subdir_lib
 
 ifeq (yes,$(build-shared))
 # Build the shared object from the PIC object library.
-lib: $(common-objpfx)libc.so
-
-lib: $(common-objpfx)linkobj/libc.so
-
-# Do not filter ld.so out of libc.so link.
-$(common-objpfx)linkobj/libc.so: link-libc-deps = # empty
-
-$(common-objpfx)linkobj/libc.so: $(elfobjdir)/soinit.os \
-				 $(common-objpfx)linkobj/libc_pic.a \
-				 $(elfobjdir)/sofini.os \
-				 $(elfobjdir)/interp.os \
-				 $(elfobjdir)/ld.so \
-				 $(shlib-lds)
-	$(build-shlib)
-
-ifeq (,$(filter sunrpc,$(subdirs)))
-$(common-objpfx)linkobj/libc_pic.a: $(common-objpfx)libc_pic.a
-	$(make-target-directory)
-	ln -f $< $@
-else
-$(common-objpfx)linkobj/libc_pic.a: $(common-objpfx)libc_pic.a \
-				    $(common-objpfx)sunrpc/librpc_compat_pic.a
-	$(make-target-directory)
-	(cd $(common-objpfx)linkobj; \
-	 $(AR) x ../libc_pic.a; \
-	 rm $$($(AR) t ../sunrpc/librpc_compat_pic.a | sed 's/^compat-//'); \
-	 $(AR) x ../sunrpc/librpc_compat_pic.a; \
-	 $(AR) cr libc_pic.a *.os; \
-	 rm *.os)
-endif # $(subdirs) contains sunrpc
+lib: $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so
 endif # $(build-shared)