mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Don't directly include zend_jit_gdb.c
Compile the file separately and only include a header. There doesn't seem to be a good reason to directly include the C file here, and this ensures that there are no symbol clashes (see GH-7197).
This commit is contained in:
parent
b11785c5e4
commit
0e932f7cea
4 changed files with 48 additions and 10 deletions
|
@ -40,7 +40,7 @@ if test "$PHP_OPCACHE" != "no"; then
|
|||
|
||||
if test "$PHP_OPCACHE_JIT" = "yes"; then
|
||||
AC_DEFINE(HAVE_JIT, 1, [Define to enable JIT])
|
||||
ZEND_JIT_SRC="jit/zend_jit.c jit/zend_jit_vm_helpers.c"
|
||||
ZEND_JIT_SRC="jit/zend_jit.c jit/zend_jit_gdb.c jit/zend_jit_vm_helpers.c"
|
||||
|
||||
dnl Find out which ABI we are using.
|
||||
case $host_alias in
|
||||
|
|
|
@ -678,7 +678,7 @@ static int zend_jit_add_veneer(dasm_State *Dst, void *buffer, uint32_t ins, int
|
|||
#include "jit/zend_jit_helpers.c"
|
||||
#include "jit/zend_jit_disasm.c"
|
||||
#ifndef _WIN32
|
||||
# include "jit/zend_jit_gdb.c"
|
||||
# include "jit/zend_jit_gdb.h"
|
||||
# include "jit/zend_jit_perf_dump.c"
|
||||
#endif
|
||||
#ifdef HAVE_OPROFILE
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#define HAVE_GDB
|
||||
|
||||
#include "zend_jit_gdb.h"
|
||||
#include "zend_elf.h"
|
||||
#include "zend_gdb.h"
|
||||
|
||||
|
@ -484,12 +485,12 @@ static void zend_gdbjit_buildobj(zend_gdbjit_ctx *ctx, uint32_t sp_offset, uint3
|
|||
ZEND_ASSERT(ctx->objsize < sizeof(zend_gdbjit_obj));
|
||||
}
|
||||
|
||||
static int zend_jit_gdb_register(const char *name,
|
||||
const zend_op_array *op_array,
|
||||
const void *start,
|
||||
size_t size,
|
||||
uint32_t sp_offset,
|
||||
uint32_t sp_adjustment)
|
||||
int zend_jit_gdb_register(const char *name,
|
||||
const zend_op_array *op_array,
|
||||
const void *start,
|
||||
size_t size,
|
||||
uint32_t sp_offset,
|
||||
uint32_t sp_adjustment)
|
||||
{
|
||||
zend_gdbjit_ctx ctx;
|
||||
|
||||
|
@ -504,13 +505,13 @@ static int zend_jit_gdb_register(const char *name,
|
|||
return zend_gdb_register_code(&ctx.obj, ctx.objsize);
|
||||
}
|
||||
|
||||
static int zend_jit_gdb_unregister(void)
|
||||
int zend_jit_gdb_unregister(void)
|
||||
{
|
||||
zend_gdb_unregister_all();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void zend_jit_gdb_init(void)
|
||||
void zend_jit_gdb_init(void)
|
||||
{
|
||||
#if 0
|
||||
/* This might enable registration of all JIT-ed code, but unfortunately,
|
||||
|
|
37
ext/opcache/jit/zend_jit_gdb.h
Normal file
37
ext/opcache/jit/zend_jit_gdb.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend JIT |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| https://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Dmitry Stogov <dmitry@php.net> |
|
||||
| Xinchen Hui <laruence@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef HAVE_ZEND_JIT_GDB_H
|
||||
#define HAVE_ZEND_JIT_GDB_H
|
||||
|
||||
#include "zend_compile.h"
|
||||
|
||||
#define HAVE_GDB
|
||||
|
||||
int zend_jit_gdb_register(const char *name,
|
||||
const zend_op_array *op_array,
|
||||
const void *start,
|
||||
size_t size,
|
||||
uint32_t sp_offset,
|
||||
uint32_t sp_adjustment);
|
||||
|
||||
int zend_jit_gdb_unregister(void);
|
||||
void zend_jit_gdb_init(void);
|
||||
|
||||
#endif /* HAVE_ZEND_JIT_GDB_H */
|
Loading…
Add table
Add a link
Reference in a new issue