00db10
commit d330b980e9ee2349492087a279a9c7bf294f6b47
00db10
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
00db10
Date:   Tue Sep 16 22:20:45 2014 +0530
00db10
00db10
    Remove CFLAGS for interp.c
00db10
    
00db10
    Replace it with including an auto-generated linker-runtime.h.
00db10
    Build-tested on x86_64 and found that there was no change in the
00db10
    generated code.
00db10
    
00db10
    	* elf/Makefile (CFLAGS-interp.c): Remove.
00db10
    	($(elf-objpfx)runtime-linker.h): Generate header with linker
00db10
    	path string.
00db10
    	* elf/interp.c: Include generated runtime-linker.h
00db10
00db10
Index: glibc-2.17-c758a686/elf/Makefile
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/elf/Makefile
00db10
+++ glibc-2.17-c758a686/elf/Makefile
00db10
@@ -344,9 +344,16 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld
00db10
 	$(READELF) -s $@ \
00db10
 	  | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
00db10
 
00db10
-# interp.c exists just to get this string into the libraries.
00db10
-CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"'
00db10
-$(objpfx)interp.os: $(common-objpfx)config.make
00db10
+# interp.c exists just to get the runtime linker path into libc.so.
00db10
+$(objpfx)interp.os: $(elf-objpfx)runtime-linker.h
00db10
+
00db10
+$(elf-objpfx)runtime-linker.h: $(elf-objpfx)runtime-linker.st; @:
00db10
+$(elf-objpfx)runtime-linker.st: $(common-objpfx)config.make
00db10
+	$(name-target-directory)
00db10
+	echo '#define RUNTIME_LINKER "$(rtlddir)/$(rtld-installed-name)"' \
00db10
+		> ${@:st=T}
00db10
+	$(move-if-change) ${@:st=T} ${@:st=h}
00db10
+	touch $@
00db10
 
00db10
 ifneq (ld.so,$(rtld-installed-name))
00db10
 # Make sure ld.so.1 exists in the build directory so we can link
00db10
Index: glibc-2.17-c758a686/elf/interp.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/elf/interp.c
00db10
+++ glibc-2.17-c758a686/elf/interp.c
00db10
@@ -16,5 +16,7 @@
00db10
    License along with the GNU C Library; if not, see
00db10
    <http://www.gnu.org/licenses/>.  */
00db10
 
00db10
+#include <elf/runtime-linker.h>
00db10
+
00db10
 const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
00db10
   = RUNTIME_LINKER;