From a04c64c7889adc842731a50341cb9674fff0eff4 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 25 Nov 2021 10:57:22 +0100 Subject: [PATCH 1/3] bpo-40280: Add wasm cross build targets CPython uses the same target triplet convention as Rust: ``` $ rustc --print target-list | grep wasm wasm32-unknown-emscripten wasm32-unknown-unknown wasm32-wasi wasm64-unknown-unknown ``` Signed-off-by: Christian Heimes --- .../2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst | 3 +++ configure | 16 ++++++++++++---- configure.ac | 10 ++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst diff --git a/Misc/NEWS.d/next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst b/Misc/NEWS.d/next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst new file mode 100644 index 00000000000000..211049591067e4 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst @@ -0,0 +1,3 @@ +``configure`` now accepts machine ``wasm32`` or ``wasm64`` and OS ``wasi`` +or ``emscripten`` for cross building, e.g. ``wasm32-unknown-emscripten`` +and ``wasm32-wasi``. diff --git a/configure b/configure index abfda2b00de745..d4dd8e5a3cc58f 100755 --- a/configure +++ b/configure @@ -3717,6 +3717,12 @@ then *-*-vxworks*) ac_sys_system=VxWorks ;; + *-*-emscripten) + ac_sys_system=Emscripten + ;; + *-*-wasi) + ac_sys_system=wasi + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -3767,6 +3773,9 @@ if test "$cross_compiling" = yes; then *-*-vxworks*) _host_cpu=$host_cpu ;; + wasm32-*-* | wasm64-*-*) + _host_cpu=$host_cpu + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -10382,6 +10391,9 @@ fi # Dynamic linking for HP-UX + + + have_uuid=missing for ac_header in uuid.h @@ -10414,10 +10426,6 @@ fi done - - - - if test "x$have_uuid" = xmissing; then : diff --git a/configure.ac b/configure.ac index 1853baa5a8e8c2..51f1525c386057 100644 --- a/configure.ac +++ b/configure.ac @@ -465,6 +465,13 @@ then *-*-vxworks*) ac_sys_system=VxWorks ;; + *-*-emscripten) + ac_sys_system=Emscripten + ;; + *-*-wasi) + dnl wasm32-wasi, wasm32-unknown-wasi + ac_sys_system=wasi + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -514,6 +521,9 @@ if test "$cross_compiling" = yes; then *-*-vxworks*) _host_cpu=$host_cpu ;; + wasm32-*-* | wasm64-*-*) + _host_cpu=$host_cpu + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" From 05cb9f21422be62cc89c4c94c734fe86d4b58b1b Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 25 Nov 2021 17:32:02 +0100 Subject: [PATCH 2/3] Upper case WASI --- configure | 2 +- configure.ac | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index d4dd8e5a3cc58f..944e97ccf99293 100755 --- a/configure +++ b/configure @@ -3721,7 +3721,7 @@ then ac_sys_system=Emscripten ;; *-*-wasi) - ac_sys_system=wasi + ac_sys_system=WASI ;; *) # for now, limit cross builds to known configurations diff --git a/configure.ac b/configure.ac index 51f1525c386057..2140e3e43db823 100644 --- a/configure.ac +++ b/configure.ac @@ -469,8 +469,7 @@ then ac_sys_system=Emscripten ;; *-*-wasi) - dnl wasm32-wasi, wasm32-unknown-wasi - ac_sys_system=wasi + ac_sys_system=WASI ;; *) # for now, limit cross builds to known configurations From d4fba931f096f336fb3300fe12ffe28dd8cfadcf Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 25 Nov 2021 20:47:47 +0100 Subject: [PATCH 3/3] Include wasm32-unknown-wasi triple --- .../next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst b/Misc/NEWS.d/next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst index 211049591067e4..04579b4ecb71c8 100644 --- a/Misc/NEWS.d/next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst +++ b/Misc/NEWS.d/next/Build/2021-11-25-10-55-03.bpo-40280.E9-gsQ.rst @@ -1,3 +1,3 @@ ``configure`` now accepts machine ``wasm32`` or ``wasm64`` and OS ``wasi`` -or ``emscripten`` for cross building, e.g. ``wasm32-unknown-emscripten`` -and ``wasm32-wasi``. +or ``emscripten`` for cross building, e.g. ``wasm32-unknown-emscripten``, +``wasm32-wasi``, or ``wasm32-unknown-wasi``.