-
-
Notifications
You must be signed in to change notification settings - Fork 331
Fix PIC errors when building libphp.so | extensive extension building rework #726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 18 commits
Commits
Show all changes
215 commits
Select commit
Hold shift + click to select a range
2c13eb2
static compilation is not quite working yet
henderkes b3dacf9
lowercase
henderkes f5fffaf
format setEnv§
henderkes 2897fdd
fix icu for relocatable objects (required by libphp.so building)
henderkes 03b634b
fix libsodium with -fPIC too
henderkes 23ae3f6
remove unused option
henderkes 6fe8b59
ld library path for shared extension building
henderkes 9557c9e
remove static target for zip
henderkes 2200179
remove static target for swoole
henderkes b402b73
fix copy command with BUILD_MODULES_CONSTANT
henderkes 1ae27c7
oopsie
henderkes 8726736
oopsie in opcache
henderkes 76a9be2
fix shared bz2 build
henderkes 05e9129
refactor dom out to its own extension, fails shared build
henderkes c1e91e1
sockets doesn't install header?!
henderkes eab8c27
shared dom ext requires xml
henderkes f88c10d
restore buildphp command
henderkes 2ff3009
-fPIC for unixodbc
henderkes 1fbd2c1
-fPIC for postgresql CFLAGS, but it's still erroring out
henderkes bdd7642
install headers and modules from shared extensions
henderkes ea7c145
libxml2 pic...
henderkes 1179237
Update test-extensions.php
henderkes f708907
zstd pic
henderkes 6b50700
remove dom extra cake
henderkes 8147433
Update dom.php
henderkes 54ff717
patch intl standard to c++17
henderkes bff99fa
fix imagick shared build
henderkes 5bd53ed
skip php rebuild if we're only building shared libphp.so
henderkes 7ba1948
fix pdo_sqlsrv
henderkes 683371a
fix phar
henderkes 38dfcda
fix rdkafka
henderkes 14a0e1a
fix macos
henderkes 20b6870
rewrite extension_dir
henderkes 545a653
better phar handling
henderkes 1e50dac
Update BuildPHPCommand.php
henderkes 93c6928
fix readline
henderkes a9f81dd
remove -fpic and -fpie (-fPIC and -fPIE are still there)
henderkes 03ca3f4
why do we have prefix= calls instead of prefix=BUILD_ROOT_DIR?
henderkes f47daac
cs fix, xml building fails now, unsure why, doesn't seem to import ex…
henderkes fa285ec
more patching, xml still not working though
henderkes c43423a
replace root cause of the automatic enable
henderkes 95a2f46
rework building of shared extensions so that builtin extensions are b…
henderkes 495e868
rework configure args
henderkes 7698ceb
fixes for more configure args
henderkes 3f8d297
linter
henderkes d349627
linter
henderkes 9538016
Merge branch 'fix/icurel' into feat/spx
henderkes fd5bc54
Merge pull request #721 from crazywhalecc/feat/spx
henderkes 11c1164
fix spx
henderkes 3ff31d2
fix undefined references to brotlicommon functions in gd.so
henderkes fc7df58
msgpack requires session
henderkes af51469
session, not sockets...
henderkes b376d16
remove runSharedExtensionCheckUnix
henderkes b68d71b
testPHP in windowsbuilder
henderkes e3d7969
select all quick button
henderkes 4a44282
shoehorn the lot in, I don't know how to fix this otherwise
henderkes 64b6f98
the flag doesn't fix it, the problem is something else
henderkes c29ca97
add -lbrotlienc to curl
henderkes 310be95
new build-with-php key for extensions
henderkes 3713ae8
extra dependencies for extensions
henderkes 4b8412d
shared for imagick
henderkes b91c83b
linter
henderkes 6a86b28
fix case of nonexistent pc
henderkes bc002d5
linter again
henderkes 396d4b3
broli, hahahaha
henderkes 0afe0e5
last problems (?)
henderkes 5eecd14
linter
henderkes 2a70b99
change to count of Static Extensions
henderkes 835fc1e
oops
henderkes c2d5afc
mysqli and mysqlnd can also be built shared
henderkes 5189147
shared ssh2 wants openssl if mysqli or mysqlnd aren't built in
henderkes 15dc672
remove shared-ext-depends
henderkes ed35b65
build all static exts no matter if we're also building shared versions
henderkes 4ce7374
move zend extension check into config
henderkes e568041
\$SPC_CMD_PREFIX_PHP_MAKE -> $SPC_CMD_PREFIX_PHP_MAKE
henderkes a9d5dcf
fixer
henderkes f83715c
add function description
henderkes a8987d4
the what now?
henderkes 9665473
revert env
henderkes 14ca782
rename method
henderkes 234df8d
update spx, works static and shared
henderkes c972a94
another way where static extensions would be excluded if also compile…
henderkes 3662e07
fix spc doctor command, gettext is installed by default, but doesn't …
henderkes d833d89
fixes on arch64
henderkes e2ea10d
set extension dir before
henderkes 92acb95
linter
henderkes b68701f
updated the static-php spx
henderkes 4299abf
Update vitepress version, fix selecting all options
crazywhalecc 3867b99
update doc for spx extension
henderkes 5382362
only disable openmp for rh devtoolset-10
henderkes 2a5915f
patched this in ext-spx before, do it here instead
henderkes 6147721
dont disable openmp macro
henderkes 78b2a89
--with-pic for libpng
henderkes 4c12477
--with-pic for libffi
henderkes 764fdd4
--enable-pic for gettext
henderkes 4c64707
-ldl and --with-pic for imagemagick
henderkes 8767181
--with-pic for ldap
henderkes 2dbcbc6
--with-pic and --enable-pic for other libraries that support them
henderkes ad38609
-DPOSITION_INDEPENDENT_CODE=ON
henderkes 3052b1c
change extension_dir, the env variable only has an effect during comp…
henderkes 8312ce4
add ext-xz and ext-brotli
henderkes c44b8b1
test xz and brotli as well
henderkes 61837f0
more os tests
henderkes 93eb637
Merge branch 'main' into fix/icurel
henderkes 3bc5ac2
space
henderkes 55b4ba5
fix file_exists check in printing shared extension folder
henderkes febf9b1
full test suite for shared extensions
henderkes da7a125
librdkafka needs "which" to be installed
henderkes 396ddd3
cs fix
henderkes 5ae5a3d
cs fix
henderkes 7c009b6
add rdkafka
henderkes 8b98792
zts of course
henderkes 108bf34
craft needs to download shared extensions too
henderkes ed87a7c
don't force invalidate php-src if the download option is explicitly p…
henderkes c53b06c
shared-extensions instead of build-shared
henderkes 4b0fa94
stan
henderkes 6b689f1
explicitly pass env to process handler, fails in docker otherwise (??…
henderkes a9d37bb
add source patch for ffi on centos 7
henderkes 161a553
-release (soname) compilation support for linux shared embed
henderkes e219111
tests for brotli and xz
henderkes ad8581d
Merge remote-tracking branch 'origin/main' into fix/icurel
henderkes 94e31f1
doms
henderkes e022a45
only apply ffi patch at version >= 8.3.16
henderkes 86541b1
only apply ffi patch at version >= 8.3.16
henderkes 17b4c18
accidental space
henderkes 01a79fc
unify tests for all compression extensions
henderkes 8b94a71
cs fix
henderkes 31652e8
I HATE WINDOWS
henderkes 57b527c
gzencode, of course
henderkes 861010a
trim envs
henderkes 3b9670c
fpic for liblzma
henderkes 7c4c8c6
cache libc version
henderkes 3761a9c
brotli was matching /dev/null, which should not be used
henderkes 1479bef
brotli was matching /dev/null, which should not be used
henderkes dbc7ff5
Merge pull request #746 from crazywhalecc/fix/embed-soname
henderkes 3007234
Merge remote-tracking branch 'origin/main' into fix/icurel
henderkes 621e396
Merge branch 'fix/icurel' of https://github.com/crazywhalecc/static-p…
henderkes 4582e1f
cs fix
henderkes b6a1182
patch la files
henderkes a682126
apply suggestions
henderkes 715650c
add "which" to spc doctor
henderkes 0d91ad7
remove buildUnixShared method from sqlsrv
henderkes f29ee95
remove buildUnixShared method from xhprof
henderkes 635fbae
Merge remote-tracking branch 'origin/main' into fix/icurel
henderkes 111de20
fix cs
henderkes e31942b
uncommented buildphp, haha
henderkes 2dde537
makeCmakeArgs
henderkes 2a39fb0
Merge remote-tracking branch 'origin/main' into fix/icurel
henderkes a6ea499
ngtcp2 patch la files
henderkes a302547
fix libyaml install dir
henderkes 0b8543e
thread safety for pgsql?
henderkes 23be548
thread safety for pgsql (in version 17, remove this entirely)
henderkes e5f483d
libtidy uses strange cmake options
henderkes 2093b4e
cs fix
henderkes f4771b4
test macos too
henderkes bb1f086
pq forgets to link against -llber, only links against -lldap
henderkes 08d3849
cs fix
henderkes 2f53915
fix ldap for postgresql
henderkes 0ebd44b
bring back zstd cmake flags
henderkes a99c4a3
remove getLibFilesString from Extension buildUnixShared
henderkes 6ed440d
refactor out method to get static and shared libraries
henderkes 53eb6dc
cs fix hook isn't working on windows
henderkes fa744bb
merge cmake changes from master into icurel
henderkes 187d51e
-DPOSITION_INDEPENDENT_CODE=ON for cmake
henderkes 20f222d
post merge fixes
henderkes c9e9119
remove gd from static extension test
henderkes 978975d
import class
henderkes aedcc86
fix cmake minimum version for libtidy
henderkes 684b5d4
remove alpine tests for now https://github.com/php/php-src/pull/18779
henderkes 7202514
Add autoconf executor
crazywhalecc 8b09e1a
Fix zlib autoconf builder
crazywhalecc 1b08a25
Add --enable-pic for default autoconf args
crazywhalecc 8896d47
Add tests for autoconf libs
crazywhalecc 0ed6f29
Add tests for autoconf libs
crazywhalecc 4c8f9e1
Remove attr and libacl tests
crazywhalecc ae56bed
Fix ncurses build
crazywhalecc 25c2baf
Fix brotlienc pkgconfig patching
crazywhalecc 9e8119e
Fix ldap build
crazywhalecc 6cb2cdd
Add ignoreConfigureArgs for UnixAutoconfExecutor
crazywhalecc 11f2130
Fix libxslt lib compile bug
crazywhalecc da45aa7
Fix ngtcp2 and libheif build missing lib bug
crazywhalecc 474fe63
Add optional lib log
crazywhalecc b320eb8
Rename ignoreConfigureArgs to removeConfigureArgs
crazywhalecc 145fe7c
Remove curl libbrotli patches
crazywhalecc 9ed62b0
make patchLaDependencyPrefix argument optional, remove cleanLaFiles
henderkes dcdd167
Merge remote-tracking branch 'origin/fix/icurel' into fix/icurel
henderkes 6d3e2d9
revert extension tests
henderkes 63656cf
cs fixer, of course
henderkes c3aa735
update tests to all static
henderkes 311de93
fix gomp error
henderkes a7771e9
enable musl too
henderkes a503aaa
-lomp on macos
henderkes d322be1
err, add it back in
henderkes 518ed3a
don't add -lomp on macos (not required)
henderkes a1ccddb
Test macOS 15 for all php version
crazywhalecc 70b9186
Lets' fuzz it
crazywhalecc 80f2912
Fix rdkafka with zstd build failed bug, reset test-extensions
crazywhalecc cec5274
Re-test
crazywhalecc 62a5813
compatibility with RHEL 10?
henderkes 4be1e75
dirty as fuck, I don't understand why AMQP_SHARED_LIBADD is not avail…
henderkes 0e09228
err
henderkes 78b3778
err
henderkes 9f35c95
cs fix
henderkes 84fb354
this is not needed anymore
henderkes c0ea47c
I really got redundant test error
crazywhalecc 2ea8a7e
Fix macOS embed re-archive bug
crazywhalecc e0734fe
Add frameworks for extension
crazywhalecc 28e5e58
Revert ext-matrix-tests and test-extensions
crazywhalecc e2efaab
fix attempted ar deletions when building shared libphp
henderkes bfba598
Fix glfw source path
crazywhalecc 089b94d
add fastlz, libmemcached for linux
henderkes fcfbb59
fix phpstan
henderkes 01ab0d3
update default flags
henderkes d9f7aa7
update default env (shouldn't we pass -fpic to default c flags on mac…
henderkes 0ee9a0c
oops, don't pass -fpic to CPPflags, I misread it as CXXflags
henderkes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\extension; | ||
|
|
||
| use SPC\builder\Extension; | ||
| use SPC\exception\RuntimeException; | ||
| use SPC\store\FileSystem; | ||
| use SPC\util\CustomExt; | ||
| use SPC\util\SPCConfigUtil; | ||
|
|
||
| #[CustomExt('dom')] | ||
| class dom extends Extension | ||
| { | ||
| /** | ||
| * @throws RuntimeException | ||
| */ | ||
| public function getUnixConfigureArg(bool $shared = false): string | ||
| { | ||
| $arg = '--enable-dom'; | ||
| if (!$shared) { | ||
| $arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"'; | ||
| } | ||
| return $arg; | ||
| } | ||
|
|
||
| public function patchBeforeBuildconf(): bool | ||
| { | ||
| FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/win32/build/config.w32', 'dllmain.c ', ''); | ||
| return true; | ||
| } | ||
|
|
||
| public function getWindowsConfigureArg(): string | ||
| { | ||
| return '--with-dom --with-libxml'; | ||
henderkes marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| public function buildUnixShared(): void | ||
| { | ||
| $config = (new SPCConfigUtil($this->builder))->config([$this->getName()]); | ||
| $env = [ | ||
| 'CFLAGS' => $config['cflags'] . ' -I' . SOURCE_PATH . '/php-src', | ||
| 'LDFLAGS' => $config['ldflags'], | ||
| 'LIBS' => $config['libs'], | ||
| 'LD_LIBRARY_PATH' => BUILD_LIB_PATH, | ||
| ]; | ||
| // prepare configure args | ||
| shell()->cd($this->source_dir) | ||
| ->setEnv($env) | ||
| ->execWithEnv(BUILD_BIN_PATH . '/phpize') | ||
| ->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-shared --disable-static') | ||
| ->execWithEnv('make clean') | ||
| ->execWithEnv('make -j' . $this->builder->concurrency); | ||
|
|
||
| // copy shared library | ||
| FileSystem::createDir(BUILD_MODULES_PATH); | ||
| $extensionDirFile = (getenv('EXTENSION_DIR') ?: $this->source_dir . '/modules') . '/' . $this->getName() . '.so'; | ||
| $sourceDirFile = $this->source_dir . '/modules/' . $this->getName() . '.so'; | ||
| if (file_exists($extensionDirFile)) { | ||
| copy($extensionDirFile, BUILD_MODULES_PATH . '/' . $this->getName() . '.so'); | ||
| } elseif (file_exists($sourceDirFile)) { | ||
| copy($sourceDirFile, BUILD_MODULES_PATH . '/' . $this->getName() . '.so'); | ||
| } else { | ||
| throw new RuntimeException('extension ' . $this->getName() . ' built successfully, but into an unexpected location.'); | ||
| } | ||
| // check shared extension with php-cli | ||
| if (file_exists(BUILD_BIN_PATH . '/php')) { | ||
| $this->runSharedExtensionCheckUnix(); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\extension; | ||
|
|
||
| use SPC\builder\Extension; | ||
| use SPC\util\CustomExt; | ||
|
|
||
| #[CustomExt('sockets')] | ||
| class sockets extends Extension | ||
| { | ||
| public function patchBeforeConfigure(): bool | ||
| { | ||
| if (file_exists(BUILD_INCLUDE_PATH . 'php/ext/sockets/php_sockets.h')) { | ||
| return false; | ||
| } | ||
| copy(SOURCE_PATH . '/php-src/ext/sockets/php_sockets.h', BUILD_INCLUDE_PATH . 'php/ext/sockets/php_sockets.h'); | ||
| return true; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.