I have to build my program on CentOS 7 and deploy on other Linux machine. The program required newer version glibc
, and some library which was not (and will not be) installed on target machine. So I decided to ship the executable with dynamic library. I used patchelf
to patch interpreter
and rpath
.
I tested the executable on my machine and it work (also checked with ldd
to make sure new rpath is used). But when I copy to other machine with libs, the program is failed to run. Only this line was printed:
Illegal instruction
Update:
Binary
So the SIGILL was caused by
shlx
instruction in __tls_init()
function. I don't know which library provide this function, I'm not sure it is from glibc.
I removed my glibc, which coppied from another computer and use glibc already installed on target computer, but the problem was not fixed.