diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3')
10 files changed, 366 insertions, 4 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch index 661f52d01f..ea75262c4f 100644 --- a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch +++ b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch @@ -70,7 +70,7 @@ index 6e81b2f..671a20e 100644 Programs/python.o: $(srcdir)/Programs/python.c @@ -856,7 +857,7 @@ regen-opcode: - Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h + Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h Python/getplatform.o: $(srcdir)/Python/getplatform.c - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c diff --git a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch new file mode 100644 index 0000000000..237645bc60 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch @@ -0,0 +1,34 @@ +From 840fda32c82550259d02a7a56a78a9c05162b1a1 Mon Sep 17 00:00:00 2001 +From: Changqing Li <changqing.li@windriver.com> +Date: Wed, 8 May 2019 16:10:29 +0800 +Subject: [PATCH] Makefile: fix Issue36464 (parallel build race problem) + +When using make -j with the 'install' target, it's possible for altbininstall +(which normally creates BINDIR) and libainstall (which doesn't, though it +installs python-config there) to race, resulting in a failure due to +attempting to install python-config into a nonexistent BINDIR. Ensure it also +exists in the libainstall target. + +Upstream-Status: Submitted [https://github.com/python/cpython/pull/13186] + +Signed-off-by: Changqing Li <changqing.li@windriver.com> +--- + Makefile.pre.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 15f3687..7e9f173 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1456,7 +1456,7 @@ LIBPL= @LIBPL@ + LIBPC= $(LIBDIR)/pkgconfig + + libainstall: @DEF_MAKE_RULE@ python-config +- @for i in $(LIBDIR) $(LIBPL) $(LIBPC); \ ++ @for i in $(LIBDIR) $(LIBPL) $(LIBPC) $(BINDIR); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ +-- +2.7.4 + diff --git a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch new file mode 100644 index 0000000000..8fcb344222 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch @@ -0,0 +1,35 @@ +From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001 +From: Inada Naoki <songofacandy@gmail.com> +Date: Sat, 14 Jul 2018 00:46:11 +0900 +Subject: [PATCH] Use FLAG_REF always for interned strings + +Upstream-status: Submitted [https://github.com/python/cpython/pull/8226] +Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> +--- + Python/marshal.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/Python/marshal.c b/Python/marshal.c +index 6d06266c6a..51db2e3b2e 100644 +--- a/Python/marshal.c ++++ b/Python/marshal.c +@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p) + if (p->version < 3 || p->hashtable == NULL) + return 0; /* not writing object references */ + +- /* if it has only one reference, it definitely isn't shared */ +- if (Py_REFCNT(v) == 1) ++ /* If it has only one reference, it definitely isn't shared. ++ * But we use TYPE_REF always for interned string, to PYC file stable ++ * as possible. ++ */ ++ if (Py_REFCNT(v) == 1 && ++ !(PyUnicode_CheckExact(v) && PyUnicode_CHECK_INTERNED(v))) { + return 0; ++ } + + entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v); + if (entry != NULL) { +-- +2.21.0 + diff --git a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch new file mode 100644 index 0000000000..e7af88654d --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch @@ -0,0 +1,201 @@ +From 7535c39951b9d15dd64c4669092a8582ba555466 Mon Sep 17 00:00:00 2001 +From: Matthias Schoepfer <matthias.schoepfer@ithinx.io> +Date: Fri, 31 May 2019 15:34:34 +0200 +Subject: [PATCH] bpo-36852: proper detection of mips architecture for soft + float + +When (cross) compiling for softfloat mips, __mips_hard_float will not be +defined and detection of OS triplet in configure.ac / configure will fail. + +This also has to do with the custom detection of the build triplet. Trying +to do this in a more autoconf/autotools manner. + +Upstream-Status: Submitted [https://github.com/python/cpython/pull/13196] +Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io> +--- + configure.ac | 169 ++++++--------------------------------------------- + 1 file changed, 17 insertions(+), 152 deletions(-) + +diff --git a/configure.ac b/configure.ac +index a7de901e08..a73e2de51b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -727,158 +727,23 @@ fi + MULTIARCH=$($CC --print-multiarch 2>/dev/null) + AC_SUBST(MULTIARCH) + +-AC_MSG_CHECKING([for the platform triplet based on compiler characteristics]) +-cat >> conftest.c <<EOF +-#undef bfin +-#undef cris +-#undef fr30 +-#undef linux +-#undef hppa +-#undef hpux +-#undef i386 +-#undef mips +-#undef powerpc +-#undef sparc +-#undef unix +-#if defined(__ANDROID__) +- # Android is not a multiarch system. +-#elif defined(__linux__) +-# if defined(__x86_64__) && defined(__LP64__) +- x86_64-linux-gnu +-# elif defined(__x86_64__) && defined(__ILP32__) +- x86_64-linux-gnux32 +-# elif defined(__i386__) +- i386-linux-gnu +-# elif defined(__aarch64__) && defined(__AARCH64EL__) +-# if defined(__ILP32__) +- aarch64_ilp32-linux-gnu +-# else +- aarch64-linux-gnu +-# endif +-# elif defined(__aarch64__) && defined(__AARCH64EB__) +-# if defined(__ILP32__) +- aarch64_be_ilp32-linux-gnu +-# else +- aarch64_be-linux-gnu +-# endif +-# elif defined(__alpha__) +- alpha-linux-gnu +-# elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP) +-# if defined(__ARMEL__) +- arm-linux-gnueabihf +-# else +- armeb-linux-gnueabihf +-# endif +-# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP) +-# if defined(__ARMEL__) +- arm-linux-gnueabi +-# else +- armeb-linux-gnueabi +-# endif +-# elif defined(__hppa__) +- hppa-linux-gnu +-# elif defined(__ia64__) +- ia64-linux-gnu +-# elif defined(__m68k__) && !defined(__mcoldfire__) +- m68k-linux-gnu +-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) && defined(_MIPSEL) +-# if _MIPS_SIM == _ABIO32 +- mipsisa32r6el-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mipsisa64r6el-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mipsisa64r6el-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) +-# if _MIPS_SIM == _ABIO32 +- mipsisa32r6-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mipsisa64r6-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mipsisa64r6-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) && defined(_MIPSEL) +-# if _MIPS_SIM == _ABIO32 +- mipsel-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mips64el-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mips64el-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) +-# if _MIPS_SIM == _ABIO32 +- mips-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mips64-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mips64-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__or1k__) +- or1k-linux-gnu +-# elif defined(__powerpc__) && defined(__SPE__) +- powerpc-linux-gnuspe +-# elif defined(__powerpc64__) +-# if defined(__LITTLE_ENDIAN__) +- powerpc64le-linux-gnu +-# else +- powerpc64-linux-gnu +-# endif +-# elif defined(__powerpc__) +- powerpc-linux-gnu +-# elif defined(__s390x__) +- s390x-linux-gnu +-# elif defined(__s390__) +- s390-linux-gnu +-# elif defined(__sh__) && defined(__LITTLE_ENDIAN__) +- sh4-linux-gnu +-# elif defined(__sparc__) && defined(__arch64__) +- sparc64-linux-gnu +-# elif defined(__sparc__) +- sparc-linux-gnu +-# elif defined(__riscv) +-# if __riscv_xlen == 32 +- riscv32-linux-gnu +-# elif __riscv_xlen == 64 +- riscv64-linux-gnu +-# else +-# error unknown platform triplet +-# endif +-# else +-# error unknown platform triplet +-# endif +-#elif defined(__FreeBSD_kernel__) +-# if defined(__LP64__) +- x86_64-kfreebsd-gnu +-# elif defined(__i386__) +- i386-kfreebsd-gnu +-# else +-# error unknown platform triplet +-# endif +-#elif defined(__gnu_hurd__) +- i386-gnu +-#elif defined(__APPLE__) +- darwin +-#else +-# error unknown platform triplet +-#endif +- +-EOF +- +-if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then +- PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` +- AC_MSG_RESULT([$PLATFORM_TRIPLET]) +-else +- AC_MSG_RESULT([none]) +-fi +-rm -f conftest.c conftest.out ++AC_CANONICAL_TARGET ++## Not using $target to filter out vendor ++## Need to handle macos, vxworks and hurd special (?) :-/ ++case ${target_os} in ++ darwin*) ++ PLATFORM_TRIPLET=darwin ++ ;; ++ hurd*) ++ PLATFORM_TRIPLET=i386-gnu ++ ;; ++ vxworks*) ++ PLATFORM_TRIPLET=vxworks ++ ;; ++ *) ++ PLATFORM_TRIPLET=${target_cpu}-${target_os} ++ ;; ++esac + + if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then + if test x$PLATFORM_TRIPLET != x$MULTIARCH; then +-- +2.21.0 + diff --git a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch index 8083345a4e..1741f5753b 100644 --- a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch +++ b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch @@ -1,4 +1,4 @@ -From 4865615a2bc2b78c739e4c33f536712c7f9af061 Mon Sep 17 00:00:00 2001 +From 17796e353acf08acd604610f34840a4a9d2f4b54 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Thu, 31 Jan 2019 16:46:30 +0100 Subject: [PATCH] distutils/sysconfig: append diff --git a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch index 5735954628..a0ea897f4e 100644 --- a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch +++ b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch @@ -63,7 +63,7 @@ index a7de901..4a3681f 100644 + case $cc_basename in *clang*) AC_SUBST(LLVM_AR) - AC_PATH_TARGET_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path}) + AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path}) @@ -1426,7 +1427,7 @@ then fi fi diff --git a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch new file mode 100644 index 0000000000..35b7e0c480 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch @@ -0,0 +1,46 @@ +From b94995e0c694ec9561efec0d1a59b323340e6105 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Mon, 5 Aug 2019 15:57:39 +0800 +Subject: [PATCH] test_locale.py: correct the test output format + +Before this patch: + # python3 -m test -v test_locale + [snip] + test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous) ... testing with ('tr_TR', 'ISO8859-9') ok + [snip] + + After this patch: + # python3 -m test -v test_locale + [snip] + test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous) ... testing with ('tr_TR', 'ISO8859-9')... ok + [snip] + + Make the test ended with "... ok" is common in python + unittest world, we should make it keep consistent + with other test cases in case it may be ignored to + record in the report if we use the common filter + "... ok". + +Upstream-Status: Submitted [https://github.com/python/cpython/pull/15132] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + Lib/test/test_locale.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py +index e2c2178..558d63c 100644 +--- a/Lib/test/test_locale.py ++++ b/Lib/test/test_locale.py +@@ -527,7 +527,7 @@ class TestMiscellaneous(unittest.TestCase): + self.skipTest('test needs Turkish locale') + loc = locale.getlocale(locale.LC_CTYPE) + if verbose: +- print('testing with %a' % (loc,), end=' ', flush=True) ++ print('testing with %a...' % (loc,), end=' ', flush=True) + locale.setlocale(locale.LC_CTYPE, loc) + self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE)) + +-- +2.7.4 + diff --git a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch index dcc0932c7f..35213171bd 100644 --- a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch +++ b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch @@ -1,4 +1,4 @@ -From 1397979ee445ff6826aa5469511e003539f77bb2 Mon Sep 17 00:00:00 2001 +From 12900d498bb77bcc990868a80eaf0ab257b88fff Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Tue, 14 May 2013 15:00:26 -0700 Subject: [PATCH] python3: Add target and native recipes diff --git a/meta/recipes-devtools/python/python3/crosspythonpath.patch b/meta/recipes-devtools/python/python3/crosspythonpath.patch new file mode 100644 index 0000000000..d789ab57d4 --- /dev/null +++ b/meta/recipes-devtools/python/python3/crosspythonpath.patch @@ -0,0 +1,25 @@ +configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD + +When building x86->x86 the system will try to execute .so and related items +from the default PYTHONPATH. This will fail if the target CPU contains +instructions that the host CPU does not have, add CROSSPYTHONPATH +into PYTHONPATH so we can prepend the list to find correct libs. + +Upstream-Status: Inappropriate [OE-Core integration specific] + +Credits-to: Mark Hatle <mark.hatle@windriver.com> +Credits-to: Jackie Huang <jackie.huang@windriver.com> +Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com> +diff --git a/configure.ac b/configure.ac +index 4ab19a6..7036a53 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -76,7 +76,7 @@ if test "$cross_compiling" = yes; then + AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) + fi + AC_MSG_RESULT($interp) +- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp ++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp + fi + elif test "$cross_compiling" = maybe; then + AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) diff --git a/meta/recipes-devtools/python/python3/reformat_sysconfig.py b/meta/recipes-devtools/python/python3/reformat_sysconfig.py new file mode 100644 index 0000000000..c4164313e8 --- /dev/null +++ b/meta/recipes-devtools/python/python3/reformat_sysconfig.py @@ -0,0 +1,21 @@ +#! /usr/bin/env python3 +# +# SPDX-License-Identifier: MIT +# +# Copyright 2019 by Garmin Ltd. or its subsidiaries +# +# A script to reformat python sysconfig + +import sys +import pprint +l = {} +g = {} +with open(sys.argv[1], 'r') as f: + exec(f.read(), g, l) + +with open(sys.argv[1], 'w') as f: + for k in sorted(l.keys()): + f.write('%s = ' % k) + pprint.pprint(l[k], stream=f, width=sys.maxsize) + f.write('\n') + |