【发布时间】:2014-11-29 12:03:55
【问题描述】:
在尝试构建最新的 GnuPG (2.1.1 modern) 时,尝试链接 t-stringhelp 时我的构建失败。 make 输出:
ld: warning: ignoring file libcommon.a, file was built for archive which is not the architecture being linked (x86_64): libcommon.a
Undefined symbols for architecture x86_64:
"_compare_filenames", referenced from:
_main in t-stringhelp.o
"_make_absfilename_try", referenced from:
_main in t-stringhelp.o
"_make_filename_try", referenced from:
_main in t-stringhelp.o
"_percent_escape", referenced from:
_main in t-stringhelp.o
"_strconcat", referenced from:
_main in t-stringhelp.o
"_xstrconcat", referenced from:
_main in t-stringhelp.o
我不知道如何解决这个问题,因为libcommon 是源代码的一部分,所以它应该可以正常构建。当使用CFLAGS="-m64" 构建时(-arch x86_64 什么都不做),我得到了这个:
ld: warning: ignoring file ../common/libgpgrl.a, file was built for archive which is not the architecture being linked (x86_64): ../common/libgpgrl.a
Undefined symbols for architecture x86_64:
"_gnupg_rl_initialize", referenced from:
_main in gpg.o
除了pinentry之外,我还重建了所有的depandancies(就像我在Mavericks上构建的那样),因为它找不到同样安装的libiconv。我的configure 输出它的目标是Darwin (x86_64-apple-darwin14.0.0),所以这应该可以工作。我还获得了所有最新的先决条件,尝试将所有内容安装在自己的目录中(--prefix=/usr/local/gnupg-2.1.1),将所有依赖项和 GnuPG 构建为 32 位(再次,同样的错误失败),创建了一个单独的构建文件夹并尝试在其中构建,但到目前为止只有一件事解决了错误:查看 libgpgrl.a 是如何构建的 - 它唯一的组件是 common/gpgrlhelp.c - 所以我 cd'ed进入g10 并尝试构建gpg2,将../common/libgpgrl.a 替换为../common/gpgrlhelp.o,lib common.a 及其所有目标文件,用于所有不起作用的库。然后有些程序没有链接到libksbalibgcrypt和libassuan,所以我更改了Makefile,以便它们可以链接。我现在可以很好地编译所有代码,我安装了所有东西,但是当我尝试运行 gpg2 时出现新错误:
dyld: lazy symbol binding failed: Symbol not found: __gcry_mpi_init
Referenced from: /usr/local/gnupg-2.1.1/lib/libgcrypt.20.dylib
Expected in: flat namespace
dyld: Symbol not found: __gcry_mpi_init
Referenced from: /usr/local/gnupg-2.1.1/lib/libgcrypt.20.dylib
Expected in: flat namespace
我的道路上有一切,那就是:
/usr/local/gnupg-2.1.1/bin:/usr/local/gnupg-2.1.1/lib:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
我可以在 Mavericks 上编译 GnuPG-2.0.22,但没有任何版本的 GnuPG 在 Yosemite 上构建。
请帮忙,我真的很困惑。
【问题讨论】:
标签: macos x86-64 gnupg build-error unix-ar