Skip to content

Commit

Permalink
update bookworm to llvm17
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Nov 5, 2024
1 parent 11dd407 commit ba15d3c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
12 changes: 10 additions & 2 deletions dockerfiles/ci/bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ ENV PHPIZE_DEPS \
clang-17 \
cmake \
dpkg-dev \
g++ \
gcc \
file \
lcov \
libc-dev \
Expand Down Expand Up @@ -129,6 +127,16 @@ RUN set -eux; \
\
# Allow nginx to be run as non-root for tests
chown -R circleci:circleci /var/log/nginx/ /var/lib/nginx/;
\
# Make clang the default compiler
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-17 100; \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-17 100; \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100; \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 100; \
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-17 100; \
echo "-L /usr/lib/llvm-17/lib/clang/17/lib/linux" > /usr/lib/llvm-17/bin/clang.cfg; \
# Include libasan library path
echo /usr/lib/llvm-17/lib/clang/17/lib/linux > /etc/ld.so.conf.d/libasan.conf && ldconfig

# Install SqlServer PHP Driver
# https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server
Expand Down
7 changes: 5 additions & 2 deletions dockerfiles/ci/bookworm/build-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ SHARED_BUILD=$(if php -i | grep -q enable-pcntl=shared; then echo 1; else echo 0
PHP_VERSION_ID=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;')
PHP_ZTS=$(php -r 'echo PHP_ZTS;')

# This make `pecl install` use all available cores
export MAKEFLAGS="-j $(nproc)"

XDEBUG_VERSIONS=(-3.1.2)
if [[ $PHP_VERSION_ID -le 70 ]]; then
XDEBUG_VERSIONS=(-2.7.2)
Expand Down Expand Up @@ -56,8 +59,8 @@ fi
HOST_ARCH=$(if [[ $(file $(readlink -f $(which php))) == *aarch64* ]]; then echo "aarch64"; else echo "x86_64"; fi)

export PKG_CONFIG=/usr/bin/$HOST_ARCH-linux-gnu-pkg-config
export CC=$HOST_ARCH-linux-gnu-gcc
export CXX=$HOST_ARCH-linux-gnu-g++
# export CC=$HOST_ARCH-linux-gnu-gcc
# export CXX=$HOST_ARCH-linux-gnu-g++

iniDir=$(php -i | awk -F"=> " '/Scan this dir for additional .ini files/ {print $2}');

Expand Down
5 changes: 3 additions & 2 deletions dockerfiles/ci/bookworm/build-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ INSTALL_DIR=$BASE_INSTALL_DIR/$INSTALL_VERSION

if [[ ${INSTALL_VERSION} == *asan* ]]; then
export CFLAGS='-fsanitize=address -DZEND_TRACK_ARENA_ALLOC'
export LDFLAGS='-fsanitize=address'
# GCC has `-shared-libasan` default, clang has '-static-libasan' default
export LDFLAGS='-fsanitize=address -shared-libasan'
fi

mkdir -p /tmp/build-php && cd /tmp/build-php
Expand All @@ -23,7 +24,7 @@ mkdir -p ${INSTALL_DIR}/conf.d
HOST_ARCH=$(if [[ $TARGETPLATFORM == "linux/arm64" ]]; then echo "aarch64"; else echo "x86_64"; fi)

PKG_CONFIG=/usr/bin/$HOST_ARCH-linux-gnu-pkg-config \
CC=$HOST_ARCH-linux-gnu-gcc \
# CC=$HOST_ARCH-linux-gnu-gcc \
LIBS=-ldl \
${PHP_SRC_DIR}/configure \
$(if [[ $SHARED_BUILD -ne 0 ]]; then echo \
Expand Down

0 comments on commit ba15d3c

Please sign in to comment.