<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99772>99772</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llvm-bolt] `--runtime-instrumentation-lib` option can't correctly specify the path of instrumentation library
</td>
</tr>
<tr>
<th>Labels</th>
<td>
BOLT
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
lltsdyp
</td>
</tr>
</table>
<pre>
```
$>llvm-bolt ./a.out -instrument -o a.tmp --runtime-instrumentation-lib=$HOME/bin/bolt/lib~/bolt-lib/libbolt_rt_instr.a
BOLT-INFO: Target architecture: aarch64
BOLT-INFO: BOLT version: e6c3289804a67ea0bb6a86fadbe454dd93b8d855
BOLT-INFO: first alloc address is 0x400000
BOLT-INFO: creating new program header table at address 0x600000, offset 0x200000
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: 1
BOLT-INSTRUMENTER: Number of indirect call target descriptors: 10
BOLT-INSTRUMENTER: Number of function descriptors: 9
BOLT-INSTRUMENTER: Number of branch counters: 3
BOLT-INSTRUMENTER: Number of ST leaf node counters: 11
BOLT-INSTRUMENTER: Number of direct call counters: 0
BOLT-INSTRUMENTER: Total number of counters: 14
BOLT-INSTRUMENTER: Total size of counters: 112 bytes (static alloc memory)
BOLT-INSTRUMENTER: Total size of string table emitted: 215 bytes in file
BOLT-INSTRUMENTER: Total size of descriptors: 1128 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 0xa00000 to accommodate hot text
BOLT-ERROR: library not found: /home/lib~/bolt-lib/$HOME/bin/bolt/lib~/bolt-lib/libbolt_rt_instr.a
```
As you can see, I want `llvm-bolt` to use instrumentation library: `$HOME/bin/bolt/lib~/bolt-lib/libbolt_rt_instr.a` but it searched for `/home/lib~/bolt-lib/$HOME/bin/bolt/lib~/bolt-lib/libbolt_rt_instr.a` and failed.
I think there must be something wrong when processing command line options?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vt1u2zoSfhr6ZiCDomVZvvBFu4mxAbbNIsleFxQ5sthSpECOHHsvzrMfkHbSJPVpg1OcIFDCn_nm75sZyhjNziFu2PIjW17N5ES9DxtrKerjOGu9Pm5Yzc-__IrxD0xUbHFt7X4oWm8J5kxs5dxPBIVxkcI0oCMoPMg5DSMURZgcmQFfnEoy3hXWtGxxxUT179tP10xsW-PS11tiYmtN-8d5lS_mnbT6EuhLRprLkz0fb__zUNx83t6yxQd4kGGHBDKo3hAqmgKmbZk26uqCQFrAHkM03qU11mohmnXDK1mvUPK2rWVTd1K3WC0rrdeLttHNcnkBqjMhEkhrvQKpdcAYwUTgh4qnnwsSKqAk43bg8BHG4HdBDtCj1BiAZGsRJD1D8UN9whH_At91EQn4QfwVNDrZ2gQd0HqVAw6D13jJbh9Uull8nYaxyHojW1wNfo_pDN7k7QKCNvGsrZDW7FwxSBV80U0pquAdOO-KQ1PDaCV1PgwXMNw0tBjAdxAwqdZgjfuGIdEGA6GGPTrEENPlSx5zSBz0HZQCusmpZGsE44B6hNY4GY7ARMPnnIklE2vo5R6zZTiMdAQ8oJpynMbgO2Nfh-r-4e5_n64_P1zfJV2fn401TpuAikBJayEaQtAYVTAj-ZOt5d_AoRON3yLxd0E9Of9WfP0u6TZIp3pQfnJ0jvbiXYL3D2BRduC8xlfi5fsi8NL_l-I_c_rBk7QvqPNKbfVLwWj-jz-IlQLaI2FMZImJ8upc0wMOPhyZ-FkcX-NGCqkoTqWMgyFCnW6JcnnWYR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