HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //usr/pgsql-15/include/server/jit/llvmjit_backport.h
/*
 * A small header than can be included by backported LLVM code or PostgreSQL
 * code, to control conditional compilation.
 */
#ifndef LLVMJIT_BACKPORT_H
#define LLVMJIT_BACKPORT_H

#include <llvm/Config/llvm-config.h>

/*
 * Pre-LLVM 22 RuntimeDyld can produce code that crashes on large memory ARM
 * systems, because llvm::SectionMemoryManager allocates multiple pieces of
 * memory that can be placed too far apart for the generated code.  See
 * src/backend/jit/llvm/SectionMemoryManager.cpp for the patched replacement
 * class llvm::backport::SectionMemoryManager that we use as a workaround.
 * This header controls whether we use it.
 *
 * We have adjusted it to compile against a range of LLVM versions, but not
 * further back than 12 for now.
 */
#if defined(__aarch64__) && LLVM_VERSION_MAJOR > 11 && LLVM_VERSION_MAJOR < 22
#define USE_LLVM_BACKPORT_SECTION_MEMORY_MANAGER
#endif

#endif