#复制依赖库.
for i in `cat bin_lib.txt`; do
for j in $i; do
list="$(ldd $j | awk -F " " ‘{print $3}‘|grep ‘.so‘)"
for k in $list; do
cp -n "$k" /png/pack/libs
done
done
done
#设置二进制和共享库的rpath和interpreter
for i in `cat bin_lib.txt`; do
/png/pack/patchelf --set-rpath /png/pack/libs --force-rpath $i
/png/pack/patchelf --set-interpreter /png/pack/libs/ld-linux-x86-64.so.2 $i
done
#打包库和修改后的程序
tar cJf /png/pack/png.tar.xz /png/pack/libs $PHP