Apply upstream patches for better C99 compatibility of configure scripts
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
68935dd0e7
commit
b4a60afda2
40
mingw-gcc-configure-c99-1.patch
Normal file
40
mingw-gcc-configure-c99-1.patch
Normal file
@ -0,0 +1,40 @@
|
||||
commit 7d7146102365f708a37401c902fce2f4024b546a
|
||||
Author: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Wed Jan 4 11:13:17 2023 +0100
|
||||
|
||||
libsanitizer: Avoid implicit function declaration in configure test
|
||||
|
||||
libsanitizer/
|
||||
|
||||
* configure.ac (sanitizer_supported): Include <unistd.h> for
|
||||
syscall prototype.
|
||||
* configure: Regenerate.
|
||||
|
||||
(cherry picked from commit 6be2672e4ee41c566a9e072088cccca263bab5f7)
|
||||
|
||||
diff --git a/libsanitizer/configure b/libsanitizer/configure
|
||||
index 771b135573a8b031..ae8c1bd7e831e83d 100755
|
||||
--- a/libsanitizer/configure
|
||||
+++ b/libsanitizer/configure
|
||||
@@ -16028,6 +16028,7 @@ case "$target" in
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <sys/syscall.h>
|
||||
+#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
|
||||
index 7f1ef3979c4cb03c..ad49f29db7e04d30 100644
|
||||
--- a/libsanitizer/configure.ac
|
||||
+++ b/libsanitizer/configure.ac
|
||||
@@ -161,7 +161,8 @@ case "$target" in
|
||||
*-*-linux*)
|
||||
# Some old Linux distributions miss required syscalls.
|
||||
sanitizer_supported=no
|
||||
- AC_TRY_COMPILE([#include <sys/syscall.h>],[
|
||||
+ AC_TRY_COMPILE([#include <sys/syscall.h>
|
||||
+#include <unistd.h>],[
|
||||
syscall (__NR_gettid);
|
||||
syscall (__NR_futex);
|
||||
syscall (__NR_exit_group);
|
||||
111
mingw-gcc-configure-c99-2.patch
Normal file
111
mingw-gcc-configure-c99-2.patch
Normal file
@ -0,0 +1,111 @@
|
||||
commit 63f3eae53683e857818c4bd3d1de719e1310e22a
|
||||
Author: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Tue Oct 18 16:58:48 2022 +0200
|
||||
|
||||
libiberty: Fix C89-isms in configure tests
|
||||
|
||||
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.
|
||||
|
||||
(cherry picked from commit 885b6660c17fb91980b5682514ef54668e544b02)
|
||||
|
||||
diff --git a/libiberty/acinclude.m4 b/libiberty/acinclude.m4
|
||||
index 6bd127e98268b7ab..6bb690597bfb77c9 100644
|
||||
--- 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
|
||||
index 0a797255c70c00f6..ca83f89da6d670d3 100755
|
||||
--- a/libiberty/configure
|
||||
+++ b/libiberty/configure
|
||||
@@ -6780,7 +6780,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;
|
||||
@@ -6792,7 +6795,9 @@ find_stack_direction ()
|
||||
else
|
||||
return (&dummy > addr) ? 1 : -1;
|
||||
}
|
||||
-main ()
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
{
|
||||
exit (find_stack_direction() < 0);
|
||||
}
|
||||
@@ -7617,6 +7622,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
|
||||
@@ -7644,7 +7651,8 @@ else
|
||||
|
||||
#define MAP_LEN 0x10000
|
||||
|
||||
-main ()
|
||||
+int
|
||||
+main (void)
|
||||
{
|
||||
#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
|
||||
char *p;
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
Name: mingw-gcc
|
||||
Version: %{gcc_version}
|
||||
Release: 5%{?dist}
|
||||
Release: 6%{?dist}
|
||||
Summary: MinGW Windows cross-compiler (GCC) for C
|
||||
|
||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
|
||||
@ -43,6 +43,9 @@ Source0: %{srcdir}.tar.xz
|
||||
# See https://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/8fd2fb03-9b8a-07e1-e162-0bb48bcc3984%40gmail.com/#msg37200751
|
||||
Patch0: 0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch
|
||||
|
||||
Patch1: mingw-gcc-configure-c99-1.patch
|
||||
Patch2: mingw-gcc-configure-c99-2.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: make
|
||||
BuildRequires: texinfo
|
||||
@ -901,6 +904,9 @@ ln -sf %{ucrt64_bindir}/libssp-0.dll %{buildroot}%{ucrt64_libdir}/libssp.dll.a
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jan 04 2023 Florian Weimer <fweimer@redhat.com> - 12.2.1-6
|
||||
- Apply upstream patches to improve C99 compatibility of configure scripts
|
||||
|
||||
* Wed Jan 04 2023 Sandro Mani <manisandro@gmail.com> - 12.2.1-5
|
||||
- Update to 20221121 snapshot
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user