All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stubdom: fix errors in newlib
@ 2012-07-10 16:12 Olaf Hering
  2012-07-10 16:59 ` Ian Campbell
  0 siblings, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2012-07-10 16:12 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1341839122 -7200
# Node ID 2dd50c201ca0d3542f3589942ae9e51d33ec7509
# Parent  42f76d536b116d2ebad1b6705ae51ecd171d2581
stubdom: fix errors in newlib

rpmlint found a few code bugs in newlib, and marks them as errors after
rpm build. Add another newlib patch and apply it during stubdom build.

I: A function uses a 'return;' statement, but has actually a value
   to return, like an integer ('return 42;') or similar.
W: xen voidreturn ../../../../newlib-1.16.0/libgloss/i386/cygmon-gmon.c:117, 125, 146, 157, 330

I: Program is using implicit definitions of special functions.
   these functions need to use their correct prototypes to allow
   the lightweight buffer overflow checking to work.
     - Implicit memory/string functions need #include <string.h>.
     - Implicit *printf functions need #include <stdio.h>.
     - Implicit *printf functions need #include <stdio.h>.
     - Implicit *read* functions need #include <unistd.h>.
     - Implicit *recv* functions need #include <sys/socket.h>.
E: xen implicit-fortify-decl ../../../../newlib-1.16.0/libgloss/i386/cygmon-gmon.c:119

I: Program returns random data in a function
E: xen no-return-in-nonvoid-function ../../../../newlib-1.16.0/libgloss/i386/cygmon-gmon.c:362


Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r 42f76d536b11 -r 2dd50c201ca0 stubdom/Makefile
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -102,6 +102,7 @@ newlib-$(NEWLIB_VERSION): newlib-$(NEWLI
 	patch -d $@ -p0 < newlib.patch
 	patch -d $@ -p0 < newlib-chk.patch
 	patch -d $@ -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
+	patch -d $@ -p1 < newlib-cygmon-gmon.patch
 	find $@ -type f | xargs perl -i.bak \
 		-pe 's/\b_(tzname|daylight|timezone)\b/$$1/g'
 	touch $@
diff -r 42f76d536b11 -r 2dd50c201ca0 stubdom/newlib-cygmon-gmon.patch
--- /dev/null
+++ b/stubdom/newlib-cygmon-gmon.patch
@@ -0,0 +1,51 @@
+
+I: A function uses a 'return;' statement, but has actually a value
+   to return, like an integer ('return 42;') or similar.
+W: xen voidreturn ../../../../newlib-1.16.0/libgloss/i386/cygmon-gmon.c:117, 125, 146, 157, 330
+
+I: Program is using implicit definitions of special functions.
+   these functions need to use their correct prototypes to allow
+   the lightweight buffer overflow checking to work.
+     - Implicit memory/string functions need #include <string.h>.
+     - Implicit *printf functions need #include <stdio.h>.
+     - Implicit *printf functions need #include <stdio.h>.
+     - Implicit *read* functions need #include <unistd.h>.
+     - Implicit *recv* functions need #include <sys/socket.h>.
+E: xen implicit-fortify-decl ../../../../newlib-1.16.0/libgloss/i386/cygmon-gmon.c:119
+
+I: Program returns random data in a function
+E: xen no-return-in-nonvoid-function ../../../../newlib-1.16.0/libgloss/i386/cygmon-gmon.c:362
+
+---
+ libgloss/i386/cygmon-gmon.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+Index: newlib-1.16.0/libgloss/i386/cygmon-gmon.c
+===================================================================
+--- newlib-1.16.0.orig/libgloss/i386/cygmon-gmon.c
++++ newlib-1.16.0/libgloss/i386/cygmon-gmon.c
+@@ -61,6 +61,7 @@
+ static char sccsid[] = "@(#)gmon.c	5.3 (Berkeley) 5/22/91";
+ #endif /* not lint */
+ 
++#include <string.h>
+ #define DEBUG
+ #ifdef DEBUG
+ #include <stdio.h>
+@@ -89,7 +90,7 @@ static int	s_scale;
+ 
+ extern int errno;
+ 
+-int
++void
+ monstartup(lowpc, highpc)
+      char	*lowpc;
+      char	*highpc;
+@@ -341,6 +342,7 @@ overflow:
+  *	profiling is what mcount checks to see if
+  *	all the data structures are ready.
+  */
++void
+ moncontrol(mode)
+     int mode;
+ {

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-07-30 18:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 16:12 [PATCH] stubdom: fix errors in newlib Olaf Hering
2012-07-10 16:59 ` Ian Campbell
2012-07-10 18:02   ` Olaf Hering
2012-07-10 20:51   ` Olaf Hering
2012-07-12  7:56   ` Olaf Hering
2012-07-24 14:47     ` [PATCH] stubdom: fix errors in newlib [and 1 more messages] Ian Jackson
2012-07-24 14:48       ` Ian Campbell
2012-07-24 14:49         ` Ian Jackson
2012-07-30 18:44       ` Olaf Hering
2012-07-30 18:45         ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.