jit_bugs/Dockerfile

71 lines
2.6 KiB
Docker
Raw Permalink Normal View History

2024-11-19 13:29:53 +01:00
FROM ubuntu:24.04
2023-10-23 21:59:18 +02:00
ENV DEBIAN_FRONTEND=noninteractive
2024-11-16 11:42:33 +01:00
ENV CC=clang-19
ENV CXX=clang++-19
2023-10-23 21:59:18 +02:00
2024-11-16 11:42:33 +01:00
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/llvm-19/lib/clang/19/lib/linux/"
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 \
2024-11-16 11:42:33 +01:00
&& ./llvm.sh 19 all \
2023-10-23 21:59:18 +02:00
&& 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 \
2024-11-16 11:42:33 +01:00
libpcre2-dev libargon2-dev libedit-dev libsodium-dev llvm-19 libonig-dev \
2023-10-30 22:57:41 +01:00
gdb libcapstone-dev
2023-10-23 23:04:58 +02:00
2023-11-14 17:53:34 +01: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' \
2024-11-16 11:42:33 +01:00
&& export LDFLAGS='-g -fsanitize=address -shared-libasan -Wl,-rpath=/usr/lib/llvm-19/lib/clang/19/lib/linux/' \
2023-10-23 21:59:18 +02:00
\
&& make -j100 \
2023-11-11 19:04:15 +01:00
&& make install
2023-10-23 21:59:18 +02:00
2023-11-14 17:53:34 +01:00
ADD php.ini /etc/php/php.ini
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