From d2ded2689e65367048a4c13f78a2f8a2129b6b74 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: May 11 2023 13:56:24 +0000 Subject: Fix dangling pointer issue with GCC 13 Fixes: rhbz#2189916 --- diff --git a/micropython-dangling-pointer-gcc13.patch b/micropython-dangling-pointer-gcc13.patch new file mode 100644 index 0000000..c217c47 --- /dev/null +++ b/micropython-dangling-pointer-gcc13.patch @@ -0,0 +1,33 @@ +From f1c6cb7725960487195daa5c5c196fd8d3563811 Mon Sep 17 00:00:00 2001 +From: Damien George +Date: Wed, 3 May 2023 15:23:24 +1000 +Subject: [PATCH] py/stackctrl: Add gcc pragmas to ignore dangling-pointer + warning. + +This warning became apparent in gcc 13. + +Signed-off-by: Damien George +--- + py/stackctrl.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/py/stackctrl.c b/py/stackctrl.c +index c2f3adb5eedc..c2566ebad92b 100644 +--- a/py/stackctrl.c ++++ b/py/stackctrl.c +@@ -28,8 +28,15 @@ + #include "py/stackctrl.h" + + void mp_stack_ctrl_init(void) { ++ #if __GNUC__ >= 13 ++ #pragma GCC diagnostic push ++ #pragma GCC diagnostic ignored "-Wdangling-pointer" ++ #endif + volatile int stack_dummy; + MP_STATE_THREAD(stack_top) = (char *)&stack_dummy; ++ #if __GNUC__ >= 13 ++ #pragma GCC diagnostic pop ++ #endif + } + + void mp_stack_set_top(void *top) { diff --git a/micropython.spec b/micropython.spec index df5f2f1..3fae801 100644 --- a/micropython.spec +++ b/micropython.spec @@ -10,7 +10,7 @@ Name: micropython Version: 1.19.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Implementation of Python 3 with very low memory footprint # micorpython itself is MIT @@ -31,6 +31,10 @@ Patch0: micropython-c99.patch # Resolved upstream: https://github.com/micropython/micropython/commit/32572439984e5640c6af46fbe7c27400c30112ce Patch1: micropython-gcc13.patch +# Fix dangling pointer issue with GCC 13 +# Resolved upstream: https://github.com/micropython/micropython/commit/f1c6cb7725960487195daa5c5c196fd8d3563811 +Patch2: micropython-dangling-pointer-gcc13.patch + # Other arches need active porting %if 0%{?fedora} >= 37 || 0%{?rhel} >= 10 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval @@ -113,6 +117,10 @@ install -pm 755 ports/unix/micropython %{buildroot}%{_bindir} %{_bindir}/micropython %changelog +* Thu May 11 2023 Charalampos Stratakis - 1.19.1-6 +- Fix dangling pointer issue with GCC 13 +- Fixes: rhbz#2189916 + * Tue Mar 07 2023 Charalampos Stratakis - 1.19.1-5 - Fix FTBFS with GCC 13 - Fixes: rhbz#2171608