2013-02-05 31 views
0

我试图通过在我自己的机器(运行Arch Linux)上使用相同的处理器体系结构(x86_64)静态构建git在共享服务器上(没有root访问权限或编译器) )作为服务器,如this guide中所述。在静态Git中链接未定义的参考

当我跑make,我总是有这些错误和失败:

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': 
(.text+0x19): undefined reference to `dlopen' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': 
(.text+0x2c): undefined reference to `dlsym' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': 
(.text+0x37): undefined reference to `dlclose' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func': 
(.text+0x364): undefined reference to `dlsym' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func': 
(.text+0x422): undefined reference to `dlerror' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var': 
(.text+0x494): undefined reference to `dlsym' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var': 
(.text+0x552): undefined reference to `dlerror' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load': 
(.text+0x5c2): undefined reference to `dlopen' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load': 
(.text+0x62d): undefined reference to `dlclose' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load': 
(.text+0x65a): undefined reference to `dlerror' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr': 
(.text+0x6ef): undefined reference to `dladdr' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr': 
(.text+0x749): undefined reference to `dlerror' 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload': 
(.text+0x7aa): undefined reference to `dlclose' 
collect2: error: ld returned 1 exit status 
make: *** [git-imap-send] Error 1 
+0

日志不显示实际的命令是没有用的除外。下次你应该使用'make V = 1'。另请注意,有关静态链接和glibc的警告。你的二进制文件可能不适用于不同的系统 – wRAR

回答

1

我终于发现了a different guide,它建议运行一个稍微不同的.configure命令。什么结束了,我的工作是this guide,在步骤运行

$ ./configure --prefix=/home/myuser/git-static CFLAGS="${CFLAGS} -static" NO_OPENSSL=1 NO_CURL=1

2.

0

该错误消息表示无法找到的

dlclose 
dlerror 
dleopen 

你需要确保你的定义链接应用程序时,makefile有-ldl

+0

我以前试图加入 LDFLAGS = -ldl ,但我得到了同样的结果。 –

+0

是的,我明白了,但它在你的makefile中? – billz

0

LDFLAGS是链接器标志。 LIBS用于链接库。混淆它们通常不是问题,但对于静态库,或者当链接器启用了选项时,在使用它的库之前,库函数顺序和任何-l都会被忽略。