Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
288 commits
Select commit Hold shift + click to select a range
176e562
hahaha, musl 2.17 is a little far away
henderkes Jun 26, 2025
03a33d8
fix frankenphp build
henderkes Jun 26, 2025
2ff78e5
cs fix, where did that come from?
henderkes Jun 26, 2025
9a3ce77
complete test suite
henderkes Jun 26, 2025
2b4eb71
what the frick is going on with my phpstorm
henderkes Jun 26, 2025
7edd8e6
test glibc of course
henderkes Jun 26, 2025
8c70499
can build shared extensions on ubuntu 24.04 now
henderkes Jun 26, 2025
6dec25b
space
henderkes Jun 26, 2025
d945420
Update test-extensions.php
henderkes Jun 26, 2025
55d7857
pgsql x86_64 fix?
henderkes Jun 26, 2025
cc4ec4b
add back debug
henderkes Jun 26, 2025
5a7fd8c
we shouldn't need that, need to figure out the cause
henderkes Jun 27, 2025
797aaf1
remove libdir
henderkes Jun 27, 2025
d2dea83
don't check for musl toolkit when running zig, add -static to ncurses
henderkes Jun 27, 2025
e6bec8e
fix lib extra cflags
henderkes Jun 27, 2025
383045d
cs fix
henderkes Jun 27, 2025
e162a0e
libaom uses different PIC check
henderkes Jun 27, 2025
69e1acd
really stupid patch
henderkes Jun 27, 2025
ff95b46
really stupid patch for swoole
henderkes Jun 27, 2025
e92f043
really stupid patch for swoole
henderkes Jun 27, 2025
43dc04b
building shared libphp.so on musl is really pointless and should be a…
henderkes Jun 27, 2025
464c2dc
cs fix
henderkes Jun 27, 2025
96babd0
crazy test
henderkes Jun 27, 2025
f528153
strip libphp.so and frankenphp
henderkes Jun 27, 2025
b6240f1
clean files before compiling because it may try to link the wrong one
henderkes Jun 27, 2025
4c8a173
build_lib_path is better
henderkes Jun 27, 2025
aff9ff2
test fix?
henderkes Jun 27, 2025
efb1ff5
test fix 2?
henderkes Jun 27, 2025
aa51652
why isn't this triggered?
henderkes Jun 27, 2025
61274cb
use extra COMPILER_EXTRA env variable to make sure it's actually pass…
henderkes Jun 28, 2025
4a493f3
don't set rpath because on musl it'll fall over with static binaries
henderkes Jun 28, 2025
de3cb2f
no ""
henderkes Jun 28, 2025
9e9474a
extra patch for swoole for CFLAGS too
henderkes Jun 28, 2025
02f2837
adjust craft command for zig
henderkes Jun 28, 2025
a7bf1e9
we need to patch swoole early enough
henderkes Jun 28, 2025
19ddddf
self:: instead of SourcePatcher::
henderkes Jun 28, 2025
d588e6e
just strip out the error and return the output instead of executing a…
henderkes Jun 28, 2025
d6b0912
run glibc test with shared extensions against 2.28 this time
henderkes Jun 28, 2025
a44d906
fix existing check for Zig::fetch
henderkes Jun 28, 2025
1d29ac2
Revert "just strip out the error and return the output instead of exe…
henderkes Jun 29, 2025
6ed62aa
use CC=cc to install xcaddy
henderkes Jun 29, 2025
bd25de1
okay this drove me crazy...
henderkes Jun 29, 2025
2564da2
Reapply "just strip out the error and return the output instead of ex…
henderkes Jun 29, 2025
dbdf10c
support for dynamic linking of musl libc
henderkes Jun 29, 2025
78666ff
support for frankenphp linked dynamically too
henderkes Jun 29, 2025
3940f03
fix tests
henderkes Jun 29, 2025
320c21d
-static, not static
henderkes Jun 29, 2025
1839f13
thanks, autocomplete, for the useless flag
henderkes Jun 29, 2025
2ebdc45
<
henderkes Jul 1, 2025
c43a100
fix
henderkes Jul 1, 2025
ad8322b
add zig to libc/static target parsing
henderkes Jul 1, 2025
7b33ee7
make sure that $TARGET splits for -dynamic, otherwise it resolves to …
henderkes Jul 1, 2025
df0d5fd
merge fix
henderkes Jul 1, 2025
5370af4
don't zig the tests yet
henderkes Jul 1, 2025
0a33fba
zig toolchain stuff
henderkes Jul 1, 2025
b7e8587
cs fixes
henderkes Jul 1, 2025
9c7e217
formatting
henderkes Jul 1, 2025
ba7f994
simplify zig script
henderkes Jul 1, 2025
bebcb97
conflicts with shared tests
henderkes Jul 1, 2025
a483c42
redis check if static or shared
henderkes Jul 1, 2025
292df38
isInstalled for GoXcaddy
henderkes Jul 1, 2025
e34eb50
fix tests failing to deprecation
henderkes Jul 1, 2025
55fd7ba
bring back static -lstdc++ for rhel 2.17
henderkes Jul 1, 2025
408b3b4
try to test with zig?
henderkes Jul 1, 2025
f6c6011
err, we need to install zig of course
henderkes Jul 1, 2025
27f57cc
fix zig runtime
henderkes Jul 1, 2025
88f9172
bring back opcache jit fix
henderkes Jul 1, 2025
fd89e83
musl paths in zig toolchain are hogwash, of course
henderkes Jul 1, 2025
d275d6c
fix native chain
henderkes Jul 1, 2025
a6d68b9
fix ncurses
henderkes Jul 1, 2025
8d47e56
sanity check after toolset init
henderkes Jul 1, 2025
8b3a22c
better error message
henderkes Jul 1, 2025
d8ee308
allow explicitly setting toolchain (simplify testing without constant…
henderkes Jul 1, 2025
719bde8
allow compilation with empty target
henderkes Jul 1, 2025
a056462
try removing -lstdc++ (this will likely make a few extensions fail to…
henderkes Jul 1, 2025
b16638d
place -lstdc++ in compiler_extra
henderkes Jul 2, 2025
b5aa7fc
simplify script a bit
henderkes Jul 2, 2025
0695fb9
cs fixer
henderkes Jul 2, 2025
5577cd0
add cache file option to autoconf executor by default (if cflags and …
henderkes Jul 2, 2025
abe2759
add cache file option to autoconf executor by default (if cflags and …
henderkes Jul 2, 2025
6f68d7b
Revert "add cache file option to autoconf executor by default (if cfl…
henderkes Jul 2, 2025
a5a020e
Revert "add cache file option to autoconf executor by default (if cfl…
henderkes Jul 2, 2025
cc285ae
cs fix
henderkes Jul 2, 2025
4b38da7
test frankenphp too
henderkes Jul 2, 2025
76b36ce
fix macos test
henderkes Jul 2, 2025
2ac5438
libheif and libde265 report dependency on -lc++ instead of -lstdc++
henderkes Jul 2, 2025
39ffb8d
why does exec work but output=$(...) doesn't?
henderkes Jul 2, 2025
f6a292b
cleaner
henderkes Jul 2, 2025
420fe49
patch correct pc
henderkes Jul 3, 2025
aff3373
remote -lutil?
henderkes Jul 3, 2025
cebd95b
suggestion
henderkes Jul 3, 2025
c735960
Revert "remote -lutil?"
henderkes Jul 3, 2025
456d12f
fix error suppression
henderkes Jul 3, 2025
a5a87b9
update target declaration to be correct
henderkes Jul 3, 2025
20c4056
test native-native in CI
henderkes Jul 3, 2025
6355a97
don't pass --build-shared when not using zig toolchain
henderkes Jul 3, 2025
4a2b28e
fix isStatic detection for native-native
henderkes Jul 3, 2025
f6a1065
fix libc detection too
henderkes Jul 3, 2025
8b37c64
don't replace -lc++?
henderkes Jul 3, 2025
3444e30
cs fix
henderkes Jul 3, 2025
e5c5b77
don't run extra logic in zig-cc script if there's no version string i…
henderkes Jul 3, 2025
ccdb6a0
test native-linux-gnu again?
henderkes Jul 3, 2025
e019b65
does this break tests again?
henderkes Jul 3, 2025
3070376
dont use 32 bit objects
henderkes Jul 3, 2025
d65d82f
remove extra libraries for php configure/make, since they're the same…
henderkes Jul 4, 2025
94c38df
remove superfluous build-frankenphp script
henderkes Jul 4, 2025
013a19e
rename COMPILER_EXTRA to SPC_COMPILER_EXTRA
henderkes Jul 4, 2025
5f8cd97
Move extra runtime object to zig toolchain
crazywhalecc Jul 5, 2025
d7f3005
Fix missing dash
crazywhalecc Jul 5, 2025
59f9143
Remove redundant postfix in openssl
crazywhalecc Jul 5, 2025
c9d33bf
Chore
crazywhalecc Jul 5, 2025
112f607
Add linux-only for extra runtime objects
crazywhalecc Jul 5, 2025
2ac20cf
remove unnecessary LDFLAGS_PROGRAM env var
henderkes Jul 5, 2025
93d6a45
*full* shared extension build linked against musl libc dynamically wo…
henderkes Jul 5, 2025
26aca72
update php-cs fixer to get rid of PHP_CS_FIXER_IGNORE_ENV variable
henderkes Jul 5, 2025
47cbdf5
oops, needs musl
henderkes Jul 5, 2025
e31e228
don't hardcode architecture
henderkes Jul 5, 2025
a191c13
strip all may strip things needed for relocation on musl
henderkes Jul 5, 2025
05f3abe
cs fix
henderkes Jul 5, 2025
b0cfb4b
don't clog our build CI when cs fix, phpstan or phpunit fail
henderkes Jul 5, 2025
a097484
update isStatic check to ignore SPC_LIBC if using Gcc/Clang/Musl tool…
henderkes Jul 5, 2025
4024f9d
Update SPCTarget.php
henderkes Jul 5, 2025
9935eba
Update test-extensions.php
henderkes Jul 5, 2025
939b9eb
fix debug flags
henderkes Jul 5, 2025
3ff8c50
cs fix, enable action-tmate
henderkes Jul 5, 2025
b12cb33
move tmate session thingy
henderkes Jul 5, 2025
67277cc
explicitly state libphp we built?
henderkes Jul 5, 2025
01517f8
disable tmate
henderkes Jul 5, 2025
10c8fe1
make it fail again (so we can later enable tmate)
henderkes Jul 5, 2025
9bf65ff
figure out what libphp it pulls in and why
henderkes Jul 6, 2025
5ab5908
comment it out again
henderkes Jul 6, 2025
04cbba3
enable-pie for openssl
henderkes Jul 7, 2025
385a46b
update notes for argon2
henderkes Jul 7, 2025
9cd17fc
make sure that libargon2 is always linked in before libsodium
henderkes Jul 7, 2025
7b5f4e9
cs fix
henderkes Jul 8, 2025
dd6c1d9
patch pkgconf prefix to BUILD_ROOT_PATH instead of /../..
henderkes Jul 8, 2025
4f4e1ca
revert
henderkes Jul 9, 2025
df4d66a
disable jbig for imagemagick
henderkes Jul 15, 2025
64776e3
don't do host shenanigans with libffi
henderkes Jul 16, 2025
b3c6659
always dump error when extension sanity test fails
henderkes Jul 16, 2025
b05002e
manual compilation doesn't respect CFLAGS, so pass them directly
henderkes Jul 16, 2025
ca8cd7f
Merge branch 'main' into zig
henderkes Jul 16, 2025
e675af9
use zts of course...
henderkes Jul 16, 2025
33d974b
use stable sources for swoole and swow
henderkes Jul 18, 2025
991e2de
stable
henderkes Jul 18, 2025
c752f4d
tidy too
henderkes Jul 18, 2025
04f3f08
Merge branch 'main' into zig
henderkes Jul 18, 2025
fff2364
only comment out that line temporarily
henderkes Jul 18, 2025
01887d6
add extra runtime objects for shared libraries built directly by php …
henderkes Jul 19, 2025
ada203c
str_starts_with
henderkes Jul 19, 2025
683461d
actually path php makefile
henderkes Jul 19, 2025
6f9a45b
shared extensions may also need to patch
henderkes Jul 19, 2025
9b72f57
use www.example.com
henderkes Jul 19, 2025
b79b1f5
cs fix
henderkes Jul 19, 2025
bce363e
make sure we didn't break any other OS
henderkes Jul 21, 2025
711d61d
testing frankenphp with php 8.1 makes no sense
henderkes Jul 21, 2025
828f515
disable ubuntu latest (jit error until php-src fixes it)
henderkes Jul 21, 2025
ff30e0f
Use https instead of http for gnu docker
crazywhalecc Jul 22, 2025
4fc081f
Correct chdir to original dir
crazywhalecc Jul 22, 2025
86e3e51
Drop legacy phpmicro support
crazywhalecc Jul 22, 2025
d5cd42b
delete cs fixer wrapper
henderkes Jul 22, 2025
a0f474d
redundant
henderkes Jul 22, 2025
3350888
Merge remote-tracking branch 'origin/zig' into zig
crazywhalecc Jul 22, 2025
f69f8d1
Move zig-toolchain-only things to zig toolchain class
crazywhalecc Jul 22, 2025
a8dcfce
chore
crazywhalecc Jul 22, 2025
b746e50
Make IANA happier than apple
crazywhalecc Jul 22, 2025
206bc95
use correct musl lib
henderkes Jul 22, 2025
1e42ef0
Merge remote-tracking branch 'origin/zig' into zig
henderkes Jul 22, 2025
9ba9b87
makes more sense
henderkes Jul 22, 2025
81b96c2
Merge remote-tracking branch 'origin/main' into zig
henderkes Jul 22, 2025
1300919
cs fix
henderkes Jul 22, 2025
aa366d4
remove linux target os
henderkes Jul 22, 2025
8f8a493
trigger deprecation again
henderkes Jul 22, 2025
84e470d
Merge branch 'main' of https://github.com/crazywhalecc/static-php-cli…
henderkes Jul 24, 2025
b3f1103
well shit, zig cannot build libjxl
henderkes Jul 24, 2025
8c8800f
work around it for -target without version...
henderkes Jul 24, 2025
6c76187
remove old code
henderkes Jul 24, 2025
407f6d4
remove zig specifics
henderkes Jul 24, 2025
6da3f78
force disable AVX512 for zig
henderkes Jul 24, 2025
41bb3e7
move -Wno-date-time to ZigToolchain instead of env.ini
henderkes Jul 24, 2025
1d6b2bd
cs fix
henderkes Jul 24, 2025
c86360c
typo
henderkes Jul 24, 2025
eb898a8
add ulimit -n for zigtoolchain
henderkes Jul 24, 2025
7b07137
typo
henderkes Jul 24, 2025
5c9a3e2
array_reverse again
henderkes Jul 24, 2025
dd99f25
do not pull it symbols from libpq during conftests...
henderkes Jul 24, 2025
eca7a43
get rid of extra logic for shared and static libraries, rely on SPCCo…
henderkes Jul 24, 2025
7177afd
phpstan fix
henderkes Jul 24, 2025
155e22a
with_dependencies was removed
henderkes Jul 24, 2025
8c5dc91
test gnu (test musl again later, jxl fails with avx shit again)
henderkes Jul 24, 2025
8ff52e2
-lphp shared not static
henderkes Jul 24, 2025
7eb5fb4
l:libstdc++.a
henderkes Jul 25, 2025
00e78dd
fix imagick problem, for some reason it must be in the --start-group …
henderkes Jul 25, 2025
ea56e46
zig script
henderkes Jul 25, 2025
27a4d5a
better description of function
henderkes Jul 25, 2025
0acf238
suggested are required too
henderkes Jul 25, 2025
029f2db
oh dear god what am I doing
henderkes Jul 25, 2025
199b3b5
Merge branch 'main' of https://github.com/crazywhalecc/static-php-cli…
henderkes Jul 25, 2025
51fcc6b
test musl again (succeeds locally :)
henderkes Jul 25, 2025
37a453b
of course x)
henderkes Jul 25, 2025
b4392ad
always install musl libc (to be able to compile dynamic with zig)
henderkes Jul 25, 2025
a8be88d
fix swow
henderkes Jul 25, 2025
821411c
only -lstdc++ on linux
henderkes Jul 25, 2025
a9fab86
rename getStaticAndSharedLibs
henderkes Jul 25, 2025
a0edca5
docs for function
henderkes Jul 25, 2025
af63723
revert DYLD_LIBRARY_PATH
henderkes Jul 25, 2025
ed3a78b
revert macos mistake
henderkes Jul 25, 2025
a3efe86
logging
henderkes Jul 25, 2025
18a5215
cs fix
henderkes Jul 25, 2025
5482f13
make sure we don't use musl ld
henderkes Jul 25, 2025
a355e4d
run macos tests again
henderkes Jul 25, 2025
da8c385
please...?
henderkes Jul 25, 2025
d627363
please please...?
henderkes Jul 25, 2025
753c720
remove test, seems like removing musl from paths was successful
henderkes Jul 25, 2025
3cbd52c
test with zig-cc instead
henderkes Jul 25, 2025
70a9ffe
now test gnu again
henderkes Jul 25, 2025
2cb1a95
change dependency tracking
henderkes Jul 26, 2025
6e74dab
reduce libphp.a size by stripping .a archives inside it as well
henderkes Jul 26, 2025
c2b3b78
switch to libmimalloc.a because go linker is sometimes doing unpredic…
henderkes Jul 26, 2025
630f861
move musl check so it doesn't keep prompting for install
henderkes Jul 26, 2025
fb62a0e
small adjustments
henderkes Jul 26, 2025
9785521
try to make everything -flto=thin compatible (librdkafka fails for so…
henderkes Jul 26, 2025
05053b5
cs fix
henderkes Jul 26, 2025
d0d51cc
trigger CI again after clearing cache
henderkes Jul 26, 2025
e1edaa2
"zig-cc" cannot create shared objects according to conftests...
henderkes Jul 26, 2025
76094fd
hello?
henderkes Jul 26, 2025
bd3092a
wtf?
henderkes Jul 26, 2025
5a4da8e
install zig before doctor
henderkes Jul 26, 2025
cf529ad
uh, oh, we forgot to do post init
henderkes Jul 26, 2025
5beb083
no musl check?
henderkes Jul 26, 2025
42b4272
idk
henderkes Jul 26, 2025
b6f673c
Use $AR instead of `ar`. Compatibility with -flto(=thin).
henderkes Jul 26, 2025
a8492f0
use zig's linker too (ends up getting used automatically in most case…
henderkes Jul 26, 2025
5b4cbbb
set permissions
henderkes Jul 26, 2025
944cca7
use $AR in second part of command too
henderkes Jul 26, 2025
fb2d676
zig doesn't support windows (php doesn't support mingw, zig can only …
henderkes Jul 26, 2025
3087dc8
https://www.phoronix.com/news/GNU-Binutils-2.44 ld.gold is deprecated
henderkes Jul 28, 2025
342192f
remove lto related stuff again, not worth using
henderkes Jul 28, 2025
feaff0a
fix macos
henderkes Jul 29, 2025
a968b19
remove zig stuff from tests for now, since we need to keep gcc default
henderkes Jul 29, 2025
e8bc892
Merge branch 'main' of https://github.com/crazywhalecc/static-php-cli…
henderkes Jul 29, 2025
72abd63
cs fix
henderkes Jul 29, 2025
81f359d
fix tests
henderkes Jul 29, 2025
430364a
quicker tests
henderkes Jul 29, 2025
83dae09
cs fix
henderkes Jul 29, 2025
df76ecb
Fix PHPUnit test, remove unneeded test (function is dynamic)
crazywhalecc Jul 29, 2025
76d17eb
-static was too much
henderkes Jul 29, 2025
fda637b
suggestions
henderkes Jul 30, 2025
ecaa31f
no start group for macos
henderkes Jul 31, 2025
c58bc03
version 2.7.0
henderkes Jul 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
> If a modification is not involved, please skip it directly.

- If you modified `*.php` or `*.json`, run them locally to ensure your changes are valid:
- [ ] `PHP_CS_FIXER_IGNORE_ENV=1 composer cs-fix`
- [ ] `composer cs-fix`
- [ ] `composer analyse`
- [ ] `composer test`
- [ ] `bin/spc dev:sort-config`
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ jobs:
run: ${{ needs.define-build.outputs.download }}
- name: "Build PHP"
run: ${{ needs.define-build.outputs.build }}
#- name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3

# Upload cli executable
- if: ${{ inputs.build-cli == true }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
tools: pecl, composer, php-cs-fixer

- name: Run PHP-CS-Fixer fix
run: PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --dry-run --diff --ansi
run: php-cs-fixer fix --dry-run --diff --ansi

phpstan:
runs-on: ubuntu-latest
Expand All @@ -55,6 +55,8 @@ jobs:
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
tools: composer
env:
phpts: zts

- name: "Cache Composer packages"
id: composer-cache
Expand Down Expand Up @@ -135,7 +137,7 @@ jobs:
build:
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
needs: define-matrix
needs: [define-matrix, php-cs-fixer, phpstan, phpunit]
timeout-minutes: 120
strategy:
matrix:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ packlib_files.txt
/bin/*
!/bin/spc*
!/bin/setup-runtime*
!/bin/spc-alpine-docker
!/bin/php-cs-fixer-wrapper
!/bin/build-static-frankenphp

# exclude windows build tools
/php-sdk-binary-tools/
Expand Down
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@
])
->setFinder(
PhpCsFixer\Finder::create()->in([__DIR__ . '/src', __DIR__ . '/tests/SPC'])
);
)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());
158 changes: 0 additions & 158 deletions bin/build-static-frankenphp

This file was deleted.

4 changes: 0 additions & 4 deletions bin/php-cs-fixer-wrapper

This file was deleted.

5 changes: 2 additions & 3 deletions bin/spc-gnu-docker
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ RUN if [ "$SPC_USE_ARCH" = "aarch64" ]; then \
sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo ; \
fi
RUN sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo && \
sed -i 's|http://|https://|g' /etc/yum.repos.d/*.repo

RUN yum update -y && \
yum install -y devtoolset-10-gcc-* devtoolset-10-libatomic-devel
Expand Down Expand Up @@ -155,8 +156,6 @@ fi
# Apply env in temp env file
echo 'SPC_DEFAULT_C_FLAGS=-fPIC' > /tmp/spc-gnu-docker.env
echo 'SPC_LIBC=glibc' >> /tmp/spc-gnu-docker.env
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-Wl,-O1 -pie"' >> /tmp/spc-gnu-docker.env
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm -lresolv -lutil -lrt"' >> /tmp/spc-gnu-docker.env

# Environment variable passthrough
ENV_LIST=""
Expand Down
55 changes: 22 additions & 33 deletions config/env.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,26 @@ PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static
; Windows static linking system libs
SPC_EXTRA_LIBS=""

[linux]
; Linux can use different build toolchain, but the toolchain can not be changed in this file:
; - musl (default): used for general linux distros, can build `musl-static` target only.
; - zig (WIP): used for general linux distros, can build `musl` and `glibc` targets.
; - musl-native: used for alpine linux, can build `musl-static` and `musl`(WIP) target.
; - gnu-native (assume): used for general linux distros, can build `glibc` target only and have portability issues.
; Linux can use different build toolchains.
; - musl (default, when SPC_LIBC=musl): used for general linux distros, can build `musl` (statically linked) only.
; - zig (will become default): usable on all Linux distros, can build `-musl`, `arch-linux-musl -dynamic` and `arch-linux-gnu` targets. Can specify version such as `x86_64-linux-gnu.2.17`.
; - musl-native: used for alpine linux, can build `musl` and `musl -dynamic` target.
; - gnu-native: used for general linux distros, can build gnu target for the installed glibc version only.

; build target:
; - musl-static (default): pure static linking, using musl-libc, can run on any linux distro.
; - musl: static linking with dynamic linking to musl-libc, can run on musl-based linux distro.
; - glibc: static linking with dynamic linking to glibc, can run on glibc-based linux distro.

; include PATH for musl libc.
; LEGACY option to specify the target
SPC_LIBC=musl

; Recommended: specify your target here. Zig toolchain will be used.
; examples:
; `native-native-gnu` - links against glibc, current OS version
; `native-native-gnu.2.17` - links against glibc, version 2.17
; `native-native` - links against system libc dynamically
; `native-native-musl` - links against musl libc statically
; `native-native-musl -dynamic` - links against musl libc dynamically
; SPC_TARGET=

; compiler environments
CC=${SPC_LINUX_DEFAULT_CC}
CXX=${SPC_LINUX_DEFAULT_CXX}
Expand All @@ -87,8 +90,7 @@ LD=${SPC_LINUX_DEFAULT_LD}
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
SPC_EXTRA_LIBS=""
SPC_DEFAULT_LD_FLAGS=""
; upx executable path
UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
Expand All @@ -107,16 +109,10 @@ SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
; CFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fPIE"
; CPPFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
; LDFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
; LIBS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm"
; EXTRA_CFLAGS for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_DEFAULT_C_FLAGS} -g -fstack-protector-strong -fno-ident -fPIE"
; EXTRA_LIBS for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm"
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""

[macos]
; build target: macho or macho (possibly we could support macho-universal in the future)
Expand All @@ -128,8 +124,7 @@ CXX=clang++
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
SPC_DEFAULT_C_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
SPC_DEFAULT_CXX_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
SPC_EXTRA_LIBS=""
SPC_DEFAULT_LD_FLAGS=""
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
SPC_MICRO_PATCHES=cli_checks,macos_iconv

Expand All @@ -146,14 +141,8 @@ SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
; CFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -Werror=unknown-warning-option"
; CPPFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
; LDFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
; EXTRA_CFLAGS for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_DEFAULT_C_FLAGS} -g -fstack-protector-strong -fpic -fpie"
; EXTRA_LIBS for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-lresolv"
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie ${SPC_DEFAULT_C_FLAGS}"

[freebsd]
; compiler environments
Expand Down
1 change: 1 addition & 0 deletions config/ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@
"type": "builtin",
"arg-type": "custom",
"arg-type-windows": "with",
"build-with-php": true,
"lib-depends": [
"openssl",
"zlib"
Expand Down
6 changes: 3 additions & 3 deletions config/lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@
"mimalloc": {
"source": "mimalloc",
"static-libs-unix": [
"mimalloc.o"
"libmimalloc.a"
]
},
"ncurses": {
Expand Down Expand Up @@ -738,8 +738,8 @@
"openssl": {
"source": "openssl",
"static-libs-unix": [
"libcrypto.a",
"libssl.a"
"libssl.a",
"libcrypto.a"
],
"static-libs-windows": [
"libssl.lib",
Expand Down
15 changes: 15 additions & 0 deletions config/pkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,20 @@
},
"go-xcaddy-aarch64-macos": {
"type": "custom"
},
"zig-x86_64-linux": {
"type": "custom"
},
"zig-aarch64-linux": {
"type": "custom"
},
"zig-x86_64-macos": {
"type": "custom"
},
"zig-aarch64-macos": {
"type": "custom"
},
"zig-x86_64-win": {
"type": "custom"
}
}
Loading