<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61289>61289</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
JIT unable to find symbols from libc_nonshared.a
</td>
</tr>
<tr>
<th>Labels</th>
<td>
orcjit
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hahnjo
</td>
</tr>
</table>
<pre>
Right now, the JIT seems to be unable to find symbols from the static `libc_nonshared.a`, that is linked together with `libc.so`. Until ~2020, this library contained a number of wrappers, including the `*stat` functions. On these systems, for example EL 8 but also not-latest Ubuntus, the following C code:
```c
#include <sys/stat.h>
int main() {
struct stat s;
lstat("build.ninja", &s);
return 0;
}
```
when compiled into IR and then fed to `lli` fails with:
```
JIT session error: Symbols not found: [ lstat ]
./bin/lli: Failed to materialize symbols: { (main, { main }) }
```
The good news is that recent glibc heavily reduced the number of symbols in that static library, up to the point that it only contains `at_quick_exit`, `atexit`, `pthread_atfork`, and `__stack_chk_fail_local`. It would be nice to improve the situation for older systems, but not sure if we can do much about it...
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VN1u4zYTfRr6ZhBBIeMfXegiP2sgHz6gwHb32qDIkcWE4rjkMF73os9ekHLSdFsUMGTPeEY8c-Yc6pTcMSD2Yv0g1k8rnXmi2E96Ci-0Gshe-q_uODEEOgv5CDwh_O_5GyTEOQETDAg56MFjCUYXLKTLPJBPMEaaa31izc6A2LTeDeYQKKRJR7SNFpt2ealmcAm8C69ogemIPGGEs-Ppva1JJDZtA98DOw9_yFZeW2vfEHW8gKHA2gW0oCHkecAINMI56tMJYyrlLhifrQvHCqwef1_giU0LYw6GHYXUwC-h_J8Q0iUxzrV1pAj4Q88nj_Dl_7CDITNonwgC8Y3XjInh-5AD5_TO1Eje07kc9wiGLAp1L9on0d6Xk-vHXGOpFmgIQj2mSxJyX3A1k1BfriX16QLDrF0QcidkB2L7sOQB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