Skip to content

Commit 92d5b46

Browse files
committed
sapi/was/precompile: check HAVE_JIT to fix linker failure with --disable-opcache-jit
1 parent 8ccd0f7 commit 92d5b46

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sapi/was/precompile.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
#include "../../ext/opcache/zend_file_cache.h"
2424
#include "../../ext/opcache/zend_shared_alloc.h"
2525
#include "../../ext/opcache/zend_persist.h"
26+
#ifdef HAVE_JIT
2627
#include "../../ext/opcache/jit/zend_jit.h"
28+
#endif
2729
#include "../../ext/opcache/ZipFormat.hxx"
2830
#include "ScopeExit.hxx"
2931

@@ -172,9 +174,11 @@ precompile(const char *const*files, size_t n_files)
172174
{
173175
CG(compiler_options) |= ZEND_COMPILE_WITHOUT_EXECUTION|ZEND_COMPILE_WITH_FILE_CACHE;
174176

177+
#ifdef HAVE_JIT
175178
/* JIT must be disabled when storing to a file because the JIT
176179
will redirect opcode handlers to itself */
177180
JIT_G(on) = false;
181+
#endif
178182

179183
const int fd = open(".", O_TMPFILE|O_RDWR|O_CLOEXEC, 0644);
180184
if (fd < 0) {

0 commit comments

Comments
 (0)