commit 2e4c93ac64b7353d5db15128fe7d559905954d9d Author: Jan Rękorajski <bagg...@pld-linux.org> Date: Sat Dec 28 16:28:17 2024 +0100
- fix building on x32 micropython.spec | 12 ++++++++++-- x32.patch | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) --- diff --git a/micropython.spec b/micropython.spec index 0c7d49e..9aff092 100644 --- a/micropython.spec +++ b/micropython.spec @@ -11,6 +11,7 @@ Group: Development/Languages/Python Source0: http://micropython.org/resources/source/%{name}-%{version}.tar.xz # Source0-md5: 1086e0af7127fc5021ca91f882c985f7 Patch0: x86.patch +Patch1: x32.patch URL: http://micropython.org/ BuildRequires: libffi-devel BuildRequires: mbedtls-devel @@ -20,6 +21,7 @@ BuildRequires: python-modules %if %{with tests} BuildRequires: python3 BuildRequires: python3-modules +BuildRequires: python3-elftools %endif BuildRequires: readline-devel BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -30,6 +32,7 @@ Implementation of Python 3 with very low memory footprint. %prep %setup -q %patch -P 0 -p1 +%patch -P 1 -p1 %build @@ -37,13 +40,18 @@ Implementation of Python 3 with very low memory footprint. %{__make} -C ports/unix \ CC="%{__cc}" \ - CFLAGS_EXTRA="%{rpmcppflags} %{rpmcflags} -Wno-error=maybe-uninitialized" \ + CFLAGS_EXTRA="%{rpmcppflags} %{rpmcflags} -Wno-error=maybe-uninitialized -Wno-error=clobbered" \ LDFLAGS_EXTRA="%{rpmldflags}" \ MICROPY_SSL_MBEDTLS=1 \ STRIP=true \ V=1 -%{?with_tests:%{__make} -C ports/unix test} +%if %{with tests} +%ifarch x32 +export X32=true +%endif +%{__make} -C ports/unix test +%endif %install rm -rf $RPM_BUILD_ROOT diff --git a/x32.patch b/x32.patch new file mode 100644 index 0000000..c4885f2 --- /dev/null +++ b/x32.patch @@ -0,0 +1,39 @@ +--- micropython-1.24.1/py/mpz.h~ 2024-11-30 00:49:21.000000000 +0100 ++++ micropython-1.24.1/py/mpz.h 2024-12-28 15:57:53.439998291 +0100 +@@ -46,8 +46,12 @@ + + #ifndef MPZ_DIG_SIZE + #if defined(__x86_64__) || defined(_WIN64) ++ #if defined(__ILP32__) ++ #define MPZ_DIG_SIZE (16) ++ #else + // 64-bit machine, using 32-bit storage for digits +- #define MPZ_DIG_SIZE (32) ++ #define MPZ_DIG_SIZE (32) ++ #endif + #else + // default: 32-bit machine, using 16-bit storage for digits + #define MPZ_DIG_SIZE (16) +--- micropython-1.24.1/py/nlr.h~ 2024-11-30 00:49:21.000000000 +0100 ++++ micropython-1.24.1/py/nlr.h 2024-12-28 15:54:01.423331665 +0100 +@@ -60,7 +60,7 @@ + #if defined(__i386__) + #define MICROPY_NLR_X86 (1) + #define MICROPY_NLR_NUM_REGS (MICROPY_NLR_NUM_REGS_X86) +-#elif defined(__x86_64__) ++#elif defined(__x86_64__) && !defined(__ILP32__) + #define MICROPY_NLR_X64 (1) + #if MICROPY_NLR_OS_WINDOWS + #define MICROPY_NLR_NUM_REGS (MICROPY_NLR_NUM_REGS_X64_WIN) +--- micropython-1.24.1/tests/run-tests.py~ 2024-11-30 00:49:28.000000000 +0100 ++++ micropython-1.24.1/tests/run-tests.py 2024-12-28 16:24:37.973331385 +0100 +@@ -576,6 +576,9 @@ + "struct_endian", + ) + ++ if os.getenv("X32") == "true": ++ skip_tests.add("micropython/import_mpy_native_gc.py") ++ + # Some tests shouldn't be run on GitHub Actions + if os.getenv("GITHUB_ACTIONS") == "true": + skip_tests.add("thread/stress_schedule.py") # has reliability issues ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/micropython.git/commitdiff/2e4c93ac64b7353d5db15128fe7d559905954d9d _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit