This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix bug 15915, erroneous make rule for linkobj/libc.so.


On 09/24/2013 01:56 PM, Roland McGrath wrote:
I have yet to see a proper non-attachment patch posting with a log entry.

Fair enough, although following the advice on https://sourceware.org/glibc
/wiki/Contribution%20checklist I have been attaching patches because the
mailer I use "unavoidably wraps long lines or otherwise alters patch
content".  For your convenience I have included a non-attachment version of
the patch below; I _think_ I've broken my mailer settings correctly to
avoid line-wrapping it.

I have also included a log entry.  Sorry for the earlier omission.

Thanks,
- Brooks



2013-09-24  Brooks Moses  <bmoses@google.com>

	[BZ #15915]
	* Makefile (linkobj/libc_pic.a, linkobj/libc.so): Move rules to...
	* Makerules: ...here, and adjust associated comments.




diff --git a/Makefile b/Makefile
index ba1820d..74e8880 100644
--- a/Makefile
+++ b/Makefile
@@ -124,35 +124,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
 endif # $(build-shared)


diff --git a/Makerules b/Makerules
index cca3f82..37a24b5 100644
--- a/Makerules
+++ b/Makerules
@@ -565,16 +565,46 @@ generated += libc_pic.opts libc_pic.os.clean
 libc_pic_clean := .clean
 endif

-# Do not filter ld.so out of libc.so link.
+# Build a possibly-modified version of libc_pic.a for use in building
+# linkobj/libc.so.
+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
+
+# Clear link-libc-deps for the libc.so libraries so build-shlibs does not
+# filter ld.so out of the list of linked objects.
 $(common-objpfx)libc.so: link-libc-deps = # empty
+$(common-objpfx)linkobj/libc.so: link-libc-deps = # empty

-# Use our own special initializer and finalizer files for libc.so.
+# Use our own special initializer and finalizer files for the libc.so libraries.
 $(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
 			 $(common-objpfx)libc_pic.os$(libc_pic_clean) \
 			 $(elfobjdir)/sofini.os \
-			 $(elfobjdir)/interp.os $(elfobjdir)/ld.so \
+			 $(elfobjdir)/interp.os \
+			 $(elfobjdir)/ld.so \
+			 $(shlib-lds)
+	$(build-shlib)
+
+$(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 ($(build-shared),yes)
 $(common-objpfx)libc.so: $(common-objpfx)libc.map
 endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]