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