mirror of
https://github.com/danog/php.git
synced 2024-11-26 20:04:58 +01:00
Switch CFLAGS to PHP_CFLAGS, so we can keep pie without breaking users
This commit is contained in:
parent
35080ccd4c
commit
bb4874c9af
@ -37,9 +37,9 @@ RUN mkdir -p $PHP_INI_DIR/conf.d
|
||||
# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default)
|
||||
# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated)
|
||||
# https://github.com/docker-library/php/issues/272
|
||||
ENV CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
|
||||
ENV CPPFLAGS="$CFLAGS"
|
||||
ENV LDFLAGS="-Wl,-O1 -Wl,--hash-style=both"
|
||||
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
|
||||
ENV PHP_CPPFLAGS="$PHP_CFLAGS"
|
||||
ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie"
|
||||
|
||||
ENV GPG_KEYS %%GPG_KEYS%%
|
||||
|
||||
@ -89,6 +89,9 @@ RUN set -xe \
|
||||
openssl-dev \
|
||||
sqlite-dev \
|
||||
\
|
||||
&& export CFLAGS="$PHP_CFLAGS" \
|
||||
CPPFLAGS="$PHP_CPPFLAGS" \
|
||||
LDFLAGS="$PHP_LDFLAGS" \
|
||||
&& docker-php-source extract \
|
||||
&& cd /usr/src/php \
|
||||
&& ./configure \
|
||||
|
@ -32,9 +32,9 @@ RUN mkdir -p $PHP_INI_DIR/conf.d
|
||||
# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default)
|
||||
# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated)
|
||||
# https://github.com/docker-library/php/issues/272
|
||||
ENV CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
|
||||
ENV CPPFLAGS="$CFLAGS"
|
||||
ENV LDFLAGS="-Wl,-O1 -Wl,--hash-style=both"
|
||||
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
|
||||
ENV PHP_CPPFLAGS="$PHP_CFLAGS"
|
||||
ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie"
|
||||
|
||||
ENV GPG_KEYS %%GPG_KEYS%%
|
||||
|
||||
@ -88,6 +88,9 @@ RUN set -xe \
|
||||
" \
|
||||
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
|
||||
\
|
||||
&& export CFLAGS="$PHP_CFLAGS" \
|
||||
CPPFLAGS="$PHP_CPPFLAGS" \
|
||||
LDFLAGS="$PHP_LDFLAGS" \
|
||||
&& docker-php-source extract \
|
||||
&& cd /usr/src/php \
|
||||
&& ./configure \
|
||||
|
@ -1,6 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# prefer user supplied CFLAGS, but default to our PHP_CFLAGS
|
||||
: ${CFLAGS:=$PHP_CFLAGS}
|
||||
: ${CPPFLAGS:=$PHP_CPPFLAGS}
|
||||
: ${LDFLAGS:=$PHP_LDFLAGS}
|
||||
export CFLAGS CPPFLAGS LDFLAGS
|
||||
|
||||
srcExists=
|
||||
if [ -d /usr/src/php ]; then
|
||||
srcExists=1
|
||||
|
@ -1,6 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# prefer user supplied CFLAGS, but default to our PHP_CFLAGS
|
||||
: ${CFLAGS:=$PHP_CFLAGS}
|
||||
: ${CPPFLAGS:=$PHP_CPPFLAGS}
|
||||
: ${LDFLAGS:=$PHP_LDFLAGS}
|
||||
export CFLAGS CPPFLAGS LDFLAGS
|
||||
|
||||
srcExists=
|
||||
if [ -d /usr/src/php ]; then
|
||||
srcExists=1
|
||||
|
Loading…
Reference in New Issue
Block a user