<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82012>82012</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Compile python with bolt fails
</td>
</tr>
<tr>
<th>Labels</th>
<td>
BOLT
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Monallabs
</td>
</tr>
</table>
<pre>
I am compiling python with bolt optimizations on openbsd x86 machine.
Configured for compile using the command:
```bash
OPENSSL_LDFLAGS=-L/usr/local/lib; OPENSSL_LIBS="-lssl -lcrypto" OPENSSL_INCLUDES=-I/usr/local/include CFLAGS=-fPIC ./configure --enable-optimizations --with-lto --with-computed-gotos --with-system-ffi --with-openssl-rpath=auto --with-openssl=/usr/local --enable-shared --enable-bolt
```
But I get the error: `unable to disassemble instruction in PLT section .plt.sec at offset 0x3e` (see below:).
I am using llvm-project checkout out from this git repo.
```bash
# Ensure a pristine, pre-BOLT copy of the binary and no profile data from last run.
for bin in python libpython3.12.so.1.0; do \
prebolt="${bin}.prebolt"; \
if [ -e "${prebolt}" ]; then \
echo "Restoring pre-BOLT binary ${prebolt}"; \
mv "${bin}.prebolt" "${bin}"; \
fi; \
cp "${bin}" "${prebolt}"; \
rm -f ${bin}.bolt.*.fdata ${bin}.fdata; \
done
Restoring pre-BOLT binary python.prebolt
Restoring pre-BOLT binary libpython3.12.so.1.0.prebolt
# Instrument each binary.
for bin in python libpython3.12.so.1.0; do \
/home/kabiraatmonallabs/Execution/Runtime/build/bin/llvm-bolt "${bin}" -instrument -instrumentation-file-append-pid -instrumentation-file=/home/kabiraatmonallabs/Execution/Runtime/Python-3.12.2/${bin}.bolt -o ${bin}.bolt_inst ; \
mv "${bin}.bolt_inst" "${bin}"; \
done
BOLT-INFO: Target architecture: x86_64
BOLT-INFO: BOLT version: f55b79f59a77b4be586d649e9ced9f8667265011
BOLT-INFO: first alloc address is 0x200000
BOLT-INFO: creating new program header table at address 0x400000, 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: enabling -align-macro-fusion=all since no profile was specified
BOLT-INFO: enabling lite mode
BOLT-ERROR: unable to disassemble instruction in PLT section .plt.sec at offset 0x3e
gmake[1]: *** [Makefile:842: profile-bolt-stamp] Error 1
gmake[1]: Leaving directory '/home/kabiraatmonallabs/Execution/Runtime/Python-3.12.2'
gmake: *** [Makefile:871: bolt-opt] Error 2
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVttu4zgS_Rr6pUBBoi62H_zgSzww4EmCdA_2sUFJJYsTihRIKpf9-gUpXxLH3buL6cCxJbKqWId1eIrcWnFQiAuSr0i-mfDBtdos_tSKS8lLOyl1_b7YAe-g0l0vpFAH6N9dqxW8CtdCqaUD3TvRiX9zJ7SyoBXoHlVpa3ibFdDxqhUKIyDxhsTL8XutVSMOg8EaGm2OsREG6-O7Fv1Ix1VN0uXJr4jHT8ltOw7Bw-Pd_bdv-x_7zXa__OMbSTd0T9h2sIawrdQVl_5XlCRdXWx3K29IGKPSWglUVua9d5owdrbZ3a_3f23uQsDdl4BCVXKoEdbnRZvH3RoiwrbVCRZQioqXEunnvaHU7xqVTp8ePfTBYU0P2umzgX23DjvaNOI04rfUWklNz11L0g0fLjGOcwHWx2QvWdiW-70-v_uyXe3r-LoaHOzggC5UAY3RJtSgiIfgCU5DLSy3Fjv_KpR1Zqg8OhAKHvffweL4GvXSRRYr4A5001h0EL-lSIoYCJtZRChR6leSLgmbR-PygWkjC6R86Whv9N9YOaharJ714MD_N0Z34Fph4SAcGOz1Z3LdoAphKdwp6yvDoTfCOqGQsDX0BunqYf8dKt2_g24C7FIobt6BqxqUht7oxpOz5o6Pa0tuHZhBHZP2DC5FwH88GlKU41MaJSyyOkqi2JOw1kDy9ZG9vcFQhkBGwjIyXZVCkekmOs0w5p0uHiAa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