这在 Ubuntu 12.10/amd64 上对我有用:
# be sure to build static versions of all included libraries
$ ./configure --enable-static
$ make
$ cd hw/vfb
$ make clean
# this provides static versions of some functions which are dynamic only in eglibc
$ sudo apt-get install libtirpc-dev
# LDFLAGS=-all-static asks libtool to do static linking
# LD_EXPORT_SYMBOLS_FLAGS= causes --export-dynamic to be omitted
# LIBS='...' fills in missing dependencies for static libraries
$ make LDFLAGS=-all-static LD_EXPORT_SYMBOLS_FLAG= LIBS='-lfreetype -lgpg-error -lfontenc -ltirpc -lz -lbz2 -lm -lrt -lpthread'
这有点像黑客,原因有两个:
它对库依赖项进行硬编码(在其他版本的 X 中可能会更改)
它引入了对 libtirpc 的奇怪依赖。没有它,我得到了 xdrmem_create(3) 的未解析符号以及动态链接时 libnsl 提供的其他一些东西:
/tmp/xorg-server-1.13.0/os/rpcauth.c:79: undefined reference to `xdrmem_create'