summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-04-09 12:27:17 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-13 22:23:49 +0100
commitf82b7bf988d912c7c413790c28e03b2b9f7a51cc (patch)
tree9ca28aed8e0f12149b6a66bbd4c2a196a321c870
parent9f02a6ccc4b9353906f3b0643472df4d7e69a9b8 (diff)
downloadpoky-f82b7bf988d912c7c413790c28e03b2b9f7a51cc.tar.gz
python3: Do not detect multiarch when cross compiling
This was a long standing problem seen on aarch64 build hosts when compiling python3 with clang cross compiler. The issue is not seen with gcc because native glibc headers are still compatible with gcc cross compiler (From OE-Core rev: 407744b00d702e3133304e1b43064a5634ca02cf) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Ross Burton <ross.burton@arm.com> Cc: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/python/python3/0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch42
-rw-r--r--meta/recipes-devtools/python/python3_3.10.4.bb1
2 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch b/meta/recipes-devtools/python/python3/0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch
new file mode 100644
index 0000000000..1844e0efa3
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch
@@ -0,0 +1,42 @@
1From dc966f1278c1077938626d682666767d2c8d0c72 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 9 Apr 2022 18:29:47 +0000
4Subject: [PATCH] setup.py: Do not detect multiarch paths when cross-compiling
5
6add_multiarch_paths() function relies on host tools like dpkg-configure
7to operate, which is not good when cross compiling, since it ends up
8adding native paths in includes in certain cases, e.g. when building
9for aarch64 targets using aarch64 build hosts running debian-like
10distributions e.g. ubuntu, it ends up adding native multiarch paths
11-I/usr/include/aarch64-linux-gnu during cross compile and since arches
12are so similar, cross compiler (epecially clang) is inhererently configured
13with multiarch ends up adding these paths to compiler cmdline which
14works ok with gcc since headers are similar but clang barfs on some gcc
15extentions and build fails due to missing gnu extentions but it silently
16compiles when using cross gcc.
17
18Fixes python3 cross build by not running this funciton when cross compiling
19
20Upstream-Status: Inappropriate [OE-Specific]
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23 setup.py | 3 ++-
24 1 file changed, 2 insertions(+), 1 deletion(-)
25
26diff --git a/setup.py b/setup.py
27index 2e7f263..f7a3d39 100644
28--- a/setup.py
29+++ b/setup.py
30@@ -840,7 +840,8 @@ class PyBuildExt(build_ext):
31 # only change this for cross builds for 3.3, issues on Mageia
32 if CROSS_COMPILING:
33 self.add_cross_compiling_paths()
34- self.add_multiarch_paths()
35+ if not CROSS_COMPILING:
36+ self.add_multiarch_paths()
37 self.add_ldflags_cppflags()
38
39 def init_inc_lib_dirs(self):
40--
412.25.1
42
diff --git a/meta/recipes-devtools/python/python3_3.10.4.bb b/meta/recipes-devtools/python/python3_3.10.4.bb
index 522f0d71ee..7eaafe34ad 100644
--- a/meta/recipes-devtools/python/python3_3.10.4.bb
+++ b/meta/recipes-devtools/python/python3_3.10.4.bb
@@ -32,6 +32,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
32 file://makerace.patch \ 32 file://makerace.patch \
33 file://0001-sysconfig.py-use-platlibdir-also-for-purelib.patch \ 33 file://0001-sysconfig.py-use-platlibdir-also-for-purelib.patch \
34 file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \ 34 file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \
35 file://0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch \
35 " 36 "
36 37
37SRC_URI:append:class-native = " \ 38SRC_URI:append:class-native = " \