I'm Trying to make my executable portable on linux, to do this i need to copy all the shared library used by the program itself, to check which one do I need I use:
ldd program_name
The output of the program helps me find all the required .so
, between these libraries there is:
libc.so.6 => /lib64/libc.so.6 (0x00007f5b61ac2000)
At this point I copied all the libraries in a folder called shared_libs
and shipped them alongside the program to another pc, the problem arise when i do:
LD_LIBRARY_PATH=./shared_libs ./program_name
which gives:
[1] 4619 segmentation fault (core dumped) LD_LIBRARY_PATH=./shared_libs ./program_name
I'm pretty sure that libc.so.6 is causing the problem because if I do:
LD_LIBRARY_PATH=./shared_libs ls
with just that library in the shared_libs folder, ls
gives seg fault as well.
How can i bundle my application?
EDIT 1: Why i don't link statically everything?
I tried it, The only thing i got was headache...