HEX
Server: LiteSpeed
System: Linux srv1.dhviews.com 5.14.0-570.23.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 24 11:27:16 EDT 2025 x86_64
User: bdedition (1723)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //usr/local/apps/pgsql16/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>

/*
 * LLVM's RuntimeDyld can produce code that crashes on larger 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
#define USE_LLVM_BACKPORT_SECTION_MEMORY_MANAGER
#endif

#endif