You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this issue is unaddressed in newer releases. As summarized here, MCJIT with the SectionMemoryManager or TrivialMemoryManager allocates sections in separate memory allocation calls. On systems with lots of memory, this can wind up allocating them in different locations in a way that violates AArch64 ABI restrictions (that text and GOT segments must be within 4GB of each other). 574713c is insufficient to fix the issue (tested it in Impala).
RTDyldMemoryManager provides needsToReserveAllocationSpace/reserveAllocationSpace. One proposal is to reserve all necessary memory in a single allocation, ensuring it's one contiguous block. This puts slightly stricter requirements on contiguous memory, which may not be suitable for memory-constrained environments, but for most use-cases it switches from 2-3 allocations to 1 larger allocation. This approach seems to address the issue in Impala.
The text was updated successfully, but these errors were encountered:
Implements `reserveAllocationSpace` and provides an option to enable
`needsToReserveAllocationSpace` for large-memory environments with
AArch64.
The [AArch64 ABI](https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst)
has limits on the distance between sections as the instructions to
reference them are limited to 2 or 4GB. Allocating sections in multiple
blocks can result in distances greater than that on systems with lots of
memory. In those environments several projects using
SectionMemoryManager with MCJIT have run across assertion failures for
the R_AARCH64_ADR_PREL_PG_HI21 instruction as it attempts to address
across distances greater than 2GB (an int32).
Fixesllvm#71963 by allocating all sections in a single contiguous memory
allocation, limiting the distance required for instruction offsets
similar to how pre-compiled binaries would be loaded into memory. Does
not change the default behavior of SectionMemoryManager.
Using MCJIT, several projects have run into failures like
at https://github.com/llvm/llvm-project/blob/llvmorg-17.0.4/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp#L518.
I believe this issue is unaddressed in newer releases. As summarized here, MCJIT with the SectionMemoryManager or TrivialMemoryManager allocates sections in separate memory allocation calls. On systems with lots of memory, this can wind up allocating them in different locations in a way that violates AArch64 ABI restrictions (that text and GOT segments must be within 4GB of each other). 574713c is insufficient to fix the issue (tested it in Impala).
RTDyldMemoryManager provides needsToReserveAllocationSpace/reserveAllocationSpace. One proposal is to reserve all necessary memory in a single allocation, ensuring it's one contiguous block. This puts slightly stricter requirements on contiguous memory, which may not be suitable for memory-constrained environments, but for most use-cases it switches from 2-3 allocations to 1 larger allocation. This approach seems to address the issue in Impala.
The text was updated successfully, but these errors were encountered: