summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3')
-rw-r--r--meta/recipes-devtools/python/python3/000-cross-compile.patch36
-rw-r--r--meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch19
-rw-r--r--meta/recipes-devtools/python/python3/04-default-is-optimized.patch38
-rw-r--r--meta/recipes-devtools/python/python3/makerace.patch28
-rw-r--r--meta/recipes-devtools/python/python3/python-3.3-multilib.patch140
-rw-r--r--meta/recipes-devtools/python/python3/use_packed_importlib.patch31
6 files changed, 141 insertions, 151 deletions
diff --git a/meta/recipes-devtools/python/python3/000-cross-compile.patch b/meta/recipes-devtools/python/python3/000-cross-compile.patch
index 2506a590c0..a3ffe3bea8 100644
--- a/meta/recipes-devtools/python/python3/000-cross-compile.patch
+++ b/meta/recipes-devtools/python/python3/000-cross-compile.patch
@@ -9,9 +9,11 @@ Upstream-Status: Inappropriate[Configuration Specific]
9 Makefile.pre.in | 25 +++++++++++++------------ 9 Makefile.pre.in | 25 +++++++++++++------------
10 1 file changed, 13 insertions(+), 12 deletions(-) 10 1 file changed, 13 insertions(+), 12 deletions(-)
11 11
12--- a/Makefile.pre.in 12Index: Python-3.5.0/Makefile.pre.in
13+++ b/Makefile.pre.in 13===================================================================
14@@ -193,6 +193,7 @@ LIBOBJS= @LIBOBJS@ 14--- Python-3.5.0.orig/Makefile.pre.in
15+++ Python-3.5.0/Makefile.pre.in
16@@ -215,6 +215,7 @@ LIBOBJS= @LIBOBJS@
15 17
16 PYTHON= python$(EXE) 18 PYTHON= python$(EXE)
17 BUILDPYTHON= python$(BUILDEXE) 19 BUILDPYTHON= python$(BUILDEXE)
@@ -19,7 +21,7 @@ Upstream-Status: Inappropriate[Configuration Specific]
19 21
20 PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ 22 PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
21 _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ 23 _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
22@@ -239,6 +240,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ 24@@ -272,6 +273,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
23 ########################################################################## 25 ##########################################################################
24 # Parser 26 # Parser
25 PGEN= Parser/pgen$(EXE) 27 PGEN= Parser/pgen$(EXE)
@@ -27,7 +29,7 @@ Upstream-Status: Inappropriate[Configuration Specific]
27 29
28 PSRCS= \ 30 PSRCS= \
29 Parser/acceler.c \ 31 Parser/acceler.c \
30@@ -451,7 +453,7 @@ build_all_generate_profile: 32@@ -494,7 +496,7 @@ build_all_generate_profile:
31 33
32 run_profile_task: 34 run_profile_task:
33 : # FIXME: can't run for a cross build 35 : # FIXME: can't run for a cross build
@@ -35,17 +37,17 @@ Upstream-Status: Inappropriate[Configuration Specific]
35+ $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) 37+ $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK)
36 38
37 build_all_use_profile: 39 build_all_use_profile:
38 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction" 40 $(MAKE) all CFLAGS_NODIST="$(CFLAGS) -fprofile-use -fprofile-correction"
39@@ -640,7 +642,7 @@ $(IO_OBJS): $(IO_H) 41@@ -764,7 +766,7 @@ $(IO_OBJS): $(IO_H)
40 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) 42
43 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
41 @$(MKDIR_P) Include 44 @$(MKDIR_P) Include
42 $(MAKE) $(PGEN)
43- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) 45- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
44+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) 46+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
45 $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) 47 $(GRAMMAR_C): $(GRAMMAR_H)
46 $(MAKE) $(GRAMMAR_H)
47 touch $(GRAMMAR_C) 48 touch $(GRAMMAR_C)
48@@ -820,7 +822,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho 49
50@@ -953,7 +955,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/pyth
49 ###################################################################### 51 ######################################################################
50 52
51 TESTOPTS= $(EXTRATESTOPTS) 53 TESTOPTS= $(EXTRATESTOPTS)
@@ -54,7 +56,7 @@ Upstream-Status: Inappropriate[Configuration Specific]
54 TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py 56 TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
55 TESTTIMEOUT= 3600 57 TESTTIMEOUT= 3600
56 58
57@@ -1229,7 +1231,7 @@ frameworkinstallstructure: $(LDLIBRARY) 59@@ -1440,7 +1442,7 @@ frameworkinstallstructure: $(LDLIBRARY)
58 fi; \ 60 fi; \
59 done 61 done
60 $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers 62 $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
@@ -63,7 +65,7 @@ Upstream-Status: Inappropriate[Configuration Specific]
63 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current 65 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
64 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) 66 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
65 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers 67 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
66@@ -1288,7 +1290,7 @@ config.status: $(srcdir)/configure 68@@ -1506,7 +1508,7 @@ config.status: $(srcdir)/configure
67 69
68 # Run reindent on the library 70 # Run reindent on the library
69 reindent: 71 reindent:
@@ -72,12 +74,12 @@ Upstream-Status: Inappropriate[Configuration Specific]
72 74
73 # Rerun configure with the same options as it was run last time, 75 # Rerun configure with the same options as it was run last time,
74 # provided the config.status script exists 76 # provided the config.status script exists
75@@ -1414,7 +1416,7 @@ funny: 77@@ -1639,7 +1641,7 @@ funny:
76 78
77 # Perform some verification checks on any modified files. 79 # Perform some verification checks on any modified files.
78 patchcheck: 80 patchcheck: all
79- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py 81- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
80+ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py 82+ $(RUNSHARED) ./$(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
81 83
82 # Dependencies 84 # Dependencies
83 85
diff --git a/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
index 03ef286941..819ba69eda 100644
--- a/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
+++ b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
@@ -8,9 +8,11 @@ Upstream-Status: Inappropriate[Embedded-Specific]
8 Makefile.pre.in | 16 ---------------- 8 Makefile.pre.in | 16 ----------------
9 1 file changed, 16 deletions(-) 9 1 file changed, 16 deletions(-)
10 10
11--- a/Makefile.pre.in 11Index: Python-3.5.0/Makefile.pre.in
12+++ b/Makefile.pre.in 12===================================================================
13@@ -1078,24 +1078,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL 13--- Python-3.5.0.orig/Makefile.pre.in
14+++ Python-3.5.0/Makefile.pre.in
15@@ -1262,33 +1262,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL
14 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ 16 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
15 $(DESTDIR)$(LIBDEST)/distutils/tests ; \ 17 $(DESTDIR)$(LIBDEST)/distutils/tests ; \
16 fi 18 fi
@@ -24,7 +26,12 @@ Upstream-Status: Inappropriate[Embedded-Specific]
24- -d $(LIBDEST) -f \ 26- -d $(LIBDEST) -f \
25- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ 27- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
26- $(DESTDIR)$(LIBDEST) 28- $(DESTDIR)$(LIBDEST)
27- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ 29- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
30- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
31- -d $(LIBDEST) -f \
32- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
33- $(DESTDIR)$(LIBDEST)
34- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
28- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ 35- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
29- -d $(LIBDEST)/site-packages -f \ 36- -d $(LIBDEST)/site-packages -f \
30- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages 37- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
@@ -32,6 +39,10 @@ Upstream-Status: Inappropriate[Embedded-Specific]
32- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ 39- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
33- -d $(LIBDEST)/site-packages -f \ 40- -d $(LIBDEST)/site-packages -f \
34- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages 41- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
42- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
43- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
44- -d $(LIBDEST)/site-packages -f \
45- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
35 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ 46 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
36 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt 47 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
37 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ 48 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
diff --git a/meta/recipes-devtools/python/python3/04-default-is-optimized.patch b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch
index 3b8f264a58..4b8a7e56bc 100644
--- a/meta/recipes-devtools/python/python3/04-default-is-optimized.patch
+++ b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch
@@ -12,24 +12,11 @@ Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
12Rebased for 3.4.2 02/2015 12Rebased for 3.4.2 02/2015
13Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> 13Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
14 14
15Index: Python-3.4.2/Python/compile.c 15Index: Python-3.5.0/Modules/main.c
16=================================================================== 16===================================================================
17--- Python-3.4.2.orig/Python/compile.c 17--- Python-3.5.0.orig/Modules/main.c
18+++ Python-3.4.2/Python/compile.c 18+++ Python-3.5.0/Modules/main.c
19@@ -30,7 +30,7 @@ 19@@ -37,7 +37,7 @@ static wchar_t **orig_argv;
20 #include "symtable.h"
21 #include "opcode.h"
22
23-int Py_OptimizeFlag = 0;
24+int Py_OptimizeFlag = 1;
25
26 #define DEFAULT_BLOCK_SIZE 16
27 #define DEFAULT_BLOCKS 8
28Index: Python-3.4.2/Modules/main.c
29===================================================================
30--- Python-3.4.2.orig/Modules/main.c
31+++ Python-3.4.2/Modules/main.c
32@@ -38,7 +38,7 @@ static wchar_t **orig_argv;
33 static int orig_argc; 20 static int orig_argc;
34 21
35 /* command line options */ 22 /* command line options */
@@ -38,7 +25,7 @@ Index: Python-3.4.2/Modules/main.c
38 25
39 #define PROGRAM_OPTS BASE_OPTS 26 #define PROGRAM_OPTS BASE_OPTS
40 27
41@@ -64,6 +64,7 @@ static char *usage_2 = "\ 28@@ -63,6 +63,7 @@ static char *usage_2 = "\
42 -m mod : run library module as a script (terminates option list)\n\ 29 -m mod : run library module as a script (terminates option list)\n\
43 -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\ 30 -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
44 -OO : remove doc-strings in addition to the -O optimizations\n\ 31 -OO : remove doc-strings in addition to the -O optimizations\n\
@@ -46,7 +33,7 @@ Index: Python-3.4.2/Modules/main.c
46 -q : don't print version and copyright messages on interactive startup\n\ 33 -q : don't print version and copyright messages on interactive startup\n\
47 -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\ 34 -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\
48 -S : don't imply 'import site' on initialization\n\ 35 -S : don't imply 'import site' on initialization\n\
49@@ -418,8 +419,8 @@ Py_Main(int argc, wchar_t **argv) 36@@ -419,8 +420,8 @@ Py_Main(int argc, wchar_t **argv)
50 37
51 /* case 'J': reserved for Jython */ 38 /* case 'J': reserved for Jython */
52 39
@@ -57,3 +44,16 @@ Index: Python-3.4.2/Modules/main.c
57 break; 44 break;
58 45
59 case 'B': 46 case 'B':
47Index: Python-3.5.0/Python/pylifecycle.c
48===================================================================
49--- Python-3.5.0.orig/Python/pylifecycle.c
50+++ Python-3.5.0/Python/pylifecycle.c
51@@ -80,7 +80,7 @@ int Py_VerboseFlag; /* Needed by import.
52 int Py_QuietFlag; /* Needed by sysmodule.c */
53 int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
54 int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
55-int Py_OptimizeFlag = 0; /* Needed by compile.c */
56+int Py_OptimizeFlag = 1; /* Needed by compile.c */
57 int Py_NoSiteFlag; /* Suppress 'import site' */
58 int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
59 int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
diff --git a/meta/recipes-devtools/python/python3/makerace.patch b/meta/recipes-devtools/python/python3/makerace.patch
deleted file mode 100644
index d8a68923a8..0000000000
--- a/meta/recipes-devtools/python/python3/makerace.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1There is a race due to the execution of make inside the makefile:
2
3| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
4| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Parser/pgen.o Parser/pgen.c| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
5| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
6| Objects/obmalloc.o: file not recognized: File truncated
7| collect2: error: ld returned 1 exit status
8| make[1]: *** [Parser/pgen] Error 1
9
10The easiest way to avoid this is to list the dependencies explictly.
11
12RP 28/2/2014
13
14Upstream-Status: Pending
15
16Index: Python-3.3.3/Makefile.pre.in
17===================================================================
18--- Python-3.3.3.orig/Makefile.pre.in 2014-02-27 14:04:38.268339533 +0000
19+++ Python-3.3.3/Makefile.pre.in 2014-02-28 10:40:59.166361125 +0000
20@@ -676,7 +676,7 @@
21
22 $(IO_OBJS): $(IO_H)
23
24-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
25+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
26 @$(MKDIR_P) Include
27 $(MAKE) $(PGEN)
28 $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
diff --git a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
index b3e986089e..44ec424cd2 100644
--- a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
+++ b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -7,23 +7,24 @@ get the sys.lib from python itself and do not use hardcoded value of 'lib'
7Signed-off-by: Khem Raj <raj.khem@gmail.com> 7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> 8Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
9 9
10Index: Python-3.4.2/Include/pythonrun.h 10Index: Python-3.5.0/Include/pythonrun.h
11=================================================================== 11===================================================================
12--- Python-3.4.2.orig/Include/pythonrun.h 12--- Python-3.5.0.orig/Include/pythonrun.h
13+++ Python-3.4.2/Include/pythonrun.h 13+++ Python-3.5.0/Include/pythonrun.h
14@@ -220,6 +220,8 @@ int _Py_CheckPython3(); 14@@ -23,6 +23,9 @@ typedef struct {
15 /* In their own files */ 15 } PyCompilerFlags;
16 PyAPI_FUNC(const char *) Py_GetVersion(void); 16 #endif
17 PyAPI_FUNC(const char *) Py_GetPlatform(void); 17
18+PyAPI_FUNC(const char *) Py_GetArch(void); 18+PyAPI_FUNC(const char *) Py_GetArch(void);
19+PyAPI_FUNC(const char *) Py_GetLib(void); 19+PyAPI_FUNC(const char *) Py_GetLib(void);
20 PyAPI_FUNC(const char *) Py_GetCopyright(void); 20+
21 PyAPI_FUNC(const char *) Py_GetCompiler(void); 21 #ifndef Py_LIMITED_API
22 PyAPI_FUNC(const char *) Py_GetBuildInfo(void); 22 PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
23Index: Python-3.4.2/Lib/distutils/command/install.py 23 PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
24Index: Python-3.5.0/Lib/distutils/command/install.py
24=================================================================== 25===================================================================
25--- Python-3.4.2.orig/Lib/distutils/command/install.py 26--- Python-3.5.0.orig/Lib/distutils/command/install.py
26+++ Python-3.4.2/Lib/distutils/command/install.py 27+++ Python-3.5.0/Lib/distutils/command/install.py
27@@ -19,6 +19,8 @@ from site import USER_BASE 28@@ -19,6 +19,8 @@ from site import USER_BASE
28 from site import USER_SITE 29 from site import USER_SITE
29 HAS_USER_SITE = True 30 HAS_USER_SITE = True
@@ -42,11 +43,11 @@ Index: Python-3.4.2/Lib/distutils/command/install.py
42 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', 43 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
43 'scripts': '$base/bin', 44 'scripts': '$base/bin',
44 'data' : '$base', 45 'data' : '$base',
45Index: Python-3.4.2/Lib/pydoc.py 46Index: Python-3.5.0/Lib/pydoc.py
46=================================================================== 47===================================================================
47--- Python-3.4.2.orig/Lib/pydoc.py 48--- Python-3.5.0.orig/Lib/pydoc.py
48+++ Python-3.4.2/Lib/pydoc.py 49+++ Python-3.5.0/Lib/pydoc.py
49@@ -394,7 +394,7 @@ class Doc: 50@@ -393,7 +393,7 @@ class Doc:
50 51
51 docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS) 52 docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)
52 53
@@ -55,11 +56,11 @@ Index: Python-3.4.2/Lib/pydoc.py
55 "python%d.%d" % sys.version_info[:2]) 56 "python%d.%d" % sys.version_info[:2])
56 if (isinstance(object, type(os)) and 57 if (isinstance(object, type(os)) and
57 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', 58 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
58Index: Python-3.4.2/Lib/trace.py 59Index: Python-3.5.0/Lib/trace.py
59=================================================================== 60===================================================================
60--- Python-3.4.2.orig/Lib/trace.py 61--- Python-3.5.0.orig/Lib/trace.py
61+++ Python-3.4.2/Lib/trace.py 62+++ Python-3.5.0/Lib/trace.py
62@@ -751,10 +751,10 @@ def main(argv=None): 63@@ -749,10 +749,10 @@ def main(argv=None):
63 # should I also call expanduser? (after all, could use $HOME) 64 # should I also call expanduser? (after all, could use $HOME)
64 65
65 s = s.replace("$prefix", 66 s = s.replace("$prefix",
@@ -72,10 +73,10 @@ Index: Python-3.4.2/Lib/trace.py
72 "python" + sys.version[:3])) 73 "python" + sys.version[:3]))
73 s = os.path.normpath(s) 74 s = os.path.normpath(s)
74 ignore_dirs.append(s) 75 ignore_dirs.append(s)
75Index: Python-3.4.2/Makefile.pre.in 76Index: Python-3.5.0/Makefile.pre.in
76=================================================================== 77===================================================================
77--- Python-3.4.2.orig/Makefile.pre.in 78--- Python-3.5.0.orig/Makefile.pre.in
78+++ Python-3.4.2/Makefile.pre.in 79+++ Python-3.5.0/Makefile.pre.in
79@@ -101,6 +101,8 @@ PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS 80@@ -101,6 +101,8 @@ PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS
80 81
81 # Machine-dependent subdirectories 82 # Machine-dependent subdirectories
@@ -94,15 +95,15 @@ Index: Python-3.4.2/Makefile.pre.in
94 ABIFLAGS= @ABIFLAGS@ 95 ABIFLAGS= @ABIFLAGS@
95 96
96 # Detailed destination directories 97 # Detailed destination directories
97@@ -712,6 +714,7 @@ Modules/getpath.o: $(srcdir)/Modules/get 98@@ -729,6 +731,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
98 -DEXEC_PREFIX='"$(exec_prefix)"' \ 99 -DEXEC_PREFIX='"$(exec_prefix)"' \
99 -DVERSION='"$(VERSION)"' \ 100 -DVERSION='"$(VERSION)"' \
100 -DVPATH='"$(VPATH)"' \ 101 -DVPATH='"$(VPATH)"' \
101+ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \ 102+ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
102 -o $@ $(srcdir)/Modules/getpath.c 103 -o $@ $(srcdir)/Modules/getpath.c
103 104
104 Modules/python.o: $(srcdir)/Modules/python.c 105 Programs/python.o: $(srcdir)/Programs/python.c
105@@ -780,7 +783,7 @@ $(AST_C): $(AST_H) $(AST_ASDL) $(ASDLGEN 106@@ -798,7 +801,7 @@ $(OPCODE_H): $(srcdir)/Lib/opcode.py $(O
106 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) 107 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
107 108
108 Python/getplatform.o: $(srcdir)/Python/getplatform.c 109 Python/getplatform.o: $(srcdir)/Python/getplatform.c
@@ -111,10 +112,10 @@ Index: Python-3.4.2/Makefile.pre.in
111 112
112 Python/importdl.o: $(srcdir)/Python/importdl.c 113 Python/importdl.o: $(srcdir)/Python/importdl.c
113 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c 114 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
114Index: Python-3.4.2/Modules/getpath.c 115Index: Python-3.5.0/Modules/getpath.c
115=================================================================== 116===================================================================
116--- Python-3.4.2.orig/Modules/getpath.c 117--- Python-3.5.0.orig/Modules/getpath.c
117+++ Python-3.4.2/Modules/getpath.c 118+++ Python-3.5.0/Modules/getpath.c
118@@ -117,9 +117,11 @@ 119@@ -117,9 +117,11 @@
119 #define EXEC_PREFIX PREFIX 120 #define EXEC_PREFIX PREFIX
120 #endif 121 #endif
@@ -135,12 +136,12 @@ Index: Python-3.4.2/Modules/getpath.c
135 static wchar_t *module_search_path = NULL; 136 static wchar_t *module_search_path = NULL;
136+static wchar_t *lib_python = L"" LIB_PYTHON; 137+static wchar_t *lib_python = L"" LIB_PYTHON;
137 138
138 static void 139 /* Get file status. Encode the path to the locale encoding. */
139 reduce(wchar_t *dir) 140
140Index: Python-3.4.2/Python/getplatform.c 141Index: Python-3.5.0/Python/getplatform.c
141=================================================================== 142===================================================================
142--- Python-3.4.2.orig/Python/getplatform.c 143--- Python-3.5.0.orig/Python/getplatform.c
143+++ Python-3.4.2/Python/getplatform.c 144+++ Python-3.5.0/Python/getplatform.c
144@@ -10,3 +10,23 @@ Py_GetPlatform(void) 145@@ -10,3 +10,23 @@ Py_GetPlatform(void)
145 { 146 {
146 return PLATFORM; 147 return PLATFORM;
@@ -165,11 +166,11 @@ Index: Python-3.4.2/Python/getplatform.c
165+{ 166+{
166+ return LIB; 167+ return LIB;
167+} 168+}
168Index: Python-3.4.2/Python/sysmodule.c 169Index: Python-3.5.0/Python/sysmodule.c
169=================================================================== 170===================================================================
170--- Python-3.4.2.orig/Python/sysmodule.c 171--- Python-3.5.0.orig/Python/sysmodule.c
171+++ Python-3.4.2/Python/sysmodule.c 172+++ Python-3.5.0/Python/sysmodule.c
172@@ -1697,6 +1697,10 @@ _PySys_Init(void) 173@@ -1767,6 +1767,10 @@ _PySys_Init(void)
173 PyUnicode_FromString(Py_GetCopyright())); 174 PyUnicode_FromString(Py_GetCopyright()));
174 SET_SYS_FROM_STRING("platform", 175 SET_SYS_FROM_STRING("platform",
175 PyUnicode_FromString(Py_GetPlatform())); 176 PyUnicode_FromString(Py_GetPlatform()));
@@ -180,11 +181,11 @@ Index: Python-3.4.2/Python/sysmodule.c
180 SET_SYS_FROM_STRING("executable", 181 SET_SYS_FROM_STRING("executable",
181 PyUnicode_FromWideChar( 182 PyUnicode_FromWideChar(
182 Py_GetProgramFullPath(), -1)); 183 Py_GetProgramFullPath(), -1));
183Index: Python-3.4.2/setup.py 184Index: Python-3.5.0/setup.py
184=================================================================== 185===================================================================
185--- Python-3.4.2.orig/setup.py 186--- Python-3.5.0.orig/setup.py
186+++ Python-3.4.2/setup.py 187+++ Python-3.5.0/setup.py
187@@ -454,7 +454,7 @@ class PyBuildExt(build_ext): 188@@ -472,7 +472,7 @@ class PyBuildExt(build_ext):
188 # directories (i.e. '.' and 'Include') must be first. See issue 189 # directories (i.e. '.' and 'Include') must be first. See issue
189 # 10520. 190 # 10520.
190 if not cross_compiling: 191 if not cross_compiling:
@@ -193,7 +194,7 @@ Index: Python-3.4.2/setup.py
193 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 194 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
194 # only change this for cross builds for 3.3, issues on Mageia 195 # only change this for cross builds for 3.3, issues on Mageia
195 if cross_compiling: 196 if cross_compiling:
196@@ -512,8 +512,7 @@ class PyBuildExt(build_ext): 197@@ -530,8 +530,7 @@ class PyBuildExt(build_ext):
197 # be assumed that no additional -I,-L directives are needed. 198 # be assumed that no additional -I,-L directives are needed.
198 if not cross_compiling: 199 if not cross_compiling:
199 lib_dirs = self.compiler.library_dirs + [ 200 lib_dirs = self.compiler.library_dirs + [
@@ -203,7 +204,7 @@ Index: Python-3.4.2/setup.py
203 ] 204 ]
204 inc_dirs = self.compiler.include_dirs + ['/usr/include'] 205 inc_dirs = self.compiler.include_dirs + ['/usr/include']
205 else: 206 else:
206@@ -696,11 +695,11 @@ class PyBuildExt(build_ext): 207@@ -716,11 +715,11 @@ class PyBuildExt(build_ext):
207 elif curses_library: 208 elif curses_library:
208 readline_libs.append(curses_library) 209 readline_libs.append(curses_library)
209 elif self.compiler.find_library_file(lib_dirs + 210 elif self.compiler.find_library_file(lib_dirs +
@@ -217,10 +218,10 @@ Index: Python-3.4.2/setup.py
217 extra_link_args=readline_extra_link_args, 218 extra_link_args=readline_extra_link_args,
218 libraries=readline_libs) ) 219 libraries=readline_libs) )
219 else: 220 else:
220Index: Python-3.4.2/Lib/sysconfig.py 221Index: Python-3.5.0/Lib/sysconfig.py
221=================================================================== 222===================================================================
222--- Python-3.4.2.orig/Lib/sysconfig.py 223--- Python-3.5.0.orig/Lib/sysconfig.py
223+++ Python-3.4.2/Lib/sysconfig.py 224+++ Python-3.5.0/Lib/sysconfig.py
224@@ -20,10 +20,10 @@ __all__ = [ 225@@ -20,10 +20,10 @@ __all__ = [
225 226
226 _INSTALL_SCHEMES = { 227 _INSTALL_SCHEMES = {
@@ -263,13 +264,13 @@ Index: Python-3.4.2/Lib/sysconfig.py
263 'include': '{userbase}/include/python{py_version_short}', 264 'include': '{userbase}/include/python{py_version_short}',
264 'scripts': '{userbase}/bin', 265 'scripts': '{userbase}/bin',
265 'data': '{userbase}', 266 'data': '{userbase}',
266Index: Python-3.4.2/configure.ac 267Index: Python-3.5.0/configure.ac
267=================================================================== 268===================================================================
268--- Python-3.4.2.orig/configure.ac 269--- Python-3.5.0.orig/configure.ac
269+++ Python-3.4.2/configure.ac 270+++ Python-3.5.0/configure.ac
270@@ -791,6 +791,41 @@ esac 271@@ -858,6 +858,41 @@ PLATDIR=plat-$MACHDEP
271 MULTIARCH=$($CC --print-multiarch 2>/dev/null) 272 AC_SUBST(PLATDIR)
272 AC_SUBST(MULTIARCH) 273 AC_SUBST(PLATFORM_TRIPLET)
273 274
274+AC_SUBST(ARCH) 275+AC_SUBST(ARCH)
275+AC_MSG_CHECKING(ARCH) 276+AC_MSG_CHECKING(ARCH)
@@ -307,32 +308,5 @@ Index: Python-3.4.2/configure.ac
307+esac 308+esac
308+AC_MSG_RESULT($LIB) 309+AC_MSG_RESULT($LIB)
309 310
310 AC_SUBST(LIBRARY) 311 AC_MSG_CHECKING([for -Wl,--no-as-needed])
311 AC_MSG_CHECKING(LIBRARY) 312 save_LDFLAGS="$LDFLAGS"
312Index: Python-3.4.2/Lib/site.py
313===================================================================
314--- Python-3.4.2.orig/Lib/site.py
315+++ Python-3.4.2/Lib/site.py
316@@ -304,13 +304,19 @@ def getsitepackages(prefixes=None):
317 seen.add(prefix)
318
319 if os.sep == '/':
320- sitepackages.append(os.path.join(prefix, "lib",
321+ sitepackages.append(os.path.join(prefix, sys.lib,
322 "python" + sys.version[:3],
323 "site-packages"))
324- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
325+ if sys.lib != "lib":
326+ sitepackages.append(os.path.join(prefix, "lib",
327+ "python" + sys.version[:3],
328+ "site-packages"))
329+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
330+ if sys.lib != "lib":
331+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
332 else:
333 sitepackages.append(prefix)
334- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
335+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
336 if sys.platform == "darwin":
337 # for framework builds *only* we add the standard Apple
338 # locations.
diff --git a/meta/recipes-devtools/python/python3/use_packed_importlib.patch b/meta/recipes-devtools/python/python3/use_packed_importlib.patch
new file mode 100644
index 0000000000..6c4b0cda9e
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/use_packed_importlib.patch
@@ -0,0 +1,31 @@
1
2Upstream-Status: Inappropriate [embedded specific]
3
4The binary _freeze_importlib is built and also used during build time to generate
5importlib*.h files, this is impossible to do on a cross-compile environment,
6this avoids executing the binary and forces it to use the packed importlib*.h files.
7
8
9Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
10
11Index: Python-3.5.0/Makefile.pre.in
12===================================================================
13--- Python-3.5.0.orig/Makefile.pre.in
14+++ Python-3.5.0/Makefile.pre.in
15@@ -700,12 +700,12 @@ Programs/_freeze_importlib.o: Programs/_
16 Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
17 $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
18
19-Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
20- ./Programs/_freeze_importlib \
21+#Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
22+# ./Programs/_freeze_importlib \
23 $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h
24
25-Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
26- ./Programs/_freeze_importlib \
27+#Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
28+# ./Programs/_freeze_importlib \
29 $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
30
31