423 Commits

Author SHA1 Message Date
Lang Hames
e4b6e686b7 [JITLink][ELF][x86-64] Add support for R_X86_64_GOTPC32 relocation.
Adds support for the R_X86_64_GOTPC32 relocation, which is a 32-bit delta to
the global offset table.

Since the delta to the GOT doesn't actually require any GOT entries to exist
this commit adds an extra fallback path to the getOrCreateGOTSymbol function:
If the symbol is in the extenal symbols list but no entry exists then the
symbol is turned into an absolute symbol pointing to an arbitrary address in
the current graph's allocation (accessing this address via the symbol would be
illegal, but any access should have triggered creation of a GOT entry which
would prevent this fallback path from being taken in the first place).

This commit also updates the llvm-jitlink tool to scrape the addresses of the
absolute symbols in the graph so that the testcase can see the now-absolute
_GLOBAL_OFFSET_TABLE_ symbol.
2023-04-17 01:45:01 +00:00
Lang Hames
8308e81b74 [JITLink][ELF][x86-64] Implement ELF::R_X86_64_NONE.
R_X86_64_NONE is a no-op, so we just need to return from addSingleRelocation
early.
2023-04-16 03:19:11 +00:00
Lang Hames
9ee16eb526 [JITLink][x86-64] Add x86_64::Pointer8 edge kind, ELF::R_X86_64_8 reloc support.
This commit adds an x86-64 Pointer8 edge kind (8-bit pointer), and uses it to
implement support for the ELF::R_X86_64_8 relocation kind.
2023-04-16 02:35:36 +00:00
Lang Hames
ad7ab8f465 [JITLink][x86-64] Implement ELF::R_X86_64_16.
We already had an x86_64::Pointer16 edge kind courtesy of Sunho's COFF/x86-64
work, it just needed to be wired up.
2023-04-16 02:00:16 +00:00
Lang Hames
d3df7b1568 [JITLink][ELF][x86-64] Don't use intermediate edge-kinds in ELF/x86-64 backend.
The mapping from ELF relocation types to JITLink x86-64 edge kinds is 1-1, so
we don't need the intermediate step.
2023-04-15 17:49:38 +00:00
Job Noorman
4752787cc3 [JITLink][RISCV] Handle R_RISCV_CALL_PLT fixups
In the default link configuration, PLT stubs are created automatically
for R_RISCV_CALL_PLT relocations and the relocation itself is
transformed to R_RISCV_CALL (PerGraphGOTAndPLTStubsBuilder_ELF_riscv).
Only the latter is later handled when applying fixups and the former is
simply ignored.

This patch proposes to handle R_RISCV_CALL_PLT anyway when applying
fixups to support custom configurations that do not need automatic PLT
creation. An example of this is BOLT where PLT entries from the input
binary are reused (D147544).

Reviewed By: StephenFan

Differential Revision: https://reviews.llvm.org/D148238
2023-04-14 09:11:19 +02:00
Lang Hames
18bfc92aac [JITLink] Remove a stale comment.
This comment was probably mangled when the generic ELFLinkGraphBuilder was
written from the original x86-64 specific version. Regardless of its origins,
it doesn't make any sense now.
2023-04-12 21:43:12 -07:00
Job Noorman
6a14a56aaf [JITLink][RISCV] ADD/SUB relocs: read value from working memory
The various ADD/SUB relocations work by reading the current value the
relocation points to, transforming it, and then writing it back to
memory. While the current implementation writes the value back to
working memory, it reads the current value from the execution address of
the relocation. This causes at least wrong results, but often crashes,
when the addresses of working memory are not equal to execution
addresses. This patch fixes this by reading the current value from
working memory.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D147693
2023-04-07 09:47:49 +02:00
Stefan Gränitz
a05a98a230 [JITLink][AArch32] Implement ELF::R_ARM_ABS32 after we stopped skipping debug info sections
We create LinkGraph sections with NoAlloc lifetime now since f05ac803ffe76c7f4299a4e1288cc6bb8b098410
This means we do process debug info sections now with all their relocations. That's ok for the moment.
2023-04-05 18:02:12 +02:00
Job Noorman
e9b394b08e [JITLink][ELF] Only make sections with SHF_WRITE writable
All non-executable sections used to be mapped as RW- causing read-only
sections such as .rodata to be writable.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D147442
2023-04-03 20:18:27 +02:00
Lang Hames
8b1771bd9f [ORC] Move most ORC APIs to ExecutorAddr, introduce ExecutorSymbolDef.
ExecutorAddr was introduced in b8e5f918166 as an eventual replacement for
JITTargetAddress. ExecutorSymbolDef is introduced in this patch as a
replacement for JITEvaluatedSymbol: ExecutorSymbolDef is an (ExecutorAddr,
JITSymbolFlags) pair, where JITEvaluatedSymbol was a (JITTargetAddress,
JITSymbolFlags) pair.

