[PATCH v1] stubdom: fix errors in newlib:makedoc

Olaf Hering posted 1 patch 1 year ago
Failed in applying to current master (apply log)
stubdom/Makefile             |  1 +
stubdom/newlib-makedoc.patch | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
create mode 100644 stubdom/newlib-makedoc.patch
[PATCH v1] stubdom: fix errors in newlib:makedoc
Posted by Olaf Hering 1 year ago
rpm post-build-checks found a few code bugs in newlib, and marks them as
errors. Add another newlib patch and apply it during stubdom build.

[  227s] ../../../../newlib-1.16.0/newlib/doc/makedoc.c: In function 'lookup_word':
[  227s] ../../../../newlib-1.16.0/newlib/doc/makedoc.c:1147:10: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
[  227s]       if (strcmp(ptr->word, word) == 0) return ptr;
[  227s]           ^

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

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

Depends on newlib-cygmon-gmon.patch

 stubdom/Makefile             |  1 +
 stubdom/newlib-makedoc.patch | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 stubdom/newlib-makedoc.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index cddbbe2da0..a21e1c3fa3 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -96,6 +96,7 @@ newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
 	patch -d $@ -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
 	patch -d $@ -p1 < newlib-disable-texinfo.patch
 	patch -d $@ -p1 < newlib-cygmon-gmon.patch
+	patch -d $@ -p1 < newlib-makedoc.patch
 	find $@ -type f | xargs perl -i.bak \
 		-pe 's/\b_(tzname|daylight|timezone)\b/$$1/g'
 	touch $@
diff --git a/stubdom/newlib-makedoc.patch b/stubdom/newlib-makedoc.patch
new file mode 100644
index 0000000000..90678f1b63
--- /dev/null
+++ b/stubdom/newlib-makedoc.patch
@@ -0,0 +1,35 @@
+stubdom: fix errors in newlib
+
+rpm post-build-checks found a few code bugs in newlib, and marks them as
+errors. Add another newlib patch and apply it during stubdom build.
+
+[  227s] ../../../../newlib-1.16.0/newlib/doc/makedoc.c: In function 'lookup_word':
+[  227s] ../../../../newlib-1.16.0/newlib/doc/makedoc.c:1147:10: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
+[  227s]       if (strcmp(ptr->word, word) == 0) return ptr;
+[  227s]           ^
+
+[  460s] I: Program is using implicit definitions of special functions.
+[  460s]    these functions need to use their correct prototypes to allow
+[  460s]    the lightweight buffer overflow checking to work.
+[  460s]      - Implicit memory/string functions need #include <string.h>.
+[  460s]      - Implicit *printf functions need #include <stdio.h>.
+[  460s]      - Implicit *printf functions need #include <stdio.h>.
+[  460s]      - Implicit *read* functions need #include <unistd.h>.
+[  460s]      - Implicit *recv* functions need #include <sys/socket.h>.
+[  460s] E: xen implicit-fortify-decl ../../../../newlib-1.16.0/newlib/doc/makedoc.c:1147
+---
+ newlib/doc/makedoc.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+Index: newlib-1.16.0/newlib/doc/makedoc.c
+===================================================================
+--- newlib-1.16.0.orig/newlib/doc/makedoc.c
++++ newlib-1.16.0/newlib/doc/makedoc.c
+@@ -38,6 +38,7 @@ There is  no
+ #include "ansidecl.h"
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <ctype.h>
+ 
+ #define DEF_SIZE 5000
Re: [PATCH v1] stubdom: fix errors in newlib:makedoc
Posted by Samuel Thibault 1 year ago
Olaf Hering, le mer. 26 avril 2023 10:52:39 +0000, a ecrit:
> rpm post-build-checks found a few code bugs in newlib, and marks them as
> errors. Add another newlib patch and apply it during stubdom build.
> 
> [  227s] ../../../../newlib-1.16.0/newlib/doc/makedoc.c: In function 'lookup_word':
> [  227s] ../../../../newlib-1.16.0/newlib/doc/makedoc.c:1147:10: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
> [  227s]       if (strcmp(ptr->word, word) == 0) return ptr;
> [  227s]           ^
> 
> [  460s] I: Program is using implicit definitions of special functions.
> [  460s]    these functions need to use their correct prototypes to allow
> [  460s]    the lightweight buffer overflow checking to work.
> [  460s]      - Implicit memory/string functions need #include <string.h>.
> [  460s]      - Implicit *printf functions need #include <stdio.h>.
> [  460s]      - Implicit *printf functions need #include <stdio.h>.
> [  460s]      - Implicit *read* functions need #include <unistd.h>.
> [  460s]      - Implicit *recv* functions need #include <sys/socket.h>.
> [  460s] E: xen implicit-fortify-decl ../../../../newlib-1.16.0/newlib/doc/makedoc.c:1147
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Thanks!

> ---
> 
> Depends on newlib-cygmon-gmon.patch
> 
>  stubdom/Makefile             |  1 +
>  stubdom/newlib-makedoc.patch | 35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100644 stubdom/newlib-makedoc.patch
> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index cddbbe2da0..a21e1c3fa3 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -96,6 +96,7 @@ newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
>  	patch -d $@ -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
>  	patch -d $@ -p1 < newlib-disable-texinfo.patch
>  	patch -d $@ -p1 < newlib-cygmon-gmon.patch
> +	patch -d $@ -p1 < newlib-makedoc.patch
>  	find $@ -type f | xargs perl -i.bak \
>  		-pe 's/\b_(tzname|daylight|timezone)\b/$$1/g'
>  	touch $@
> diff --git a/stubdom/newlib-makedoc.patch b/stubdom/newlib-makedoc.patch
> new file mode 100644
> index 0000000000..90678f1b63
> --- /dev/null
> +++ b/stubdom/newlib-makedoc.patch
> @@ -0,0 +1,35 @@
> +stubdom: fix errors in newlib
> +
> +rpm post-build-checks found a few code bugs in newlib, and marks them as
> +errors. Add another newlib patch and apply it during stubdom build.
> +
> +[  227s] ../../../../newlib-1.16.0/newlib/doc/makedoc.c: In function 'lookup_word':
> +[  227s] ../../../../newlib-1.16.0/newlib/doc/makedoc.c:1147:10: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
> +[  227s]       if (strcmp(ptr->word, word) == 0) return ptr;
> +[  227s]           ^
> +
> +[  460s] I: Program is using implicit definitions of special functions.
> +[  460s]    these functions need to use their correct prototypes to allow
> +[  460s]    the lightweight buffer overflow checking to work.
> +[  460s]      - Implicit memory/string functions need #include <string.h>.
> +[  460s]      - Implicit *printf functions need #include <stdio.h>.
> +[  460s]      - Implicit *printf functions need #include <stdio.h>.
> +[  460s]      - Implicit *read* functions need #include <unistd.h>.
> +[  460s]      - Implicit *recv* functions need #include <sys/socket.h>.
> +[  460s] E: xen implicit-fortify-decl ../../../../newlib-1.16.0/newlib/doc/makedoc.c:1147
> +---
> + newlib/doc/makedoc.c |    1 +
> + 1 file changed, 1 insertion(+)
> +
> +Index: newlib-1.16.0/newlib/doc/makedoc.c
> +===================================================================
> +--- newlib-1.16.0.orig/newlib/doc/makedoc.c
> ++++ newlib-1.16.0/newlib/doc/makedoc.c
> +@@ -38,6 +38,7 @@ There is  no
> + #include "ansidecl.h"
> + #include <stdio.h>
> + #include <stdlib.h>
> ++#include <string.h>
> + #include <ctype.h>
> + 
> + #define DEF_SIZE 5000
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.