@@ -48,7 +48,7 @@ RUN apt-get update && \
48
48
49
49
# matches our production except -march=haswell, we have to downgrade -march because of GHA
50
50
ENV OPT="-pipe -fno-semantic-interposition -march=haswell -mabm -maes -mno-pku -mno-sgx --param l1-cache-line-size=64 --param l1-cache-size=32 --param l2-cache-size=33792"
51
- # Bolt: -Wl,--emit-relocs -fno-reorder-blocks-and-partition
51
+ ADD patches/cpython_configure_ac.patch /
52
52
53
53
# runtime environment
54
54
RUN echo 'deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted' >>/etc/apt/sources.list && \
@@ -61,18 +61,25 @@ RUN echo 'deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted' >>/et
61
61
python3-distutils html2text libjs-sphinxdoc && \
62
62
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
63
63
locale-gen && \
64
+ echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" >>/etc/apt/sources.list.d/llvm.list && \
65
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
66
+ apt-get update && \
67
+ apt-get install -y bolt-15 && \
64
68
add-apt-repository -s ppa:deadsnakes/ppa && \
65
69
mkdir /cpython && \
66
70
cd /cpython && \
67
71
apt-get source python$PYTHON_VERSION && \
68
72
apt-get -s build-dep python$PYTHON_VERSION | grep "Inst " | cut -d" " -f2 | sort | tr '\n ' ' ' >build_bloat && \
69
73
DEBIAN_FRONTEND="noninteractive" TZ="Europe/Madrid" apt-get build-dep -y python$PYTHON_VERSION && \
70
- rm /etc/apt/sources.list.d/deadsnakes* && \
74
+ rm /etc/apt/sources.list.d/deadsnakes* /etc/apt/sources.list.d/llvm.list && \
71
75
cd python$PYTHON_VERSION* && \
72
76
sed -i 's/__main__/__skip__/g' Tools/scripts/run_tests.py && \
73
77
dch --bin-nmu -Dunstable "Optimized build" && \
74
78
echo 11 >debian/compat && \
75
79
sed -i 's/debhelper (>= 9)/debhelper (>= 11)/g' debian/control.in && \
80
+ patch configure.ac </cpython_configure_ac.patch && \
81
+ rm cpython_configure_ac.patch && \
82
+ sed -i 's/with-computed-gotos/with-computed-gotos --with-llvm=/usr/lib/llvm-15/bin --enable-bolt/g' debian/rules && \
76
83
DEB_CFLAGS_SET="$OPT" DEB_LDFLAGS_SET="$OPT" dpkg-buildpackage -uc -b -j$(getconf _NPROCESSORS_ONLN) && \
77
84
cd .. && \
78
85
apt-get source python3 && \
@@ -101,7 +108,7 @@ RUN echo 'deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted' >>/et
101
108
python$PYTHON_VERSION-venv* \
102
109
python$PYTHON_VERSION-full* && \
103
110
echo "========" && ls && \
104
- apt-get purge -y dpkg-dev devscripts software-properties-common html2text $(cat build_bloat) && \
111
+ apt-get purge -y dpkg-dev devscripts software-properties-common html2text bolt-15 $(cat build_bloat) && \
105
112
apt-get autoremove -y && \
106
113
dpkg -i *python3.11*.deb && \
107
114
dpkg -i python3-minimal*.deb libpython3-stdlib*.deb && \
0 commit comments