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