mcst-linux-kernel/patches-2024.06.26/python-stdlib-extensions-2..../0001-Skip-import-check-when...

38 lines
1.2 KiB
Diff

From 14a7b91b60eb3ced3a638de1c1e609347d08b72c Mon Sep 17 00:00:00 2001
Date: Thu, 27 Sep 2018 21:17:53 +0300
Subject: [PATCH] Skip 'import check' when cross-compiling
Skip checking if CROSS_COMPILE is set in evnironment
openembedded patch
https://patchwork.openembedded.org/patch/14437/
TODO: setup.py does not set cross_compiling. I dont know why.
---
setup.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/setup.py b/setup.py
index 33cecc6..48423f6 100644
--- a/setup.py
+++ b/setup.py
@@ -310,6 +310,15 @@ class PyBuildExt(build_ext):
(ext.name, sys.exc_info()[1]))
self.failed.append(ext.name)
return
+
+ # If we're cross-compiling, we want to skip the import check
+ # i.e. we shouldn't be dynamically loading target shared libs
+ if os.environ.get('CROSS_COMPILE') is not None:
+ self.announce(
+ 'WARNING: skipping import check for cross-compiled "%s"' %
+ ext.name)
+ return
+
# Workaround for Mac OS X: The Carbon-based modules cannot be
# reliably imported into a command-line Python
if 'Carbon' in ext.extra_link_args:
--
2.16.4