背景:
黑鸭子扫描发现某基线里的libxml.so文件有问题,需要从libxml2.7.4升级到libxml2.9.9。
搜索途径:
搜点到libxml2.9.9的压缩包(官网):
ftp://xmlsoft.org/libxml2/
http://xmlsoft.org/bugs.html
2019年1月3日发布,5.2M, libxml2-2.9.9.tar.gz
将libxml2-2.9.9.tar.gz解压到任目录(tar -xzvf libxml2-2.9.9.tar.gz)。
64位编译:
编译64位libxml2.so.2.9.9执行
./configure --without-python;make
或者
./configure --without-python --without-zlib;make
32位编译
编译32位libxml2.so.2.9.9执行
export CFLAGS=-m32; export LDFLAGS=-m32;./configure --without-python --without-zlib;make
编译命令里的参数由来:
#####:~/libxml2-2.9.9> configure --help
Optional Packages:
--with-python[=DIR] build Python bindings if found
--with-zlib[=DIR] use libz in DIR
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
编译生成内容:
编译成功后,从/libxml2-2.9.9/.libs可以看到当前时刻生成的库文件
####:~/libxml2-2.9.9/.libs> ls -l | grep libxml
-rw-r--r-- 1 proto33 users 7818426 09-16 15:25 libxml2.a
lrwxrwxrwx 1 proto33 users 13 09-16 15:25 libxml2.la -> ../libxml2.la
-rw-r--r-- 1 proto33 users 939 09-16 15:25 libxml2.lai
lrwxrwxrwx 1 proto33 users 16 09-16 15:25 libxml2.so -> libxml2.so.2.9.9
lrwxrwxrwx 1 proto33 users 16 09-16 15:25 libxml2.so.2 -> libxml2.so.2.9.9
-rwxr-xr-x 1 proto33 users 4620799 09-16 15:25 libxml2.so.2.9.9