技术解析
今天打算在树莓派上编译一个 hostapd 给安卓机用,结果发现里面没有 /configure 脚本,只有 Makefile。
我编译一下,然后用 file 命令看了一下,是动态的二进制文件。
linux-vdso.so.1 => (0x00007ffec77ce000)
librt.so.1 => /lib64/librt.so.1 (0x00007f782ab23000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007f782a8b1000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f782a450000)
libc.so.6 => /lib64/libc.so.6 (0x00007f782a08d000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f7829e71000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f7829c24000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f782993c000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f7829738000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f7829505000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f7829301000)
libz.so.1 => /lib64/libz.so.1 (0x00007f78290eb000)
/lib64/ld-linux-x86-64.so.2 (0x00007f782ad2b000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f7828edd000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f7828cd9000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f7828abf000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f7828898000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f7828636000)
由于安卓机没有这些库文件,所以不能使用动态库。有什么方法可以强制将它编译成静态二进制文件吗?
我对 Linux 开发完全不懂,谢谢了!