Problem compiling GnuPG 1.4.18 on OS X 10.10, was: Problem compiling GnuPG 2.1.0 on OS X 10.10

Dave English dave at wiredthing.com
Mon Dec 1 13:13:02 CET 2014


> On 8 Nov 2014, at 18:04, Patrick Brunschwig <patrick at enigmail.net> wrote:
> 
> On 07.11.14 06:41, Ramsey Dow wrote:
>> Hello, I am having a build failure with GnuPG 2.1.0 on OS X 10.10 using Xcode 6.1's compiler tools.
>> 
>> I have successfully compiled and installed all of the prerequisite libraries (npth 1.1, libgpg-error 1.17, libksba 1.3.1, and libassuan 2.1.2). My build sequence is as follows:
>> 
>> gpg --verify $MRT/cache/gnupg-2.1.0.tar.bz2.sig
>> tar xjf $MRT/cache/gnupg-2.1.0.tar.bz2
>> pushd gnupg-2.1.0
>> ./configure --prefix=$MRTRT
>> make
>> 
>> The compilation fails while linking t-sexputil in common. Here are the last few lines of the build process:
>> 
>> gcc -DHAVE_CONFIG_H -I. -I..  -I../gl -I../intl -DLOCALEDIR=\"/Users/ramsey/Developer/MRT/runtime/share/locale\" -DGNUPG_BINDIR="\"/Users/ramsey/Developer/MRT/runtime/bin\"" -DGNUPG_LIBEXECDIR="\"/Users/ramsey/Developer/MRT/runtime/libexec\"" -DGNUPG_LIBDIR="\"/Users/ramsey/Developer/MRT/runtime/lib/gnupg\"" -DGNUPG_DATADIR="\"/Users/ramsey/Developer/MRT/runtime/share/gnupg\"" -DGNUPG_SYSCONFDIR="\"/Users/ramsey/Developer/MRT/runtime/etc/gnupg\"" -DGNUPG_LOCALSTATEDIR="\"/Users/ramsey/Developer/MRT/runtime/var\""        -I/Users/ramsey/Developer/MRT/runtime/include -I/Users/ramsey/Developer/MRT/runtime/include -I/Users/ramsey/Developer/MRT/runtime/include -g -O2 -Wall -Wno-pointer-sign -Wpointer-arith -MT t-sexputil.o -MD -MP -MF .deps/t-sexputil.Tpo -c -o t-sexputil.o t-sexputil.c
>> mv -f .deps/t-sexputil.Tpo .deps/t-sexputil.Po
>> gcc -I/Users/ramsey/Developer/MRT/runtime/include -I/Users/ramsey/Developer/MRT/runtime/include -I/Users/ramsey/Developer/MRT/runtime/include -g -O2 -Wall -Wno-pointer-sign -Wpointer-arith   -o t-sexputil t-sexputil.o libcommon.a ../gl/libgnu.a -L/Users/ramsey/Developer/MRT/runtime/lib -lgcrypt -lgpg-error -lassuan -L/Users/ramsey/Developer/MRT/runtime/lib -lgpg-error -L/Users/ramsey/Developer/MRT/runtime/lib -lgpg-error  -liconv
>> Undefined symbols for architecture x86_64:
>>  "_default_errsource", referenced from:
>>      _parse_ber_header in libcommon.a(libcommon_a-tlv.o)
>>      _parse_sexp in libcommon.a(libcommon_a-tlv.o)
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>> make[3]: *** [t-sexputil] Error 1
>> make[2]: *** [all] Error 2
>> make[1]: *** [all-recursive] Error 1
>> make: *** [all] Error 2
>> 
>> I'm not sure why this error is occurring, which is why I am reporting it here, per instructions in the README. Am I forgetting to specify an option to configure? Is the configuration subsystem missing something about my system's setup? Please advise. I'm happy to provide any other details if necessary.
> 
> You'll need to apply the following patch for compiling GnuPG (the patch
> is made to be applied before ./configure is executed):
> 
> <https://sourceforge.net/p/gpgosx/source/ci/master/tree/patches/makefile.patch>
> 
> And most likely, you'll run into another build error in dirmgr. This can
> be fixed by editing dirmgr/Makefile and deleting "-R/path/to/somewhere"
> from LDFLAGS
> 
> -Patrick

I see that problem has since been fixed.

I have though what looks like the same problem trying to build 1.4.18 from source on Mac OS X 10.10, according to the howto Version 4.26 (1 July 2014):

http://macgpg.sourceforge.net/docs/howto-build-gpg-osx.txt.asc

This fails for me with:

gcc  -arch x86_64 -Wall -Wno-pointer-sign   -o gpg gpg.o build-packet.o compress.o compress-bz2.o free-packet.o getkey.o keydb.o keyring.o seskey.o kbnode.o mainproc.o armor.o mdfilter.o textfilter.o progress.o misc.o openfile.o keyid.o parse-packet.o status.o plaintext.o sig-check.o keylist.o signal.o cardglue.o tlv.o card-util.o app-openpgp.o iso7816.o apdu.o ccid-driver.o pkclist.o skclist.o pubkey-enc.o passphrase.o seckey-cert.o encr-data.o cipher.o encode.o sign.o verify.o revoke.o decrypt.o keyedit.o dearmor.o import.o export.o trustdb.o tdbdump.o tdbio.o delkey.o keygen.o pipemode.o helptext.o keyserver.o photoid.o exec.o ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a -liconv -lresolv ../intl/libintl.a -liconv  -Wl,-framework -Wl,CoreFoundation  -lz -lbz2     -L/opt/local/lib -lusb
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _native_to_utf8 in libutil.a(strgutil.o)
      _utf8_to_native in libutil.a(strgutil.o)
      __nl_find_msg in libintl.a(dcigettext.o)
  "_iconv_close", referenced from:
      _native_to_utf8 in libutil.a(strgutil.o)
      _set_native_charset in libutil.a(strgutil.o)
      _utf8_to_native in libutil.a(strgutil.o)
  "_iconv_open", referenced from:
      _native_to_utf8 in libutil.a(strgutil.o)
      _set_native_charset in libutil.a(strgutil.o)
      _utf8_to_native in libutil.a(strgutil.o)
      __nl_find_msg in libintl.a(dcigettext.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [gpg] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

My compiler is:

$ clang -v
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

I’m not sure how to patch the make files suitably for a GnuPG version 1 build.

TIA

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: </pipermail/attachments/20141201/e4b1b231/attachment-0001.sig>


More information about the Gnupg-users mailing list