From 2dfbe7e5df8413e00220fee3e0268da72bab0b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 28 Nov 2023 15:01:38 +0100 Subject: [PATCH] Fix implicit-function-declarations in configure - Fixes: rhbz#2147519 --- ...igure-check-for-pthread_scope_system.patch | 47 ++++++++ ...13497-fix-broken-nice-configure-test.patch | 25 ++++ ...t-function-declarations-in-configure.patch | 114 ++++++++++++++++++ python3.6.spec | 26 +++- 4 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 00407-gh-99086-fix-implicit-int-compiler-warning-in-configure-check-for-pthread_scope_system.patch create mode 100644 00409-bpo-13497-fix-broken-nice-configure-test.patch create mode 100644 00410-bpo-42598-fix-implicit-function-declarations-in-configure.patch diff --git a/00407-gh-99086-fix-implicit-int-compiler-warning-in-configure-check-for-pthread_scope_system.patch b/00407-gh-99086-fix-implicit-int-compiler-warning-in-configure-check-for-pthread_scope_system.patch new file mode 100644 index 0000000..5e83173 --- /dev/null +++ b/00407-gh-99086-fix-implicit-int-compiler-warning-in-configure-check-for-pthread_scope_system.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Erlend E. Aasland" +Date: Sun, 6 Nov 2022 22:39:34 +0100 +Subject: [PATCH] 00407: gh-99086: Fix implicit int compiler warning in + configure check for PTHREAD_SCOPE_SYSTEM + +Co-authored-by: Sam James +--- + .../next/Build/2022-11-04-02-58-10.gh-issue-99086.DV_4Br.rst | 1 + + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 3 insertions(+), 2 deletions(-) + create mode 100644 Misc/NEWS.d/next/Build/2022-11-04-02-58-10.gh-issue-99086.DV_4Br.rst + +diff --git a/Misc/NEWS.d/next/Build/2022-11-04-02-58-10.gh-issue-99086.DV_4Br.rst b/Misc/NEWS.d/next/Build/2022-11-04-02-58-10.gh-issue-99086.DV_4Br.rst +new file mode 100644 +index 0000000000..e320ecfdfb +--- /dev/null ++++ b/Misc/NEWS.d/next/Build/2022-11-04-02-58-10.gh-issue-99086.DV_4Br.rst +@@ -0,0 +1 @@ ++Fix ``-Wimplicit-int`` compiler warning in :program:`configure` check for ``PTHREAD_SCOPE_SYSTEM``. +diff --git a/configure b/configure +index e39c16eee2..32c27a468d 100755 +--- a/configure ++++ b/configure +@@ -10837,7 +10837,7 @@ else + void *foo(void *parm) { + return NULL; + } +- main() { ++ int main() { + pthread_attr_t attr; + pthread_t id; + if (pthread_attr_init(&attr)) exit(-1); +diff --git a/configure.ac b/configure.ac +index d5ca7172ca..f7668224be 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3185,7 +3185,7 @@ if test "$posix_threads" = "yes"; then + void *foo(void *parm) { + return NULL; + } +- main() { ++ int main() { + pthread_attr_t attr; + pthread_t id; + if (pthread_attr_init(&attr)) exit(-1); diff --git a/00409-bpo-13497-fix-broken-nice-configure-test.patch b/00409-bpo-13497-fix-broken-nice-configure-test.patch new file mode 100644 index 0000000..b4a9205 --- /dev/null +++ b/00409-bpo-13497-fix-broken-nice-configure-test.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: ngie-eign <1574099+ngie-eign@users.noreply.github.com> +Date: Mon, 25 Feb 2019 21:34:24 -0800 +Subject: [PATCH] 00409: bpo-13497: Fix `broken nice` configure test + +Per POSIX, `nice(3)` requires `unistd.h` and `exit(3)` requires `stdlib.h`. + +Fixing the test will prevent false positives with pedantic compilers like clang. +--- + configure.ac | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure.ac b/configure.ac +index f7668224be..2696661ab9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4946,6 +4946,8 @@ LIBS=$LIBS_no_readline + AC_MSG_CHECKING(for broken nice()) + AC_CACHE_VAL(ac_cv_broken_nice, [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++#include ++#include + int main() + { + int val1 = nice(1); diff --git a/00410-bpo-42598-fix-implicit-function-declarations-in-configure.patch b/00410-bpo-42598-fix-implicit-function-declarations-in-configure.patch new file mode 100644 index 0000000..89e2a3e --- /dev/null +++ b/00410-bpo-42598-fix-implicit-function-declarations-in-configure.patch @@ -0,0 +1,114 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joshua Root +Date: Mon, 14 Dec 2020 07:56:34 +1100 +Subject: [PATCH] 00410: bpo-42598: Fix implicit function declarations in + configure + +This is invalid in C99 and later and is an error with some compilers +(e.g. clang in Xcode 12), and can thus cause configure checks to +produce incorrect results. +--- + .../Build/2020-12-13-14-43-10.bpo-42598.7ipr5H.rst | 2 ++ + configure | 13 +++++++------ + configure.ac | 13 +++++++------ + 3 files changed, 16 insertions(+), 12 deletions(-) + create mode 100644 Misc/NEWS.d/next/Build/2020-12-13-14-43-10.bpo-42598.7ipr5H.rst + +diff --git a/Misc/NEWS.d/next/Build/2020-12-13-14-43-10.bpo-42598.7ipr5H.rst b/Misc/NEWS.d/next/Build/2020-12-13-14-43-10.bpo-42598.7ipr5H.rst +new file mode 100644 +index 0000000000..7dafc105c4 +--- /dev/null ++++ b/Misc/NEWS.d/next/Build/2020-12-13-14-43-10.bpo-42598.7ipr5H.rst +@@ -0,0 +1,2 @@ ++Fix implicit function declarations in configure which could have resulted in ++incorrect configuration checks. Patch contributed by Joshua Root. +diff --git a/configure b/configure +index 32c27a468d..68a46deef5 100755 +--- a/configure ++++ b/configure +@@ -10840,10 +10840,10 @@ else + int main() { + pthread_attr_t attr; + pthread_t id; +- if (pthread_attr_init(&attr)) exit(-1); +- if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1); +- if (pthread_create(&id, &attr, foo, NULL)) exit(-1); +- exit(0); ++ if (pthread_attr_init(&attr)) return (-1); ++ if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1); ++ if (pthread_create(&id, &attr, foo, NULL)) return (-1); ++ return (0); + } + _ACEOF + if ac_fn_c_try_run "$LINENO"; then : +@@ -14891,7 +14891,7 @@ else + int main() + { + /* Success: exit code 0 */ +- exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1); ++ return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1); + } + + _ACEOF +@@ -15213,7 +15213,7 @@ else + + int main() + { +- exit(((-1)>>3 == -1) ? 0 : 1); ++ return (((-1)>>3 == -1) ? 0 : 1); + } + + _ACEOF +@@ -15725,6 +15725,7 @@ else + /* end confdefs.h. */ + + #include ++#include + + int main() + { +diff --git a/configure.ac b/configure.ac +index 2696661ab9..9d2ad9afba 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3188,10 +3188,10 @@ if test "$posix_threads" = "yes"; then + int main() { + pthread_attr_t attr; + pthread_t id; +- if (pthread_attr_init(&attr)) exit(-1); +- if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1); +- if (pthread_create(&id, &attr, foo, NULL)) exit(-1); +- exit(0); ++ if (pthread_attr_init(&attr)) return (-1); ++ if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1); ++ if (pthread_create(&id, &attr, foo, NULL)) return (-1); ++ return (0); + }]])], + [ac_cv_pthread_system_supported=yes], + [ac_cv_pthread_system_supported=no], +@@ -4743,7 +4743,7 @@ then + int main() + { + /* Success: exit code 0 */ +- exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1); ++ return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1); + } + ]])], + [ac_cv_wchar_t_signed=yes], +@@ -4818,7 +4818,7 @@ AC_CACHE_VAL(ac_cv_rshift_extends_sign, [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + int main() + { +- exit(((-1)>>3 == -1) ? 0 : 1); ++ return (((-1)>>3 == -1) ? 0 : 1); + } + ]])], + [ac_cv_rshift_extends_sign=yes], +@@ -4970,6 +4970,7 @@ AC_MSG_CHECKING(for broken poll()) + AC_CACHE_VAL(ac_cv_broken_poll, + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include ++#include + + int main() + { diff --git a/python3.6.spec b/python3.6.spec index 82eca04..92ffa19 100644 --- a/python3.6.spec +++ b/python3.6.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 20%{?dist} +Release: 21%{?dist} # Python is Python # pip MIT is and bundles: # appdirs: MIT @@ -626,6 +626,26 @@ Patch394: 00394-cve-2022-45061-cpu-denial-of-service-via-inefficient-idna-decode # Backported from Python 3.12 Patch399: 00399-cve-2023-24329.patch +# 00407 # f562db9763f424318fd311e3267d2aed0afadbbe +# gh-99086: Fix implicit int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM +Patch407: 00407-gh-99086-fix-implicit-int-compiler-warning-in-configure-check-for-pthread_scope_system.patch + +# 00409 # e9d6272416d44decf99497e4eca478e44be6a8e2 +# bpo-13497: Fix `broken nice` configure test +# +# Per POSIX, `nice(3)` requires `unistd.h` and `exit(3)` requires `stdlib.h`. +# +# Fixing the test will prevent false positives with pedantic compilers like clang. +Patch409: 00409-bpo-13497-fix-broken-nice-configure-test.patch + +# 00410 # ea9f02d63dc0f772362f520967bce90e4f4d3abd +# bpo-42598: Fix implicit function declarations in configure +# +# This is invalid in C99 and later and is an error with some compilers +# (e.g. clang in Xcode 12), and can thus cause configure checks to +# produce incorrect results. +Patch410: 00410-bpo-42598-fix-implicit-function-declarations-in-configure.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1883,6 +1903,10 @@ CheckPython optimized # ====================================================== %changelog +* Tue Nov 28 2023 Miro HronĨok - 3.6.15-21 +- Fix implicit-function-declarations in configure +- Fixes: rhbz#2147519 + * Wed Aug 02 2023 Charalampos Stratakis - 3.6.15-20 - Remove extra distro-applied CFLAGS passed to user built C extensions - https://fedoraproject.org/wiki/Changes/Python_Extension_Flags_Reduction