Explorar o código

Fix it so files are not stripped when debugging (doh!). Fix up strip
rules. With this fix in place, I can now find what is wrong with malloc...
-Erik

Eric Andersen %!s(int64=24) %!d(string=hai) anos
pai
achega
350c0215ef

+ 1 - 0
Rules.mak

@@ -41,6 +41,7 @@ CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS)
 ifeq ($(DODEBUG),true)
     CFLAGS += -Wall -g
     LDFLAGS = -nostdlib -Wl,-warn-common 
+    STRIPTOOL = /bin/true -Since_we_are_debugging
 else
     CFLAGS  += -Wall #-fomit-frame-pointer
     LDFLAGS  = -s -nostdlib -Wl,-warn-common

+ 1 - 1
libc/sysdeps/linux/common/Makefile

@@ -51,7 +51,7 @@ $(MOBJ): $(MSRC)
 
 $(COBJS):
 	$(CC) $(CFLAGS) -g $< -c $*.c -o $*.o
-	#$(STRIPTOOL) -x -R .note -R .comment $*.o
+	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
 clean:
 	rm -f *.[oa] *~ core

+ 2 - 5
test/assert/Makefile

@@ -13,11 +13,6 @@ EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YLDFLAGS = -s --static 
 
-# Allow alternative stripping tools to be used...
-ifndef $(STRIPTOOL)
-	STRIPTOOL = strip
-endif
-STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
 TARGETS=assert assert_glibc
 
@@ -30,6 +25,7 @@ assert: assert.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@
 	-@ echo "This was supposed to core dump on test #3"
 	-@rm -f core
@@ -42,6 +38,7 @@ assert_glibc: assert.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@
 	-@ echo "This was supposed to core dump on test #3"
 	-@rm -f core

+ 2 - 5
test/ctype/Makefile

@@ -13,11 +13,6 @@ EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YLDFLAGS = -s --static 
 
-# Allow alternative stripping tools to be used...
-ifndef $(STRIPTOOL)
-	STRIPTOOL = strip
-endif
-STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
 TARGETS=ctype ctype_glibc
 
@@ -30,6 +25,7 @@ ctype: ctype.c ../testsuite.h Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	./$@
 	-@ echo " "
 
@@ -40,6 +36,7 @@ ctype_glibc: ctype.c ../testsuite.h Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@
 	-@ echo " "
 

+ 4 - 5
test/pwd_grp/Makefile

@@ -13,11 +13,6 @@ EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YLDFLAGS = -s --static 
 
-# Allow alternative stripping tools to be used...
-ifndef $(STRIPTOOL)
-	STRIPTOOL = strip
-endif
-STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
 TARGETS=test_pwd test_pwd_glibc
 TARGETS+=test_grp test_grp_glibc
@@ -32,6 +27,7 @@ test_pwd: test_pwd.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@ 2>&1 >test_pwd.out
 	-@ echo " "
 
@@ -42,6 +38,7 @@ test_pwd_glibc: test_pwd.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@ 2>&1 >test_pwd_glibc.out
 	-@ echo " "
 
@@ -52,6 +49,7 @@ test_grp: test_grp.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@ 2>&1 >test_grp.out
 	-@ echo " "
 
@@ -62,6 +60,7 @@ test_grp_glibc: test_grp.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@ 2>&1 >test_grp_glibc.out
 	-@ echo " "
 

+ 2 - 5
test/signal/Makefile

@@ -13,11 +13,6 @@ EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YLDFLAGS = -s --static 
 
-# Allow alternative stripping tools to be used...
-ifndef $(STRIPTOOL)
-	STRIPTOOL = strip
-endif
-STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
 TARGETS=signal signal_glibc
 
@@ -30,6 +25,7 @@ signal: signal.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@
 	-@ echo " "
 
@@ -40,6 +36,7 @@ signal_glibc: signal.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@
 	-@ echo " "
 

+ 2 - 7
test/silly/Makefile

