This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

A new static binary patch


Please discard my previous patch. I will update my c_stubs addon soon.

-- 
H.J. Lu (hjl@gnu.org)
---
Mon Aug 23 17:22:53 1999  H.J. Lu  <hjl@gnu.org>

	* Makeconfig (FILE): Define.

	* Rules (%.out): Run $(FILE) on the binary before running it
	and don't use the dynamic linker if it is not dynamically
	linked.

Index: Makeconfig
===================================================================
RCS file: /work/cvs/gnu/glibc/Makeconfig,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makeconfig
--- Makeconfig	1999/08/08 17:01:06	1.1.1.1
+++ Makeconfig	1999/08/23 23:20:28
@@ -493,6 +493,10 @@ ifndef	RANLIB
 RANLIB = ranlib
 endif
 
+ifndef FILE
+FILE := file
+endif
+
 # Extra flags to pass to GCC.
 +gccwarn := -Wall -Wwrite-strings -Winline -Wstrict-prototypes
 
Index: Rules
===================================================================
RCS file: /work/cvs/gnu/glibc/Rules,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 Rules
--- Rules	1999/08/23 16:16:40	1.1.1.2
+++ Rules	1999/08/23 23:26:41
@@ -119,13 +119,33 @@ ifneq "$(strip $(tests) $(test-srcs))" "
 # These are the implicit rules for making test outputs
 # from the test programs and whatever input files are present.
 $(objpfx)%.out: %.args $(objpfx)% %.input
-	$($*-ENV) $(built-program-cmd) `cat $(word 1,$^)` < $(word 3,$^) > $@
+	$(FILE) $(built-program-file) | grep dynamically > /dev/null 2>&1; \
+	if [ $$? = 0 ]; then \
+	  $($*-ENV) $(built-program-cmd) `cat $(word 1,$^)` < $(word 3,$^) > $@; \
+	else \
+	  $($*-ENV) $(built-program-file) `cat $(word 1,$^)` < $(word 3,$^) > $@; \
+	fi
 $(objpfx)%.out: %.args $(objpfx)%
-	$($*-ENV) $(built-program-cmd) `cat $(word 1,$^)` > $@
+	$(FILE) $(built-program-file) | grep dynamically > /dev/null 2>&1; \
+	if [ $$? = 0 ]; then \
+	  $($*-ENV) $(built-program-cmd) `cat $(word 1,$^)` > $@; \
+	else \
+	  $($*-ENV) $(built-program-file) `cat $(word 1,$^)` > $@; \
+	fi
 $(objpfx)%.out: %.input $(objpfx)%
-	$($*-ENV) $(built-program-cmd) < $(word 1,$^) > $@
+	$(FILE) $(built-program-file) | grep dynamically > /dev/null 2>&1; \
+	if [ $$? = 0 ]; then \
+	  $($*-ENV) $(built-program-cmd) < $(word 1,$^) > $@; \
+	else \
+	  $($*-ENV) $(built-program-file) < $(word 1,$^) > $@; \
+	fi
 $(objpfx)%.out: /dev/null $(objpfx)%	# Make it 2nd arg for canned sequence.
-	$($*-ENV) $(built-program-cmd) > $@
+	$(FILE) $(built-program-file) | grep dynamically > /dev/null 2>&1; \
+	if [ $$? = 0 ]; then \
+	  $($*-ENV) $(built-program-cmd) > $@; \
+	else \
+	  $($*-ENV) $(built-program-file) > $@; \
+	fi
 endif	# tests
 
 .PHONY: distclean realclean subdir_distclean subdir_realclean \

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