-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cross compilation for Python (#24)
- Loading branch information
Showing
21 changed files
with
1,050 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
cross-ubuntu-py/0001-Use-specified-host_cpu-when-cross-compiling-for-Linu.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
From 1325a6365032f2c7dea4f823003f46305724a6a6 Mon Sep 17 00:00:00 2001 | ||
From: Dustin Spicuzza <[email protected]> | ||
Date: Sat, 1 Jan 2022 22:44:03 -0500 | ||
Subject: [PATCH] Use specified $host_cpu when cross compiling for Linux | ||
|
||
Previously arm processors were hardcoded to "arm", which doesn't match | ||
the output of uname -m (used for native compilation) | ||
--- | ||
configure | 8 +------- | ||
configure.ac | 8 +------- | ||
2 files changed, 2 insertions(+), 14 deletions(-) | ||
|
||
diff --git a/configure b/configure | ||
index 2e7e0b7e0a..d91928fb79 100755 | ||
--- a/configure | ||
+++ b/configure | ||
@@ -3383,13 +3383,7 @@ $as_echo "\"$MACHDEP\"" >&6; } | ||
if test "$cross_compiling" = yes; then | ||
case "$host" in | ||
*-*-linux*) | ||
- case "$host_cpu" in | ||
- arm*) | ||
- _host_cpu=arm | ||
- ;; | ||
- *) | ||
- _host_cpu=$host_cpu | ||
- esac | ||
+ _host_cpu=$host_cpu | ||
;; | ||
*-*-cygwin*) | ||
_host_cpu= | ||
diff --git a/configure.ac b/configure.ac | ||
index 0c06914147..897c3a00ef 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -438,13 +438,7 @@ AC_SUBST(_PYTHON_HOST_PLATFORM) | ||
if test "$cross_compiling" = yes; then | ||
case "$host" in | ||
*-*-linux*) | ||
- case "$host_cpu" in | ||
- arm*) | ||
- _host_cpu=arm | ||
- ;; | ||
- *) | ||
- _host_cpu=$host_cpu | ||
- esac | ||
+ _host_cpu=$host_cpu | ||
;; | ||
*-*-cygwin*) | ||
_host_cpu= | ||
-- | ||
2.31.1 | ||
|
85 changes: 85 additions & 0 deletions
85
cross-ubuntu-py/0001-bpo-41916-allow-cross-compiled-python-to-have-pthrea.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
From 0bca228707c3f69cb8e6b4bc59b2ecf54f1f7c76 Mon Sep 17 00:00:00 2001 | ||
From: Dustin Spicuzza <[email protected]> | ||
Date: Sat, 3 Oct 2020 12:31:44 -0400 | ||
Subject: [PATCH] bpo-41916: allow cross-compiled python to have -pthread set | ||
for CXX | ||
|
||
When cross-compiling, the compile/run test for -pthread always fails so -pthread | ||
will never be automatically set without an override from the cache. ac_cv_pthread | ||
can already be overridden, so do the same thing for ac_cv_cxx_thread. | ||
--- | ||
configure | 12 +++++++++--- | ||
configure.ac | 8 +++++--- | ||
2 files changed, 14 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/configure b/configure | ||
index 0914e24704..119d720500 100755 | ||
--- a/configure | ||
+++ b/configure | ||
@@ -7710,12 +7710,14 @@ fi | ||
|
||
# If we have set a CC compiler flag for thread support then | ||
# check if it works for CXX, too. | ||
-ac_cv_cxx_thread=no | ||
if test ! -z "$CXX" | ||
then | ||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX also accepts flags for thread support" >&5 | ||
$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } | ||
-ac_save_cxx="$CXX" | ||
+if ${ac_cv_cxx_thread+:} false; then : | ||
+ $as_echo_n "(cached) " >&6 | ||
+else | ||
+ ac_save_cxx="$CXX" | ||
|
||
if test "$ac_cv_kpthread" = "yes" | ||
then | ||
@@ -7744,10 +7746,14 @@ then | ||
fi | ||
rm -fr conftest* | ||
fi | ||
+CXX="$ac_save_cxx" | ||
+fi | ||
+ | ||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_thread" >&5 | ||
$as_echo "$ac_cv_cxx_thread" >&6; } | ||
+else | ||
+ ac_cv_cxx_thread=no | ||
fi | ||
-CXX="$ac_save_cxx" | ||
|
||
|
||
# checks for header files | ||
diff --git a/configure.ac b/configure.ac | ||
index 7051dc109a..6259c0290c 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -2080,11 +2080,11 @@ fi | ||
|
||
# If we have set a CC compiler flag for thread support then | ||
# check if it works for CXX, too. | ||
-ac_cv_cxx_thread=no | ||
if test ! -z "$CXX" | ||
then | ||
AC_MSG_CHECKING(whether $CXX also accepts flags for thread support) | ||
-ac_save_cxx="$CXX" | ||
+AC_CACHE_VAL(ac_cv_cxx_thread, | ||
+[ac_save_cxx="$CXX" | ||
|
||
if test "$ac_cv_kpthread" = "yes" | ||
then | ||
@@ -2113,9 +2113,11 @@ then | ||
fi | ||
rm -fr conftest* | ||
fi | ||
+CXX="$ac_save_cxx"]) | ||
AC_MSG_RESULT($ac_cv_cxx_thread) | ||
+else | ||
+ ac_cv_cxx_thread=no | ||
fi | ||
-CXX="$ac_save_cxx" | ||
|
||
dnl # check for ANSI or K&R ("traditional") preprocessor | ||
dnl AC_MSG_CHECKING(for C preprocessor type) | ||
-- | ||
2.26.2 | ||
|
Oops, something went wrong.