0001-Fix-build-with-python-3.10.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From c977b184350479b8c43a0e002eaf2b13b510ba4f Mon Sep 17 00:00:00 2001
  2. From: Michal Suchanek <msuchanek@suse.de>
  3. Date: Thu, 13 Oct 2022 22:39:51 +0200
  4. Subject: [PATCH 1/2] libfdt: Fix invalid version warning
  5. python does not like the u-boot- prefix in the version, drop it.
  6. /usr/lib/python3.10/site-packages/setuptools/dist.py:544: UserWarning:
  7. The version specified ('u-boot-2022.10') is an invalid version, this may
  8. not work as expected with newer versions of setuptools, pip, and PyPI.
  9. Please see PEP 440 for more details.
  10. Signed-off-by: Michal Suchanek <msuchanek@suse.de>
  11. Reviewed-by: Simon Glass <sjg@chromium.org>
  12. ---
  13. scripts/dtc/pylibfdt/Makefile | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile
  16. index 493995e303..a7579f0c5f 100644
  17. --- a/scripts/dtc/pylibfdt/Makefile
  18. +++ b/scripts/dtc/pylibfdt/Makefile
  19. @@ -17,7 +17,7 @@ quiet_cmd_pymod = PYMOD $@
  20. cmd_pymod = unset CROSS_COMPILE; unset CFLAGS; \
  21. CC="$(HOSTCC)" LDSHARED="$(HOSTCC) -shared " \
  22. LDFLAGS="$(HOSTLDFLAGS)" \
  23. - VERSION="u-boot-$(UBOOTVERSION)" \
  24. + VERSION="$(UBOOTVERSION)" \
  25. CPPFLAGS="$(HOSTCFLAGS) -I$(LIBFDT_srcdir)" OBJDIR=$(obj) \
  26. SOURCES="$(PYLIBFDT_srcs)" \
  27. SWIG_OPTS="-I$(LIBFDT_srcdir) -I$(LIBFDT_srcdir)/.." \
  28. --
  29. 2.43.1
  30. From 7d01bb1c5a1daef0187c9ea276bde19a8d0e7fde Mon Sep 17 00:00:00 2001
  31. From: Michal Suchanek <msuchanek@suse.de>
  32. Date: Thu, 13 Oct 2022 22:43:41 +0200
  33. Subject: [PATCH 2/2] libfdt: Fix build with python 3.10
  34. Python 3.10 requires defining PY_SSIZE_T_CLEAN. This will be fixed in
  35. swig 4.10 but it is not clear when it will be released. There was a
  36. warning since python 3.8.
  37. Link: https://github.com/swig/swig/pull/2277
  38. Signed-off-by: Michal Suchanek <msuchanek@suse.de>
  39. Reviewed-by: Simon Glass <sjg@chromium.org>
  40. ---
  41. scripts/dtc/pylibfdt/libfdt.i_shipped | 4 ++++
  42. 1 file changed, 4 insertions(+)
  43. diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
  44. index 27c29ea260..56cc5d48f4 100644
  45. --- a/scripts/dtc/pylibfdt/libfdt.i_shipped
  46. +++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
  47. @@ -7,6 +7,10 @@
  48. %module libfdt
  49. +%begin %{
  50. +#define PY_SSIZE_T_CLEAN
  51. +%}
  52. +
  53. %include <stdint.i>
  54. %{
  55. --
  56. 2.43.1