Updates for "ModernC" initiative

Resolves: rhbz#2143992
This commit is contained in:
Keith Seitz 2022-11-29 14:19:51 -08:00
parent 3d614802ea
commit 910689b88d
7 changed files with 130 additions and 8 deletions

View File

@ -309,3 +309,7 @@ Patch073: gdb-backport-fix-break-main-file-remove-fail.patch
# (Keith Seitz, build/22395)
Patch074: gdb-sw22395-constify-target_desc.patch
# libiberty: Fix C89-isms in configure tests
# (Florian Weimer, RHBZ 2143992)
Patch075: gdb-rhbz2143992-libiberty-fix-c89isms-in-configure.patch

View File

@ -72,3 +72,4 @@
%patch072 -p1
%patch073 -p1
%patch074 -p1
%patch075 -p1

View File

@ -72,3 +72,4 @@ gdb-rhbz1553104-s390x-arch12-test.patch
gdb-backport-readline_support.patch
gdb-backport-fix-break-main-file-remove-fail.patch
gdb-sw22395-constify-target_desc.patch
gdb-rhbz2143992-libiberty-fix-c89isms-in-configure.patch

View File

@ -305,7 +305,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC The `Yet Another Compiler Compiler' implementation to use.
Defaults to the first program found out of: `bison -y', `byacc',
`yacc'.
@@ -6634,6 +6646,494 @@ _ACEOF
@@ -6634,6 +6646,495 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
$as_echo "$with_auto_load_safe_path" >&6; }
@ -369,6 +369,7 @@ diff --git a/gdb/configure b/gdb/configure
+#include <rpm/rpmlib.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <string.h>
+
+int
+main ()
@ -803,7 +804,7 @@ diff --git a/gdb/configure b/gdb/configure
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -153,6 +153,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
@@ -153,6 +153,200 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
[Directories safe to hold auto-loaded files.])
AC_MSG_RESULT([$with_auto_load_safe_path])
@ -853,6 +854,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
+#include <rpm/rpmlib.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <string.h>
+ ]], [[
+ void *h;
+ const char *const *rpmverp;

View File

@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
@@ -9567,6 +9567,7 @@ if test x"$prefer_curses" = xyes; then
@@ -9568,6 +9568,7 @@ if test x"$prefer_curses" = xyes; then
# search /usr/local/include, if ncurses is installed in /usr/local. A
# default installation of ncurses on alpha*-dec-osf* will lead to such
# a situation.
@ -20,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
$as_echo_n "checking for library containing waddstr... " >&6; }
if ${ac_cv_search_waddstr+:} false; then :
@@ -9591,7 +9592,7 @@ return waddstr ();
@@ -9592,7 +9593,7 @@ return waddstr ();
return 0;
}
_ACEOF
@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -9665,6 +9666,7 @@ case $host_os in
@@ -9666,6 +9667,7 @@ case $host_os in
esac
# These are the libraries checked by Readline.
@ -37,7 +37,7 @@ diff --git a/gdb/configure b/gdb/configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
$as_echo_n "checking for library containing tgetent... " >&6; }
if ${ac_cv_search_tgetent+:} false; then :
@@ -9689,7 +9691,7 @@ return tgetent ();
@@ -9690,7 +9692,7 @@ return tgetent ();
return 0;
}
_ACEOF
@ -49,7 +49,7 @@ diff --git a/gdb/configure b/gdb/configure
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -713,7 +713,8 @@ if test x"$prefer_curses" = xyes; then
@@ -714,7 +714,8 @@ if test x"$prefer_curses" = xyes; then
# search /usr/local/include, if ncurses is installed in /usr/local. A
# default installation of ncurses on alpha*-dec-osf* will lead to such
# a situation.
@ -59,7 +59,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
if test "$ac_cv_search_waddstr" != no; then
curses_found=yes
@@ -755,7 +756,8 @@ case $host_os in
@@ -756,7 +757,8 @@ case $host_os in
esac
# These are the libraries checked by Readline.

View File

@ -0,0 +1,109 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Keith Seitz <keiths@redhat.com>
Date: Tue, 29 Nov 2022 13:43:34 -0800
Subject: gdb-rhbz2143992-libiberty-fix-c89isms-in-configure.patch
;; libiberty: Fix C89-isms in configure tests
;; (Florian Weimer, RHBZ 2143992)
libiberty/
* acinclude.m4 (ac_cv_func_strncmp_works): Add missing
int return type and parameter list to the definition of main.
Include <stdlib.h> and <string.h> for prototypes.
(ac_cv_c_stack_direction): Add missing
int return type and parameter list to the definitions of
main, find_stack_direction. Include <stdlib.h> for exit
prototype.
* configure: Regenerate.
diff --git a/libiberty/acinclude.m4 b/libiberty/acinclude.m4
--- a/libiberty/acinclude.m4
+++ b/libiberty/acinclude.m4
@@ -24,6 +24,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works,
[AC_TRY_RUN([
/* Test by Jim Wilson and Kaveh Ghazi.
Check whether strncmp reads past the end of its string parameters. */
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#ifdef HAVE_FCNTL_H
@@ -51,7 +53,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works,
#define MAP_LEN 0x10000
-main ()
+int
+main (void)
{
#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
char *p;
@@ -157,7 +160,10 @@ if test $ac_cv_os_cray = yes; then
fi
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
-[AC_TRY_RUN([find_stack_direction ()
+[AC_TRY_RUN([#include <stdlib.h>
+
+int
+find_stack_direction (void)
{
static char *addr = 0;
auto char dummy;
@@ -169,7 +175,9 @@ AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
else
return (&dummy > addr) ? 1 : -1;
}
-main ()
+
+int
+main (void)
{
exit (find_stack_direction() < 0);
}],
diff --git a/libiberty/configure b/libiberty/configure
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -6918,7 +6918,10 @@ else
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-find_stack_direction ()
+#include <stdlib.h>
+
+int
+find_stack_direction (void)
{
static char *addr = 0;
auto char dummy;
@@ -6930,7 +6933,9 @@ find_stack_direction ()
else
return (&dummy > addr) ? 1 : -1;
}
-main ()
+
+int
+main (void)
{
exit (find_stack_direction() < 0);
}
@@ -7755,6 +7760,8 @@ else
/* Test by Jim Wilson and Kaveh Ghazi.
Check whether strncmp reads past the end of its string parameters. */
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#ifdef HAVE_FCNTL_H
@@ -7782,7 +7789,8 @@ else
#define MAP_LEN 0x10000
-main ()
+int
+main (void)
{
#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
char *p;

View File

@ -1186,6 +1186,11 @@ fi
%endif
%changelog
* Wed Nov 30 2022 Keith Seitz <keiths@redhat.com>
- Backport "libiberty: Fix C89-isms in configure tests" and do likewise in
gdb-6.6-buildid-locate-rpm.patch.
(Florian Weimer, RHBZ 2143992)
* Wed Nov 23 2022 Kevin Buettner <kevinb@redhat.com>
- Remove gdb-6.3-inheritancetest-20050726.patch. Upstream testcase
gdb.cp/impl-this.exp tests the printing of an instance variable from