Skip to content

Commit 60e0b94

Browse files
committed
Remove --libc option
1 parent 779ae83 commit 60e0b94

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

build-static.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ os="$(uname -s | tr '[:upper:]' '[:lower:]')"
2525
# - SPC_REL_TYPE: Release type to download (accept "source" and "binary", default: "source")
2626
# - SPC_OPT_BUILD_ARGS: Additional arguments to pass to spc build
2727
# - SPC_OPT_DOWNLOAD_ARGS: Additional arguments to pass to spc download
28-
# - SPC_BUILD_GNU: Set to 1 to build with GNU toolchain (default: musl toolchain)
28+
# - SPC_LIBC: Set to glibc to build with GNU toolchain (default: musl)
2929

3030
# init spc command, if we use spc binary, just use it instead of fetching source
3131
if [ -z "${SPC_REL_TYPE}" ]; then
@@ -39,10 +39,6 @@ fi
3939
if [ -z "${SPC_OPT_DOWNLOAD_ARGS}" ]; then
4040
SPC_OPT_DOWNLOAD_ARGS="--prefer-pre-built --debug --ignore-cache-sources=php-src"
4141
fi
42-
# linux build need to disable opcache jit
43-
if [ "${os}" = "linux" ]; then
44-
SPC_OPT_BUILD_ARGS="${SPC_OPT_BUILD_ARGS} --disable-opcache-jit"
45-
fi
4642
# if we need debug symbols, disable strip
4743
if [ -n "${DEBUG_SYMBOLS}" ]; then
4844
SPC_OPT_BUILD_ARGS="${SPC_OPT_BUILD_ARGS} --no-strip"
@@ -344,9 +340,9 @@ fi
344340

345341
go env
346342
cd caddy/
347-
if [ -z "${SPC_BUILD_GNU}" ]; then
343+
if [ -z "${SPC_LIBC}" ] || [ "${SPC_LIBC}" = "musl" ]; then
348344
xcaddyGoBuildFlags="-buildmode=pie -tags cgo,netgo,osusergo,static_build,nobadger,nomysql,nopgx -ldflags \"-linkmode=external -extldflags '-static-pie ${extraExtldflags}' ${extraLdflags} -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ${FRANKENPHP_VERSION} PHP ${LIBPHP_VERSION} Caddy'\""
349-
else
345+
elif [ "${SPC_LIBC}" = "glibc" ]; then
350346
xcaddyGoBuildFlags="-buildmode=pie -tags cgo,netgo,osusergo,nobadger,nomysql,nopgx -ldflags \"-linkmode=external -extldflags '-pie ${extraExtldflags}' ${extraLdflags} -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ${FRANKENPHP_VERSION} PHP ${LIBPHP_VERSION} Caddy'\""
351347
fi
352348

gnu-static.Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,17 @@ RUN yum install -y \
100100
ENV PATH="/cmake/bin:/usr/local/go/bin:$PATH"
101101

102102
# Apply gnu mode
103-
ENV SPC_SKIP_DOCTOR_CHECK_ITEMS='if musl-wrapper is installed,if musl-cross-make is installed'
104103
ENV CC='/opt/rh/devtoolset-10/root/usr/bin/gcc'
105104
ENV CXX='/opt/rh/devtoolset-10/root/usr/bin/g++'
106105
ENV AR='/opt/rh/devtoolset-10/root/usr/bin/ar'
107106
ENV LD='/opt/rh/devtoolset-10/root/usr/bin/ld'
108107
ENV SPC_DEFAULT_C_FLAGS='-fPIE -fPIC'
109-
ENV SPC_NO_MUSL_PATH='yes'
108+
ENV SPC_LIBC='glibc'
110109
ENV SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM='-Wl,-O1 -pie'
111110
ENV SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS='-ldl -lpthread -lm -lresolv -lutil -lrt'
112111
ENV SPC_OPT_DOWNLOAD_ARGS='--debug --ignore-cache-sources=php-src'
113-
ENV SPC_OPT_BUILD_ARGS='--debug --libc=glibc'
112+
ENV SPC_OPT_BUILD_ARGS='--debug'
114113
ENV SPC_REL_TYPE='binary'
115-
ENV SPC_BUILD_GNU='yes'
116114

117115
# not sure if this is needed
118116
ENV COMPOSER_ALLOW_SUPERUSER=1

0 commit comments

Comments
 (0)