Skip to content

Commit e7d5dfb

Browse files
committed
hostpic, o2g3
1 parent 775ad39 commit e7d5dfb

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
gosdk: false
2727
rustsdk: false
2828
nimsdk: false
29-
COPTS: -Os -g0
29+
COPTS: -Os -g3
3030

3131
steps:
3232
- uses: actions/checkout@v3.3.0

scripts/cpython-build-host.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ then
5454
unset CPPFLAGS
5555
unset LDFLAGS
5656

57-
#export OPT="$CPOPTS -DNDEBUG -fwrapv"
5857
mkdir -p $ROOT/src/cpython${PYBUILD}/Tools/wasm
5958
cat > $ROOT/src/cpython${PYBUILD}/Tools/wasm/config.host-wasm32-emscripten <<END
6059
ac_cv_lib_intl_textdomain=no
@@ -101,27 +100,27 @@ END
101100
fi
102101
fi
103102

104-
# CFLAGS="-fPIC" CPPFLAGS="-fPIC"
105-
CNF="${ROOT}/src/cpython${PYBUILD}/configure \
103+
CNF="${ROOT}/src/cpython${PYBUILD}/configure \
106104
--prefix=$HOST_PREFIX $PYOPTS $GIL"
107-
if CC=clang CXX=clang++ $CNF
105+
if CC="clang" CXX="clang++" CCSHARED="-fPIC" $CNF
108106
then
107+
109108
if make -j$(nproc)
110109
then
111110
if make install
112111
then
113112
echo "CPython $PYTHON_FOR_BUILD ready" 1>&2
114113
else
115114
echo "CPython $PYTHON_FOR_BUILD failed to install" 1>&2
116-
exit 117
115+
exit 114
117116
fi
118117
else
119118
echo "
120119
failed to build $PYTHON_FOR_BUILD
121120
122121
CC=clang CXX=clang++ $CNF
123122
" 1>&2
124-
exit 125
123+
exit 122
125124
fi
126125
else
127126
echo "
@@ -134,7 +133,7 @@ CC=clang CXX=clang++ $CNF
134133
135134
==========================================================================
136135
" 1>&2
137-
exit 149
136+
exit 135
138137
fi
139138

140139
popd

scripts/cpython-fetch.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ echo "
88

99
mkdir -p src
1010

11-
pushd src 2>&1 >/dev/null
11+
pushd src
1212

1313
NOPATCH=false
1414
PYPATCH=true
@@ -22,7 +22,7 @@ if echo $PYBUILD |grep -q 15$
2222
then
2323
if [ -d cpython${PYBUILD} ]
2424
then
25-
pushd cpython${PYBUILD} 2>&1 >/dev/null
25+
pushd cpython${PYBUILD}
2626
# put the tree back to original state so we can pull
2727
# Programs/python.c Modules/readline.c
2828
git restore .
@@ -133,9 +133,9 @@ popd
133133
# 3.10 is not wasm stable
134134
if [ -f support/__EMSCRIPTEN__.patches/${PYBUILD}-host.diff ]
135135
then
136-
pushd src/cpython${PYBUILD} 2>&1 >/dev/null
136+
pushd src/cpython${PYBUILD}
137137
patch -p1 < ../../support/__EMSCRIPTEN__.patches/${PYBUILD}-host.diff
138-
popd 2>&1 >/dev/null
138+
popd
139139
fi
140140

141141

@@ -147,10 +147,15 @@ if $NOPATCH
147147
then
148148
echo "finally there"
149149
else
150-
# do some patching for 3.11+ to allow more shared libs
151-
pushd src/cpython${PYBUILD} 2>&1 >/dev/null
150+
pushd src/cpython${PYBUILD}
151+
152+
# do some patching for 3.11+ to allow shared libs and move js to pymain
152153
patch -p1 < ../../support/__EMSCRIPTEN__.embed/cpython${PYBUILD}.diff
153-
popd 2>&1 >/dev/null
154+
155+
# patch host to be PIC
156+
patch -p1 < ../../support/hostpic.diff
157+
158+
popd
154159
fi
155160

156161
echo "

0 commit comments

Comments
 (0)