-
-
Notifications
You must be signed in to change notification settings - Fork 91
feat: guard get_module export for statically linked extensions #764
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
ptondereau
merged 5 commits into
extphprs:master
from
ptondereau:feat/guard-get-module-763
Aug 20, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
70d4886
refactor(build): rename EXT_PHP_RS_STATIC_TSRMLS_CACHE to EXT_PHP_RS_…
ptondereau 3e8d7c3
feat(macros): export crate-prefixed get_module and gate no_mangle on …
ptondereau 2d268df
feat(cli): derive static-glue symbol from lib target and call crate-p…
ptondereau 317a1ba
ci: assert get_module symbol gating with nm on the hello_world cdylib
ptondereau 174a23f
docs: document EXT_PHP_RS_STATIC_EXT and the crate-prefixed get_modul…
ptondereau 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
9 changes: 5 additions & 4 deletions
9
.../cargo_php__static_glue__tests__glue_copies_get_module_into_static_entry_before_main.snap
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 |
|---|---|---|
| @@ -1,16 +1,17 @@ | ||
| --- | ||
| source: crates/cli/src/static_glue.rs | ||
| expression: "render_glue_c(\"my_ext\")" | ||
| expression: "render_glue_c(\"my_ext\", \"my_ext\")" | ||
| --- | ||
| /* Generated by `cargo php static-glue`. Do not edit. */ | ||
| #include "php_my_ext.h" | ||
|
|
||
| /* Exported by the Rust staticlib (#[php_module]). */ | ||
| extern zend_module_entry *get_module(void); | ||
| /* Exported by the Rust staticlib (#[php_module]). Crate-prefixed to | ||
| avoid colliding with other extensions' get_module. */ | ||
| extern zend_module_entry *my_ext_get_module(void); | ||
|
|
||
| zend_module_entry my_ext_module_entry; | ||
|
|
||
| __attribute__((constructor)) | ||
| static void my_ext_fill_module_entry(void) { | ||
| my_ext_module_entry = *get_module(); | ||
| my_ext_module_entry = *my_ext_get_module(); | ||
| } |
17 changes: 17 additions & 0 deletions
17
...cargo_php__static_glue__tests__glue_symbol_prefix_comes_from_lib_target_not_ext_name.snap
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,17 @@ | ||
| --- | ||
| source: crates/cli/src/static_glue.rs | ||
| expression: "render_glue_c(\"my_ext\", \"my_lib\")" | ||
| --- | ||
| /* Generated by `cargo php static-glue`. Do not edit. */ | ||
| #include "php_my_ext.h" | ||
|
|
||
| /* Exported by the Rust staticlib (#[php_module]). Crate-prefixed to | ||
| avoid colliding with other extensions' get_module. */ | ||
| extern zend_module_entry *my_lib_get_module(void); | ||
|
|
||
| zend_module_entry my_ext_module_entry; | ||
|
|
||
| __attribute__((constructor)) | ||
| static void my_ext_fill_module_entry(void) { | ||
| my_ext_module_entry = *my_lib_get_module(); | ||
| } |
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.
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.