@@ -13,11 +13,6 @@ EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YLDFLAGS = -s --static 
 
-# Allow alternative stripping tools to be used...
-ifndef $(STRIPTOOL)
-	STRIPTOOL = strip
-endif
-STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
 TARGETS=hello_source hello hello_glibc
 
@@ -38,7 +33,7 @@ hello: hello.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
-	$(STRIP)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-ldd $@
 	ls $(LSFLAGS) $@
 	-./$@
@@ -51,7 +46,7 @@ hello_glibc: hello.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
-	$(STRIP)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-ldd $@
 	ls $(LSFLAGS) $@
 	-./$@

+ 6 - 11
test/stdlib/Makefile

@@ -13,11 +13,6 @@ EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YLDFLAGS = -s --static 
 
-# Allow alternative stripping tools to be used...
-ifndef $(STRIPTOOL)
-	STRIPTOOL = strip
-endif
-STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
 TARGETS=testmalloc testmalloc_glibc 
 TARGETS=mallocbug mallocbug_glibc
@@ -39,7 +34,7 @@ testmalloc: testmalloc.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
-	$(STRIP)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-ldd $@
 	ls $(LSFLAGS) $@
 	-./$@
@@ -52,7 +47,7 @@ testmalloc_glibc: testmalloc.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
-	$(STRIP)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-ldd $@
 	ls $(LSFLAGS) $@
 	-./$@
@@ -65,7 +60,7 @@ mallocbug: mallocbug.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
-	$(STRIP)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-ldd $@
 	ls $(LSFLAGS) $@
 	-./$@
@@ -78,7 +73,7 @@ mallocbug_glibc: mallocbug.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
-	$(STRIP)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-ldd $@
 	ls $(LSFLAGS) $@
 	-./$@
@@ -98,7 +93,7 @@ teststrtol: teststrtol.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
-	$(STRIP)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-ldd $@
 	ls -sh $@
 	-./$@ > $@.out
@@ -111,7 +106,7 @@ teststrtol_glibc: teststrtol.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
-	$(STRIP)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-ldd $@
 	ls -sh $@
 	-./$@ > $@.out

+ 4 - 5
test/string/Makefile

@@ -16,11 +16,6 @@ EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YLDFLAGS = -s --static 
 
-# Allow alternative stripping tools to be used...
-ifndef $(STRIPTOOL)
-	STRIPTOOL = strip
-endif
-STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
 TARGETS=string string_glibc
 TARGETS+=testcopy testcopy_glibc
@@ -34,6 +29,7 @@ string: string.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@
 	-@ echo " "
 
@@ -44,6 +40,7 @@ string_glibc: string.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@
 	-@ echo " "
 
@@ -54,6 +51,7 @@ testcopy: testcopy.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@ > testcopy.out
 	-@ echo " "
 
@@ -64,6 +62,7 @@ testcopy_glibc: testcopy.c Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@ > testcopy.gnu.out
 	-@ echo " "
 

+ 2 - 5
test/unistd/Makefile

@@ -13,11 +13,6 @@ EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
 YCFLAGS = -Wall -Os -fomit-frame-pointer
 YLDFLAGS = -s --static 
 
-# Allow alternative stripping tools to be used...
-ifndef $(STRIPTOOL)
-	STRIPTOOL = strip
-endif
-STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
 
 TARGETS=fork fork_glibc
 
@@ -30,6 +25,7 @@ fork: fork.c ../testsuite.h Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(XCFLAGS) -c $< -o $@.o
 	$(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	./$@
 	-@ echo " "
 
@@ -40,6 +36,7 @@ fork_glibc: fork.c ../testsuite.h Makefile $(TOPDIR)libc.a
 	-@ echo " "
 	$(CC) $(YCFLAGS) -c $< -o $@.o
 	$(CC) $(YLDFLAGS) --static $@.o -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $@
 	-./$@
 	-@ echo " "