diff options
author | Ross Burton <ross.burton@intel.com> | 2020-01-17 14:16:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-19 13:24:38 +0000 |
commit | 2ed5d927ca9b88d3964ada990ef46cdd38ec4b1e (patch) | |
tree | 2110d3e9381867553c69ae5c743887e1caa97926 /meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch | |
parent | 2b5cf2a067cb6d9ca32d851dacdc1aff0cbfe904 (diff) | |
download | poky-2ed5d927ca9b88d3964ada990ef46cdd38ec4b1e.tar.gz |
python: remove Python 2 and all supporting classes
Python 2 ceased being maintained on the 1st January 2020. We've already
removed all users of it from oe-core so the final step is to move the
recipe and supporting classes to meta-python2.
The following are removed in this commit:
- python and python-native 2.7.17
- python-setuptools
- The classes pythonnative, pythondir, distutils, setuptools
(From OE-Core rev: 390f3edabfb1f68ed9766245291c5f44ea00cc38)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch')
-rw-r--r-- | meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch deleted file mode 100644 index e6d6c65bbe..0000000000 --- a/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | Author: Andrei Gherzan <andrei@gherzan.ro> | ||
2 | Date: Sun Mar 25 02:02:27 2012 +0200 | ||
3 | |||
4 | This patch was added for 64bit host machines. In the compile process python | ||
5 | is checking if platform is a 64bit platform using sys.maxint which is the host's | ||
6 | value. The patch fixes this issue so that python would check if TARGET machine | ||
7 | is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules | ||
8 | built if HOST machine is 64bit but the target machine is 32bit. | ||
9 | |||
10 | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Index: Python-2.7.11/setup.py | ||
15 | =================================================================== | ||
16 | --- Python-2.7.11.orig/setup.py | ||
17 | +++ Python-2.7.11/setup.py | ||
18 | @@ -35,6 +35,21 @@ COMPILED_WITH_PYDEBUG = ('--with-pydebug | ||
19 | # This global variable is used to hold the list of modules to be disabled. | ||
20 | disabled_module_list = [] | ||
21 | |||
22 | +def target_is_64bit_platform (): | ||
23 | + """ | ||
24 | + In case of cross-compile, some modules are not build as setup checks if HOST | ||
25 | + is 64bit and not TARGET. | ||
26 | + As python was built for TARGET we can check this in pyconfig.h in this way: | ||
27 | + Sizeof LONG on a 32 bit platform is 4 bytes | ||
28 | + Sizeof LONG on a 64 bit platform is 8 bytes | ||
29 | + """ | ||
30 | + pyconf = open("pyconfig.h").read() | ||
31 | + aux = re.search(r"#s*define\s+SIZEOF_LONG\s+8\s*", pyconf) | ||
32 | + if aux is not None: | ||
33 | + return True | ||
34 | + else: | ||
35 | + return False | ||
36 | + | ||
37 | def add_dir_to_list(dirlist, dir): | ||
38 | """Add the directory 'dir' to the list 'dirlist' (at the front) if | ||
39 | 1) 'dir' is not already in 'dirlist' | ||
40 | @@ -716,7 +731,7 @@ class PyBuildExt(build_ext): | ||
41 | exts.append( Extension('audioop', ['audioop.c']) ) | ||
42 | |||
43 | # Disabled on 64-bit platforms | ||
44 | - if sys.maxsize != 9223372036854775807L: | ||
45 | + if not target_is_64bit_platform(): | ||
46 | # Operations on images | ||
47 | exts.append( Extension('imageop', ['imageop.c']) ) | ||
48 | else: | ||
49 | @@ -1545,7 +1560,7 @@ class PyBuildExt(build_ext): | ||
50 | missing.append('_codecs_%s' % loc) | ||
51 | |||
52 | # Dynamic loading module | ||
53 | - if sys.maxint == 0x7fffffff: | ||
54 | + if not target_is_64bit_platform(): | ||
55 | # This requires sizeof(int) == sizeof(long) == sizeof(char*) | ||
56 | dl_inc = find_file('dlfcn.h', [], inc_dirs) | ||
57 | if (dl_inc is not None) and (host_platform not in ['atheos']): | ||