mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 15:55:39 +08:00
add pgo capabilities v3 style
This commit is contained in:
15
src/globals/patch/spc_pgo_flush_frankenphp.patch
Normal file
15
src/globals/patch/spc_pgo_flush_frankenphp.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
--- a/frankenphp.c
|
||||
+++ b/frankenphp.c
|
||||
@@ -1254,6 +1254,12 @@
|
||||
|
||||
go_frankenphp_shutdown_main_thread();
|
||||
|
||||
+ /* spc-pgo: explicit profile flush so the cgo-instrumented frankenphp
|
||||
+ * still writes .profraw on Go-runtime exit (which bypasses libc atexit).
|
||||
+ * Weak symbol → no-op in non-PGO builds. */
|
||||
+ { extern int __llvm_profile_write_file(void) __attribute__((weak));
|
||||
+ if (__llvm_profile_write_file) __llvm_profile_write_file(); }
|
||||
+
|
||||
return NULL;
|
||||
}
|
||||
|
||||
12
src/globals/patch/spc_pgo_flush_php_main.patch
Normal file
12
src/globals/patch/spc_pgo_flush_php_main.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
--- a/main/main.c
|
||||
+++ b/main/main.c
|
||||
@@ -2563,6 +2563,9 @@
|
||||
#endif
|
||||
|
||||
zend_observer_shutdown();
|
||||
+
|
||||
+ { extern int __llvm_profile_write_file(void) __attribute__((weak));
|
||||
+ if (__llvm_profile_write_file) __llvm_profile_write_file(); }
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
Reference in New Issue
Block a user