From e7d5dfb601b090f376c9bbafcffe590a46e55781 Mon Sep 17 00:00:00 2001 From: pmp-p Date: Tue, 3 Dec 2024 08:46:54 +0100 Subject: [PATCH] hostpic, o2g3 --- .github/workflows/ci.yml | 2 +- scripts/cpython-build-host.sh | 13 ++++++------- scripts/cpython-fetch.sh | 19 ++++++++++++------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d460890..88b713a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: gosdk: false rustsdk: false nimsdk: false - COPTS: -Os -g0 + COPTS: -Os -g3 steps: - uses: actions/checkout@v3.3.0 diff --git a/scripts/cpython-build-host.sh b/scripts/cpython-build-host.sh index c6c60bb..6712365 100755 --- a/scripts/cpython-build-host.sh +++ b/scripts/cpython-build-host.sh @@ -54,7 +54,6 @@ then unset CPPFLAGS unset LDFLAGS -#export OPT="$CPOPTS -DNDEBUG -fwrapv" mkdir -p $ROOT/src/cpython${PYBUILD}/Tools/wasm cat > $ROOT/src/cpython${PYBUILD}/Tools/wasm/config.host-wasm32-emscripten <&2 else echo "CPython $PYTHON_FOR_BUILD failed to install" 1>&2 - exit 117 + exit 114 fi else echo " @@ -121,7 +120,7 @@ failed to build $PYTHON_FOR_BUILD CC=clang CXX=clang++ $CNF " 1>&2 - exit 125 + exit 122 fi else echo " @@ -134,7 +133,7 @@ CC=clang CXX=clang++ $CNF ========================================================================== " 1>&2 - exit 149 + exit 135 fi popd diff --git a/scripts/cpython-fetch.sh b/scripts/cpython-fetch.sh index 276da7d..9ed047e 100755 --- a/scripts/cpython-fetch.sh +++ b/scripts/cpython-fetch.sh @@ -8,7 +8,7 @@ echo " mkdir -p src -pushd src 2>&1 >/dev/null +pushd src NOPATCH=false PYPATCH=true @@ -22,7 +22,7 @@ if echo $PYBUILD |grep -q 15$ then if [ -d cpython${PYBUILD} ] then - pushd cpython${PYBUILD} 2>&1 >/dev/null + pushd cpython${PYBUILD} # put the tree back to original state so we can pull # Programs/python.c Modules/readline.c git restore . @@ -133,9 +133,9 @@ popd # 3.10 is not wasm stable if [ -f support/__EMSCRIPTEN__.patches/${PYBUILD}-host.diff ] then - pushd src/cpython${PYBUILD} 2>&1 >/dev/null + pushd src/cpython${PYBUILD} patch -p1 < ../../support/__EMSCRIPTEN__.patches/${PYBUILD}-host.diff - popd 2>&1 >/dev/null + popd fi @@ -147,10 +147,15 @@ if $NOPATCH then echo "finally there" else - # do some patching for 3.11+ to allow more shared libs - pushd src/cpython${PYBUILD} 2>&1 >/dev/null + pushd src/cpython${PYBUILD} + + # do some patching for 3.11+ to allow shared libs and move js to pymain patch -p1 < ../../support/__EMSCRIPTEN__.embed/cpython${PYBUILD}.diff - popd 2>&1 >/dev/null + + # patch host to be PIC + patch -p1 < ../../support/hostpic.diff + + popd fi echo "