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:
#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...
Right now, the JIT seems to be unable to find symbols from the static
libc_nonshared.a, that is linked together withlibc.so. Until ~2020, this library contained a number of wrappers, including the*statfunctions. On these systems, for example EL 8 but also not-latest Ubuntus, the following C code:when compiled into IR and then fed to
llifails with: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...