A number of APIs had already migrated from JITTargetAddress to ExecutorAddr,
but many of ORC's internals were still using the older type. This patch aims
to address that.

Some public APIs are affected as well. If you need to migrate your APIs you can
use the following operations:

* ExecutorAddr::toPtr replaces jitTargetAddressToPointer and
  jitTargetAddressToFunction.

* ExecutorAddr::fromPtr replace pointerToJITTargetAddress.

* ExecutorAddr(JITTargetAddress) creates an ExecutorAddr value from a
  JITTargetAddress.

* ExecutorAddr::getValue() creates a JITTargetAddress value from an
  ExecutorAddr.

JITTargetAddress and JITEvaluatedSymbol will remain in JITSymbol.h for now, but
the aim will be to eventually deprecate and remove these types (probably when
MCJIT and RuntimeDyld are deprecated).
2023-03-27 17:37:58 -07:00
Benjamin Kramer
03df67e785 [JITLink] Drop using namespace
I don't think these are holding their weight and cause nasty to debug
compiler issues with some versions of MSVC as seen in
https://reviews.llvm.org/D144083#4220866

Just qualify the types with the full name.
2023-03-27 15:20:40 +02:00
Stefan Gränitz
4cb0b7ce3b [JITLink] Fix MSVC build error: formatv can't handle support::ulittle16_t values
The issue was reported with compiler output here: https://reviews.llvm.org/D144083#4219383
2023-03-24 20:53:27 +01:00
Stefan Gränitz
a35e4d2cae [JITLink] Fix MSVC build error: fully qualify llvm::object::ELFFile 2023-03-24 12:04:50 +01:00
Stefan Gränitz
5c1d160cd9 Reland "[JITLink] Initial AArch32 backend"
This first version lays the foundations for AArch32 support in JITLink. ELFLinkGraphBuilder_aarch32 processes REL-type relocations and populates LinkGraphs from ELF object files for both big- and little-endian systems. The ArmCfg member controls subarchitecture-specific details throughout the linking process (i.e. it's passed to ELFJITLinker_aarch32).

Relocation types follow the ABI documentation's division into classes: Data (endian-sensitive), Arm (32-bit little-endian) and Thumb (2x 16-bit little-endian, "Thumb32" in the docs). The implementation of instruction encoding/decoding for relocation resolution is implemented symmetrically and is testable in isolation (see AArch32 category in JITLinkTests).

Callable Thumb functions are marked with a ThumbSymbol target-flag and stored in the LinkGraph with their real addresses. The thumb-bit is added back in when the owning JITDylib requests the address for such a symbol.

The StubsManager can generate (absolute) Thumb-state stubs for branch range extensions on v7+ targets. Proper GOT/PLT handling is not yet implemented.

This patch is based on the backend implementation in ez-clang and has just enough functionality to model the infrastructure and link a Thumb function `main()` that calls `printf()` to dump "Hello Arm!" on Armv7a. It was tested on Raspberry Pi with 32-bit Raspbian OS.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D144083
2023-03-24 10:18:08 +01:00
Gulfem Savrun Yeniceri
f23dcb2f2a Revert "[JITLink] Initial AArch32 backend"
This reverts commit c2de8ff92753acdb1ace7a27cc11cb09f28eb8fa.
It caused a segmentation fault while running ExecutionEngine
tests on Mac.
https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-mac-x64/b8785839382041226465/overview
2023-03-23 20:56:43 +00:00
Stefan Gränitz
c2de8ff927 [JITLink] Initial AArch32 backend
This first version lays the foundations for AArch32 support in JITLink. ELFLinkGraphBuilder_aarch32 processes REL-type relocations and populates LinkGraphs from ELF object files for both big- and little-endian systems. The ArmCfg member controls subarchitecture-specific details throughout the linking process (i.e. it's passed to ELFJITLinker_aarch32).

Relocation types follow the ABI documentation's division into classes: Data (endian-sensitive), Arm (32-bit little-endian) and Thumb (2x 16-bit little-endian, "Thumb32" in the docs). The implementation of instruction encoding/decoding for relocation resolution is implemented symmetrically and is testable in isolation (see AArch32 category in JITLinkTests).

Callable Thumb functions are marked with a ThumbSymbol target-flag and stored in the LinkGraph with their real addresses. The thumb-bit is added back in when the owning JITDylib requests the address for such a symbol.

The StubsManager can generate (absolute) Thumb-state stubs for branch range extensions on v7+ targets. Proper GOT/PLT handling is not yet implemented.

This patch is based on the backend implementation in ez-clang and has just enough functionality to model the infrastructure and link a Thumb function `main()` that calls `printf()` to dump "Hello Arm!" on Armv7a. It was tested on Raspberry Pi with 32-bit Raspbian OS.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D144083
2023-03-23 11:25:45 +01:00
Stefan Gränitz
cf8dc9dfe9 [JITLink] Introduce target flags for Symbol and prepare ObjectLinkingLayer to account for them
AArch32 branch offsets explicitly encode the target instruction subset (Arm/Thumb) in their least significant bit. We want this bit set (or clear) in addreses we hand out, but the addresses in the LinkGraph should be the real/physical addresses.

This patch allows ELFLinkGraphBuilder's to set target-specific flags in jitlink::Symbol and prepares ObjectLinkingLayer to account for them.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D146641
2023-03-22 20:44:43 +01:00
Lang Hames
f05ac803ff Re-apply "[JITLink][ELF] Don't skip debug info sections by default."
This reapplies 57aeb305460406f7b822cfe6ab9fb4d730fc3b38, which was reverted in
f721fcb6ed0a186b8f146282467dd8420a5a36d0 due to buildbot failures.

The cause of the failure was missing support for R_AARCH64_ABS32, which was
added in fb1b9945be7657a3a25b727eaf0eeb3f74525210.
2023-03-20 22:24:04 +00:00
Lang Hames
fb1b9945be [JITLink][ELF][AArch64] Add support for ELF R_AARCH64_ABS32 relocation.
This relocation is commonly used in debug sections. Failure to handle it caused
the test failure in https://lab.llvm.org/buildbot/#/builders/197/builds/4272,
which forced the reversion, in f721fcb6ed0, of 57aeb305460 ("[JITLink][ELF]
Don't skip debug info sections by default"). This fix should allow us to
re-land 57aeb305460.
2023-03-20 21:00:20 +00:00
Muhammad Omair Javaid
f721fcb6ed Revert "[JITLink][ELF] Don't skip debug info sections by default."
This reverts commit 57aeb305460406f7b822cfe6ab9fb4d730fc3b38.
Breaks buildbot https://lab.llvm.org/buildbot/#/builders/197/builds/4272
2023-03-20 15:33:20 +05:00
Lang Hames
57aeb30546 [JITLink][ELF] Don't skip debug info sections by default.
By default ELFLinkGraphBuilder will now create LinkGraph sections with NoAlloc
lifetime for debug info sections in the original object. Debug sections are not
kept alive by default, and will be dead-stripped unless some plugin marks them
as live in the pre-prune phase.
2023-03-18 22:34:07 -07:00
Lang Hames
ede78c1704 [JITLink][ELF][x86-64] Add support for R_X86_64_32 relocation. 2023-03-18 20:00:03 -07:00
Lang Hames
0b7e16afc9 Re-apply "[JITLink][ORC] Rename MemDeallocPolicy to MemLifetime..." with fixes.
This reapplies 2cc64df0bd6a802eab592dbc282463c3e4a4281c, which was reverted in
5379c46d490640bfa80283e00240b6f1006092b4 due to bot failures.

The new patch contains fixes to ELFLinkGraphBuilder.h to better handle
non-SHT_ALLOC sections (these were being accidentally skipped in the previous
patch), and to skip SHT_NULL sections.
2023-03-18 10:13:55 -07:00
Lang Hames
5379c46d49 Revert "[JITLink][ORC] Rename MemDeallocPolicy to MemLifetimePolicy, add ..."
This reverts commit 2cc64df0bd6a802eab592dbc282463c3e4a4281c while I investigate
bot failures (e.g. https://lab.llvm.org/buildbot/#/builders/3/builds/23081).
2023-03-17 12:58:41 -07:00
Lang Hames
2cc64df0bd [JITLink][ORC] Rename MemDeallocPolicy to MemLifetimePolicy, add NoAlloc option.
The original MemDeallocPolicy had two options:
* Standard: allocated memory lives until deallocated or abandoned.
* Finalize: allocated memory lives until all finalize actions have been run,
            then is destroyed.

This patch introduces a new 'NoAlloc' option. NoAlloc indicates that the
section should be ignored by the JITLinkMemoryManager -- the memory manager
should allocate neither working memory nor executor address space to blocks in
NoAlloc sections. The NoAlloc option is intended to support metadata sections
(e.g. debug info) that we want to keep in the graph and have fixed up if
necessary, but don't want allocated or transmitted to the executor (or we want
that allocation and transmission to be managed manually by plugins).

Since NoAlloc blocks are ignored by the JITLinkMemoryManager they will not have
working memory allocated to them by default post-allocation. Clients wishing to
modify the content of a block in a NoAlloc section should call
`Block::getMutableMemory(LinkGraph&)` to get writable memory allocated on the
LinkGraph's allocator (this memory will exist for the lifetime of the graph).
If no client requests mutable memory prior to the fixup phase then the generic
link algorithm will do so when it encounters the first edge in any given block.

Addresses of blocks in NoAlloc sections are initialized by the LinkGraph
creator (a LinkGraphBuilder, if the graph is generated from an object file),
and should not be modified by the JITLinkMemoryManager. Plugins are responsible
for updating addresses if they add/remove content from these sections. The
meaning of addresses in NoAlloc-sections is backend/plugin defined, but for
fixup purposes they will be treated the same as addresses in Standard/Finalize
sections. References from Standard/Finalize sections to NoAlloc sections are
expected to be common (these represent metadata tracking executor addresses).
References from NoAlloc sections to Standard/Finalize sections are expected to
be rare/non-existent (they would represent JIT'd code / data tracking metadata
in the controller, which would be surprising). LinkGraphBuilders and specific
backends may impose additional constraints on edges between Standard/Finalize
and NoAlloc sections where required for correctness.

Differential Revision: https://reviews.llvm.org/D146183
2023-03-17 12:35:41 -07:00
Tom Stellard
68c14f582c JITLink: Add missing EHFrame NULL terminator on aarch64/ELF
This fixes test failures on AArch64 with libgcc-13:

Clang :: Interpreter/global-dtor.cpp
Clang-Unit :: Interpreter/./ClangReplInterpreterTests/2/4

Reviewed By: lhames, v.g.vassilev

Differential Revision: https://reviews.llvm.org/D146067
2023-03-14 16:51:22 -07:00
Stefan Gränitz
59b8db1db8 [JITLink] Drop const qualifier from argument to ELFLinkGraphBuilder's ctors (NFC)
These values are moved into the base class constructors, so the `const` doesn't make any sense. Turns out, I accidentally introduced it myself with 2ed91da0f1f3 and since than it spread by copy/paste.
2023-02-15 10:54:51 +01:00
Lang Hames
10b5fec256 [JITLink][ORC] Add LinkGraph::allocateCString method.
Renames the existing allocateString method to allocateContent and adds a pair of
allocateCString methods.

The previous allocateString method did not include a null-terminator. It behaved
the same as allocateContent except with a Twine input, rather than an
ArrayRef<char>. Renaming allocateString to allocateBuffer (overloading the
existing method) makes this clearer.

The new allocateCString methods allocate the given content plus a
null-terminator character, and return a buffer covering both the string and
null-terminator. This makes them suitable for creating c-string content for
jitlink::Blocks.

Existing users of the old allocateString method have been updated to use the
new allocateContent overload.
2023-02-11 12:05:28 -08:00
Lang Hames
9eccc6cce0 [JITLink] Add a predicate to test for C-string blocks. 2023-02-11 10:51:50 -08:00
Archibald Elliott
62c7f035b4 [NFC][TargetParser] Remove llvm/ADT/Triple.h
I also ran `git clang-format` to get the headers in the right order for
the new location, which has changed the order of other headers in two
files.
2023-02-07 12:39:46 +00:00
Lang Hames
d42c2352aa [JITLink] Ensure that in-flight alloc is abandoned on error in post-alloc phase.
If an error occurs during the post-allocation phase (JITLinkerBase::linkPhase2)
then we need to call JITLinkMemoryManager::InFlightAlloc::abandon so that the
allocation has a chance to clean up. This was already handled for later phases,
but we were skipping the abandon step when we bailed out of phase 2.
2023-02-01 18:04:57 -08:00
Kshitij Jain
cd9fd4255b [JITLink] Adds support for PLT based relocations to the ELF/i386 JITLink backend
This commit adds support for PLT based relocations. Specifically -
1. It adds logic to create a `PLTTableManager` in the `buildTables_ELF_i386`
function, which is called as part of the post-prune JITLink passes. The `PLTTableManager`
handles creating pointer jump stubs and related GOT entries for position independent
code.

2. It also adds a pre-fixup pass to optimize away PLT based calls in position independent
code, when possible.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D142846
2023-01-30 01:15:34 +00:00
Lang Hames
2667be0eb8 [JITLink][MachO] Error on N_EXT symbols with illegal string-table index 0.
Index 0 is reserved for anonymous symbols, which can't have the N_EXT bit
set (since N_EXT means non-local scope, and non-local scope requires a name).
2023-01-28 19:58:27 -08:00
Kazu Hirata
f6b8f05bb3 Use llvm::byteswap instead of ByteSwap_{16,32,64} (NFC) 2023-01-28 15:22:37 -08:00
wanglei
f10d452db8 Reland "[JITLink] Add an initial implementation of JITLink for ELF/LoongArch"
This implementation supports basic relocation types and adds EHFrame,
Got/Plt handling passes.
This patch also enables JIT support for LoongArch64.

With this patch, I successfully run hello.ll and simple_throw.ll
(which is generated from test-suite/SingleSource/Regression/C++/EH/simple_throw.cpp)
using the `lli` command with options `--jit-kind=orc --jit-linker=jitlink`.

Note: `hasJIT` property of LoongArch32 remains false as there is no
validation environment.

New changes: Since LoongArch does not support RuntimeDyld, JITLink is set
by default.  Add a null-terminator to eh-frame sections. This should fix
the test failure on LoongArch bot.
(https://lab.llvm.org/staging/#/builders/236/builds/896)

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D141036
2023-01-18 20:49:20 +08:00
wanglei
48c2172e51 Revert "[JITLink] Add an initial implementation of JITLink for ELF/LoongArch"
This reverts commit 28b6f38d0a841451af7b4893368543382dd5e630.

This breaks on LoongArch64 bot.
https://lab.llvm.org/staging/#/builders/236/builds/896
2023-01-18 16:53:37 +08:00
wanglei
28b6f38d0a [JITLink] Add an initial implementation of JITLink for ELF/LoongArch
This implementation supports basic relocation types and adds EHFrame,
Got/Plt handling passes.
This patch also enables JIT support for LoongArch64.

With this patch, I successfully run hello.ll and simple_throw.ll
(which is generated from test-suite/SingleSource/Regression/C++/EH/simple_throw.cpp)
using the `lli` command with options `--jit-kind=orc --jit-linker=jitlink`.

Note: `hasJIT` property of LoongArch32 remains false as there is no
validation environment.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D141036
2023-01-18 14:29:45 +08:00
NAKAMURA Takumi
78e3168c97 JITLink/ELF_i386.cpp: Fix a warning in D141746. [-Wswitch] 2023-01-14 15:13:32 +09:00
Kshitij Jain
a3e975d42e Fixes handling logic for i386/ELF GOTPC relocation
The i386/ELF JITLink backend was not correctly handling the GOTPC relocation
by skipping the in-built addend, which was manifesting itself in the form of
a segmentation fault in the `LF_external_to_absolute_conversion.s` test. This
CR has fixed that issue.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D141746
2023-01-14 05:01:49 +00:00
serge-sans-paille
07bb29d8ff
[OptTable] Precompute OptTable prefixes union table through tablegen
This avoid rediscovering this table when reading each options, providing
a sensible 2% speedup when processing and empty file, and a measurable
speedup on typical workloads, see:

This is optional, the legacy, on-the-fly, approach can still be used
through the GenericOptTable class, while the new one is used through
PrecomputedOptTable.

https://llvm-compile-time-tracker.com/compare.php?from=4da6cb3202817ee2897d6b690e4af950459caea4&to=19a492b704e8f5c1dea120b9c0d3859bd78796be&stat=instructions:u

Differential Revision: https://reviews.llvm.org/D140800
2023-01-12 12:08:06 +01:00
Jonas Hahnfeld
c8d43dca23 [JITLink][RISCV] Add R_RISCV_RVC_BRANCH and R_RISCV_RVC_JUMP
These are the compressed equivalents of the relocations R_RISCV_BRANCH
and R_RISCV_JAL with slightly more complex immediate handling.

Differential Revision: https://reviews.llvm.org/D140827
2023-01-04 13:51:15 +01:00
Jonas Hahnfeld
850adc1ddc [JITLink][RISCV] Homogenize immediate handling
Name the variables based on which part of the immediate value is
extracted, as it was already done for R_RISCV_JAL. This makes it
much easier to compare the logic with the spec.

Differential Revision: https://reviews.llvm.org/D140820
2023-01-03 17:18:39 +01:00
Jonas Hahnfeld
e7d432fd67 [JITLink][RISCV] Improve R_RISCV_JAL
Only take the lower 12 bits of RawInstr.

Differential Revision: https://reviews.llvm.org/D140820
2023-01-03 17:18:39 +01:00
Jonas Hahnfeld
6f539de735 [JITLink][RISCV] Order EdgeKind_riscv the same way as relocations
There were basically four different orderings: one defined by the
relocations, one by the enum definition of EdgeKind_riscv, one for
mapping the enum values to their names, and one when mapping the
relocations to edge kinds and finally processing them. Chose the
ordering defined by the relocations in the riscv-elf-psabi-doc as
the canonical one.

Differential Revision: https://reviews.llvm.org/D140802
2023-01-02 14:49:47 +01:00
luxufan
31000211e0 [JITLink][RISCV] Fix incorrectly use of uint32_t 2023-01-02 13:48:39 +08:00
serge-sans-paille
d9ab3e82f3
[clang] Use a StringRef instead of a raw char pointer to store builtin and call information
This avoids recomputing string length that is already known at compile time.

It has a slight impact on preprocessing / compile time, see

https://llvm-compile-time-tracker.com/compare.php?from=3f36d2d579d8b0e8824d9dd99bfa79f456858f88&to=e49640c507ddc6615b5e503144301c8e41f8f434&stat=instructions:u

This a recommit of e953ae5bbc313fd0cc980ce021d487e5b5199ea4 and the subsequent fixes caa713559bd38f337d7d35de35686775e8fb5175 and 06b90e2e9c991e211fecc97948e533320a825470.

The above patchset caused some version of GCC to take eons to compile clang/lib/Basic/Targets/AArch64.cpp, as spotted in aa171833ab0017d9732e82b8682c9848ab25ff9e.
The fix is to make BuiltinInfo tables a compilation unit static variable, instead of a private static variable.

Differential Revision: https://reviews.llvm.org/D139881
2022-12-27 09:55:19 +01:00
Vitaly Buka
aa171833ab Revert "[clang] Use a StringRef instead of a raw char pointer to store builtin and call information"
Revert "Fix lldb option handling since e953ae5bbc313fd0cc980ce021d487e5b5199ea4 (part 2)"
Revert "Fix lldb option handling since e953ae5bbc313fd0cc980ce021d487e5b5199ea4"

GCC build hangs on this bot https://lab.llvm.org/buildbot/#/builders/37/builds/19104
compiling CMakeFiles/obj.clangBasic.dir/Targets/AArch64.cpp.d

The bot uses GNU 11.3.0, but I can reproduce locally with gcc (Debian 12.2.0-3) 12.2.0.

This reverts commit caa713559bd38f337d7d35de35686775e8fb5175.
This reverts commit 06b90e2e9c991e211fecc97948e533320a825470.
This reverts commit e953ae5bbc313fd0cc980ce021d487e5b5199ea4.
2022-12-25 23:12:47 -08:00
Kshitij Jain
1b123d9fb5 Adds support for GOT relocations to i386/ELF backend
This CR adds support for GOT relocations to the JITLink i386/ELF backend.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D140279
2022-12-25 02:06:24 +00:00
serge-sans-paille
e953ae5bbc
[clang] Use a StringRef instead of a raw char pointer to store builtin and call information
This avoids recomputing string length that is already known at compile
time.

It has a slight impact on preprocessing / compile time, see

https://llvm-compile-time-tracker.com/compare.php?from=3f36d2d579d8b0e8824d9dd99bfa79f456858f88&to=e49640c507ddc6615b5e503144301c8e41f8f434&stat=instructions:u

This is a recommit of 719d98dfa841c522d8d452f0685e503538415a53 that into
account a GGC issue (probably
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92181) when dealing with
intiailizer_list and constant expressions.

Workaround this by avoiding initializer list, at the expense of a
temporary plain old array.

Differential Revision: https://reviews.llvm.org/D139881
2022-12-24 10:25:06 +01:00