Error building GnuPG modern 2.1.0 on Yosemite

Patrick Brunschwig patrick at enigmail.net
Mon Nov 10 08:30:04 CET 2014


Apply this patch before doing ./configure and it will build OK:

<https://sourceforge.net/p/gpgosx/source/ci/master/tree/patches/makefile.patch>

-Patrick

On 09.11.14 22:56, Mel Brands wrote:
> Werner, 
> 
> Thank you! Patching with -p1 fixed the compilation issue but now I've
> run into a linking issue (I'm using the latest libgpg-error 1.17). 
> 
> This is the error that occurs near the very end:
> 
> ------------
> gcc -I/usr/local/include -I/usr/local/include -I/usr/local/include -g
> -O2 -Wall -Wno-pointer-sign -Wpointer-arith   -o t-sexputil t-sexputil.o
> libcommon.a ../gl/libgnu.a -L/usr/local/lib -lgcrypt -lgpg-error
> -lassuan -L/usr/local/lib -lgpg-error -L/usr/local/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
> collect2: ld returned 1 exit status
> make[3]: *** [t-sexputil] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> --------------
> 
> According to this post, using a "stable" libgpg-error used to fix this
> issue back in the
> May: http://lists.gnupg.org/pipermail/gnupg-users/2014-May/049786.html
> 
> I've tried Libgpg-error 1.16/1.17 and they have all failed to link
> properly with Gnupg 2.1.0. Libgpg-error 1.16/1.17 gives identical errors
> as the one above and 1.15 itself fails to compile with the following:
> 
> -----------
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I..
> -DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -Wall -Wpointer-arith -MT
> libgpg_error_la-estream.lo -MD -MP -MF .deps/libgpg_error_la-estream.Tpo
> -c estream.c  -fno-common -DPIC -o .libs/libgpg_error_la-estream.o
> estream.c:3502: error: conflicting types for '_gpgrt_fseeko'
> gpgrt-int.h:108: error: previous declaration of '_gpgrt_fseeko' was here
> estream.c:3528: error: conflicting types for '_gpgrt_ftello'
> gpgrt-int.h:110: error: previous declaration of '_gpgrt_ftello' was here
> make[3]: *** [libgpg_error_la-estream.lo] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> -------------
> 
> Thanks for any insight!
> 
> Mel
> 
> PS: To answer Patrick Brunschwig, I'm using Xcode 6.1 on OS X 10.10
>  (everything's updated to the latest versions available).
> 
> On Fri, Nov 7, 2014 at 1:44 AM, Werner Koch <wk at gnupg.org
> <mailto:wk at gnupg.org>> wrote:
> 
>     On Thu,  6 Nov 2014 19:37, bighype at gmail.com
>     <mailto:bighype at gmail.com> said:
> 
>     > I tried to compile 2.1.0 today and ran into an issue. I have the
>     > latest autoconf/m4/gnu toolchain and all of the latest libraries that
>     > GnuPG needs.
> 
>     It is kind of funny that GnuPG as most autoconf enabled programs build
>     fine on so many Unix platform but not on OS X we should be a modern
>     Unix.
> 
>     One of the reasons might be that GnuPG uses a small part of gnulib (gl/)
>     but does not follow all the gnulib updates to avoid regressions.
> 
>     > ../gl/stdint.h:62:31: error: _types/_intmax_t.h: No such file or directory
>     > ../gl/stdint.h:63:32: error: _types/_uintmax_t.h: No such file or directory
> 
>     This problem seems to cause by the hack below.  We hoped that this would
>     fix the problems but obviously it didn't on all machines.  You may try
>     to revert that patch.
> 
>     For 2.0.1 I'd really like to get access to a decent OS X box to test the
>     build before releasing it.
> 
> 
>     Salam-Shalom,
> 
>        Werner
> 
> 
>     commit f5592fcff308007322a201c970a6d5e8763c9fe3
>     Author: Werner Koch <wk at gnupg.org <mailto:wk at gnupg.org>>
>     Date:   Wed Oct 29 15:41:28 2014 +0100
> 
>         Fix stdint.h problem for Apple.
> 
>         * gl/stdint_.h [__APPLE__]: Include hack.
>         --
> 
>         Patch suggested by Patrick Brunschwig.
> 
>             Modified   gl/stdint_.h
>     diff --git a/gl/stdint_.h b/gl/stdint_.h
>     index 19577e7..1118e8d 100644
>     --- a/gl/stdint_.h
>     +++ b/gl/stdint_.h
>     @@ -55,6 +55,13 @@
>      # include @ABSOLUTE_STDINT_H@
>      #endif
> 
>     +#ifdef __APPLE__
>     +  /* Apple's implementation of <stdint.h> is bugy; we therefore use
>     +     the source definitions.  */
>     +# include <_types/_intmax_t.h>
>     +# include <_types/_uintmax_t.h>
>     +#endif
>     +
>      /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
>         IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
>         MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
> 
> 
> 
>     --
>     Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
> 
> 
> 
> 
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 




More information about the Gnupg-users mailing list