jit_bugs/Dockerfile

72 lines
2.7 KiB
Docker
Raw Normal View History

2023-10-23 21:59:18 +02:00
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV CC=clang-16
ENV CXX=clang++-16
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/llvm-16/lib/clang/16/lib/linux/"
2023-10-31 16:33:59 +01:00
ADD php.ini /etc/php/php.ini
2023-10-23 21:59:18 +02:00
RUN true \
&& apt update \
&& apt install -y --no-install-recommends \
tzdata software-properties-common locales curl apt-utils gpg-agent cron logrotate \
gnupg2 ca-certificates lsb-release \
make pkg-config binutils wget \
&& wget https://apt.llvm.org/llvm.sh \
&& chmod +x llvm.sh \
&& ./llvm.sh 16 all \
&& apt update \
\
\
&& apt install -y --no-install-recommends \
nginx \
openssh-client \
git curl xz-utils unzip \
libjpeg62 libjpeg62-dev zlib1g-dev \
libssl-dev libcurl4-openssl-dev \
pkg-config autoconf bison re2c \
libxml2-dev libsqlite3-dev \
systemtap-sdt-dev libssl-dev \
2023-10-30 22:57:41 +01:00
libpcre2-dev libargon2-dev libedit-dev libsodium-dev llvm-16 libonig-dev \
gdb libcapstone-dev
2023-10-23 23:04:58 +02:00
2023-10-24 17:07:49 +02:00
RUN git clone https://github.com/php/php-src -b master --depth 1 && cd php-src \
2023-10-23 21:59:18 +02:00
\
&& ./buildconf \
&& ./configure --prefix=/usr \
--includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc \
--localstatedir=/var --libdir=/usr/lib/x86_64-linux-gnu \
--libexecdir=/usr/lib/x86_64-linux-gnu \
--prefix=/usr --enable-cli --disable-cgi --disable-phpdbg \
--with-config-file-path=/etc/php/ --with-config-file-scan-dir=/etc/php/conf.d \
--libdir=/usr/lib/php --libexecdir=/usr/lib/php --datadir=/usr/share/php/8.2 \
--sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man \
--enable-debug --enable-address-sanitizer --disable-rpath --disable-static \
2023-10-23 22:21:43 +02:00
--enable-filter --with-openssl --enable-mbstring \
2023-10-23 21:59:18 +02:00
--with-password-argon2=/usr --with-external-pcre --with-mhash=/usr --with-libxml \
--enable-session --with-sodium --with-zlib=/usr --with-zlib-dir=/usr \
--enable-pcntl --with-libedit=shared,/usr \
2023-10-30 22:57:41 +01:00
--with-capstone \
2023-10-23 22:10:11 +02:00
\
&& export CFLAGS='-g -fsanitize=address -shared-libasan -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC' \
&& export CPPFLAGS='-g -fsanitize=address -shared-libasan -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC' \
&& export CXXFLAGS='-g -fsanitize=address -shared-libasan -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC' \
&& export LDFLAGS='-g -fsanitize=address -shared-libasan -Wl,-rpath=/usr/lib/llvm-16/lib/clang/16/lib/linux/' \
2023-10-23 21:59:18 +02:00
\
&& make -j100 \
2023-10-30 22:41:26 +01:00
&& make install && echo owo
2023-10-23 21:59:18 +02:00
RUN php -r "readfile('https://getcomposer.org/installer');" | php \
&& mv composer.phar /usr/bin/composer
2023-10-23 23:04:58 +02:00
RUN git config --global --add safe.directory /app
2023-10-23 21:59:18 +02:00
ENV USE_ZEND_ALLOC=0
ENV PSALM_ALLOW_XDEBUG=1
2023-10-30 22:57:41 +01:00
ENV ASAN_OPTIONS="detect_leaks=0:exitcode=139:abort_on_error=true"
2023-10-23 22:21:43 +02:00
2023-10-24 10:23:08 +02:00
WORKDIR /app