kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

binutils(含as、ld等)静态编译

binutils下载 http://ftp.gnu.org/gnu/binutils/

binutils静态编译:

1
2
./configure
make LDFLAGS=-all-static
原因:

他们链接的时候是通过 ./libtool 完成的,在libtool里有一行提示(./libtool –help没有显示这个提示):

1
-all-static       do not do any dynamic linking at all

所以就是要libtool增加-all-static参数

比较通用的静态编译方法

1
2
3
4
5
./configure 后加   CFLAGS=-static --enable-static LDFLAGS=-static --disable-shared
./configure 后加   CFLAGS=-static LDFLAGS=-static
make CFLAGS=-static LDFLAGS=-static