<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79414>79414</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
bolt on simple aarch64 so failed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
BOLT
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
miz2019
</td>
</tr>
</table>
<pre>
test on latest llvm and bolt main brach 2024/1/24
```
15:12:00 ubuntu@.81.1.1 ~/work/llvm $ soft/bin/llvm-bolt test/bolt/t1/a.so -instrument -o test/bolt/t1/a.inst.so
BOLT-INFO: shared object or position-independent executable detected
BOLT-INFO: Target architecture: aarch64
BOLT-INFO: BOLT version: 78b00c116be8b3b53ff13552e31eb305b11cb169
BOLT-INFO: first alloc address is 0x0
BOLT-INFO: creating new program header table at address 0x200000, offset 0x200000
BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.
BOLT-INFO: enabling relocation mode
BOLT-INFO: forcing -jump-tables=move for instrumentation
BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
BOLT-INFO: number of removed linker-inserted veneers: 0
BOLT-INFO: 0 out of 12 functions in the binary (0.0%) have non-empty execution profile
BOLT-INSTRUMENTER: Number of indirect call site descriptors: 0
BOLT-INSTRUMENTER: Number of indirect call target descriptors: 9
BOLT-INSTRUMENTER: Number of function descriptors: 9
BOLT-INSTRUMENTER: Number of branch counters: 45
BOLT-INSTRUMENTER: Number of ST leaf node counters: 34
BOLT-INSTRUMENTER: Number of direct call counters: 131
BOLT-INSTRUMENTER: Total number of counters: 210
BOLT-INSTRUMENTER: Total size of counters: 1680 bytes (static alloc memory)
BOLT-INSTRUMENTER: Total size of string table emitted: 1564 bytes in file
BOLT-INSTRUMENTER: Total size of descriptors: 8772 bytes in file
BOLT-INSTRUMENTER: Profile will be saved to file /tmp/prof.fdata
BOLT-INFO: Starting stub-insertion pass
BOLT-INFO: Inserted 0 stubs in the hot area and 0 stubs in the cold area. Shared 0 times, iterated 1 times.
BOLT-INFO: padding code to 0x600000 to accommodate hot text
BOLT-ERROR: linking object with arch x86_64 into context with arch aarch64
```
linking x86 to aarch64?
the a.so is a pure aarch64 so binary
```
///error function
void JITLinkLinker::loadObject(MemoryBufferRef Obj,
SectionsMapper MapSections) {
auto LG = jitlink::createLinkGraphFromObject(Obj);
if (auto E = LG.takeError()) {
errs() << "BOLT-ERROR: JITLink failed: " << E << '\n';
exit(1);
}
if ((*LG)->getTargetTriple().getArch() != BC.TheTriple->getArch()) {
errs() << "BOLT-ERROR: linking object with arch "
<< (*LG)->getTargetTriple().getArchName()
<< " into context with arch " << BC.TheTriple->getArchName() << "\n";
exit(1);
}
auto Ctx = std::make_unique<Context>(*this, MapSections);
jitlink::link(std::move(*LG), std::move(Ctx));
}
```
with llvm config
```
cmake -S llvm-project/llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS="bolt" -DCMAKE_INSTALL_PREFIX=`pwd`/soft -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON
```
Is there something miss?
Thanks
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycV0lv4zoS_jX0pSBDorwefHC8BHnjOI3EPcspoKSSxY5Eakgq7X6H-e2DouQtcOcFzzC8kFVffVWsRRTWyr1CnLHhHRsue6JxhTazSv7Jw2jaS3T2a-bQOtAKSuF_leV7BUJlkOjSQSWkgsSItAAe8gHj64jxNR-wcMnCefc5Cru3_xsNWTyPOIvnYQhN0ijXsEHYn0T9qB_B_xhf_9TmjfG1t8T4AKzOHePrRKpuNfC2iQ4t65K-HBkWfashkMo601SoHAT6thiJ9K1uGd09bXbBw3b9xOI52EIYzEAnPzB1oA3U2kontQqkyrBGlREuHjBtnEhKhAwdpg6zG1g7YfboQJi0kCTUGKRlQQujwQ0F-gPvaKzUiv6PJ0kYplE0SnCSxMkwzvMoHg45xhEmcThMoihNotH0BlQujXUgylKnILLMoLU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