Compiling from GIT fails

:~/gpg4win$ ./autogen.sh
*** Activating trailing whitespace git pre-commit hook. ***
For more information see this thread:
http://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084html
To deactivate this pre-commit hook again move .git/hooks/pre-commit
and .git/hooks/pre-commit.sample out of the way.
‘build-aux/git-hooks/pre-commit’ → ‘.git/hooks/pre-commit’
*** Adding GIT filter.cleanpo.clean configuration.
*** Activating commit log message check hook. ***
‘build-aux/git-hooks/commit-msg’ → ‘.git/hooks/commit-msg’
Running aclocal -I m4 …
Running autoheader…
Running automake --gnu …
configure.ac:79: warning: The ‘AM_PROG_MKDIR_P’ macro is deprecated, and its use is discouraged.
configure.ac:79: You should use the Autoconf-provided ‘AC_PROG_MKDIR_P’ macro instead,
configure.ac:79: and use ‘$(MKDIR_P)’ instead of '$(mkdir_p)'in your Makefile.am files.
Running autoconf …
You may now run “./autogen.sh --build-w32 && make”.
Press any key to continue…

:~/gpg4win$ ./autogen.sh --build-w32
Using /home/MyUser/w32root as standard install directory
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
/home/MyUser/gpg4win/missing: Unknown --is-lightweight' option Try /home/MyUser/gpg4win/missing --help’ for more information
configure: WARNING: ‘missing’ script is too old or missing
checking for i686-w64-mingw32-strip… i686-w64-mingw32-strip
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking whether UID ‘1007’ is supported by ustar format… yes
checking whether GID ‘1007’ is supported by ustar format… yes
checking how to create a ustar tar archive… gnutar
checking whether to enable maintainer-specific portions of Makefiles… yes
checking build system type… x86_64-unknown-linux-gnu
checking host system type… i686-w64-mingw32
checking whether NLS is requested… yes
checking for msgfmt… /usr/bin/msgfmt
checking for gmsgfmt… /usr/bin/msgfmt
checking for xgettext… /usr/bin/xgettext
checking for msgmerge… /usr/bin/msgmerge
checking for i686-w64-mingw32-gcc… i686-w64-mingw32-gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.exe
checking for suffix of executables… .exe
checking whether we are cross compiling… yes
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether i686-w64-mingw32-gcc accepts -g… yes
checking for i686-w64-mingw32-gcc option to accept ISO C89… none needed
checking whether i686-w64-mingw32-gcc understands -c and -o together… yes
checking for style of include used by make… GNU
checking dependency style of i686-w64-mingw32-gcc… gcc3
checking how to run the C preprocessor… i686-w64-mingw32-gcc -E
checking for i686-w64-mingw32-ranlib… i686-w64-mingw32-ranlib
checking for i686-w64-mingw32-ar… i686-w64-mingw32-ar
checking for i686-w64-mingw32-strip… (cached) i686-w64-mingw32-strip
checking for i686-w64-mingw32-dlltool… i686-w64-mingw32-dlltool
checking for make… make
checking for unzip… unzip
checking for tar… tar
checking for mkdir… mkdir
checking for cp… cp
checking for rm… rm
checking for stow… stow
checking for makensis… makensis
checking for zcat… zcat
checking for texi2dvi… texi2dvi
checking for dvipdf… dvipdf
checking for convert… convert
checking for sha1sum… sha1sum
checking for msgfmt… /usr/bin/msgfmt
checking for gitlog-to-changelog… no
checking for gcc… gcc
checking for i686-w64-mingw32-x86_64-w64-mingw32-strip… no
checking for x86_64-w64-mingw32-strip… x86_64-w64-mingw32-strip
configure: WARNING: using cross tools not prefixed with host triplet
configure: Using autodetected 2 make jobs. You can override this by setting GPG4WIN_PARALLEL.
configure: error: can not find the runtime library libgcc_s_sjlj-1.dll in the default locations.
Use the --with-libgcc_s_sjlj-1 option to set the path directly.

I also just realised that the packager download pulls the previous (2.1.15) version of gnupg instead of the most current (2.1.16).

As a second note I should mention that the instructions here are a tad wrong. Just a simple typo, though.

https://www.gpg4win.org/build-installer-gnulinux.html

Tas 4 is missing a few letters.

If you work with the GIT version:
$ ./autogen.sh
$ ./autogen --build-w32
else:
$ ./autogen --build-w32

Should probably be:

If you work with the GIT version:
$ ./autogen.sh
$ ./autogen.sh --build-w32
else:
$ ./autogen.sh --build-w32

Following the workaround from this post the preparation completes.
https://wald.intevation.org/forum/message.php?msg_id=4687&group_id=11

Like this.
./autogen.sh --build-w32 --with-libgcc_s_sjlj-1=/dev/null --with-libstdc+±6=dev/null

However, as I mentioned before, download.sh still pulls old gnupg files.
I updated it with new zlip and libpng, and will now edit in gnupg 2.1.17, instead of the old 2.1.15 files.

Nope. Compile still fails.

End of the log looks like this.

/bin/bash …/libtool --mode=compile --tag=RC i686-w64-mingw32-windres /bin/sh ../../libiconv-1.14/lib/../windows/windres-options --escape 1.14 -i …/…/libiconv-1.14/lib/…/windows/libiconv.rc -o libiconv.res.lo --output-format=coff
libtool: compile: i686-w64-mingw32-windres -DPACKAGE_VERSION_STRING=\"1.14\" -DPACKAGE_VERSION_MAJOR=1 -DPACKAGE_VERSION_MINOR=14 -DPACKAGE_VERSION_SUBMINOR=0 -i …/…/libiconv-1.14/lib/…/windows/libiconv.rc --output-format=coff -o .libs/libiconv.res.o
…/…/libiconv-1.14/lib/iconv.c:594:5: warning: ‘_libiconv_version’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
int _libiconv_version = _LIBICONV_VERSION;
^
…/…/libiconv-1.14/lib/iconv.c:173:38: warning: ‘stringpool2_contents’ is static but used in inline function ‘aliases2_lookup’ which is not static
#define stringpool2 ((const char *) &stringpool2_contents)
^
…/…/libiconv-1.14/lib/iconv.c:188:22: note: in expansion of macro ‘stringpool2’
if (!strcmp(str, stringpool2 + ptr->name))
^
…/…/libiconv-1.14/lib/iconv.c:187:68: warning: ‘sysdep_aliases’ is static but used in inline function ‘aliases2_lookup’ which is not static
for (ptr = sysdep_aliases, count = sizeof(sysdep_aliases)/sizeof(sysdep_aliases[0]); count > 0; ptr++, count–)
^
…/…/libiconv-1.14/lib/iconv.c:187:45: warning: ‘sysdep_aliases’ is static but used in inline function ‘aliases2_lookup’ which is not static
for (ptr = sysdep_aliases, count = sizeof(sysdep_aliases)/sizeof(sysdep_aliases[0]); count > 0; ptr++, count–)
^
…/…/libiconv-1.14/lib/iconv.c:187:14: warning: ‘sysdep_aliases’ is static but used in inline function ‘aliases2_lookup’ which is not static
for (ptr = sysdep_aliases, count = sizeof(sysdep_aliases)/sizeof(sysdep_aliases[0]); count > 0; ptr++, count–)
^
/bin/bash …/libtool --mode=link i686-w64-mingw32-gcc -Wl,–export-all-symbols -mms-bitfields -fvisibility=hidden -o libiconv.la -rpath /home/end2end/gpg4win/src/playground/install/pkgs/libiconv-1.14/lib -version-info 7:1:5 -no-undefined iconv.lo localcharset.lo relocatable.lo iconv-exports.lo libiconv.res.lo
libtool: link: i686-w64-mingw32-gcc -shared .libs/iconv.o .libs/localcharset.o .libs/relocatable.o .libs/iconv-exports.o .libs/libiconv.res.o -Wl,–export-all-symbols -mms-bitfields -o .libs/libiconv-2.dll -Wl,–enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libiconv.dll.a
.libs/iconv.o:iconv.c:(.text+0x19302): undefined reference to aliases2_lookup' .libs/iconv.o:iconv.c:(.text+0x1948c): undefined reference to aliases2_lookup’
.libs/iconv.o:iconv.c:(.text+0x198c1): undefined reference to aliases2_lookup' .libs/iconv.o:iconv.c:(.text+0x19a4f): undefined reference to aliases2_lookup’
.libs/iconv.o:iconv.c:(.text+0x1a1b4): undefined reference to `aliases2_lookup’
collect2: error: ld returned 1 exit status
Makefile:71: recipe for target ‘libiconv.la’ failed
make[5]: *** [libiconv.la] Error 1
make[5]: Leaving directory ‘/home/end2end/gpg4win/src/playground/build/libiconv-1.14-build/lib’
Makefile:33: recipe for target ‘all’ failed
make[4]: *** [all] Error 2
make[4]: Leaving directory ‘/home/end2end/gpg4win/src/playground/build/libiconv-1.14-build’
gpg4win.mk:702: recipe for target ‘stamps/stamp-libiconv-03-make’ failed
make[3]: *** [stamps/stamp-libiconv-03-make] Error 1
make[3]: Leaving directory ‘/home/end2end/gpg4win/src’
Makefile:977: recipe for target ‘all-recursive’ failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory ‘/home/end2end/gpg4win/src’
Makefile:721: recipe for target ‘all-recursive’ failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory ‘/home/end2end/gpg4win’
Makefile:662: recipe for target ‘all’ failed
make: *** [all] Error 2

Hi Kim,

thanks for trying to build Gpg4win, it means you want to play
with it, do some extensions or just trying to recreate the version your are using,
we like all of this. So if you run into problem, you can ask here
and another good place is the gpg4win-devel@ list.:slight_smile:

As with all git builds from the “master” branch:
They sometimes do not work, because it is may be work in progress.
So please indicate which version you are trying to build in detail.

Note that there are additional instructions in the wiki, for example:
https://wiki.gnupg.org/Gpg4win/build

Best Regards,
Bernhard

gpg4win-3.0.0-beta199 prepared for make

    Revision: 8ef29db  (36594)
    32bit platform: i686-w64-mingw32
    64bit platform: x86_64-w64-mingw32

Thanks, fixed.

Mh, this is weird, which debian are you on? I don’t see that with mingw/gcc from jessie.

This looks like: http://savannah.gnu.org/bugs/?47953 maybe we should add that patch or update libiconv. But I wonder why I’m not seeing this error.

Old GnuPG files are expected. I usally update before a new beta or release. I’ll update libpng.

GnuPG 2.1.17 for example won’t have any keyserver access so it’s pretty broken on windows. I’m currently waiting for 2.1.18 which is due this week.

packages.current is still listing old, and sometimes unavailable files.

line 21: downloading http://zlib.net/zlib-1.2.8.tar.gz failed

zlib is up to 1.2.11 now, updated on the 15th.

Is there a gnupg 2.1.18 coming soon, you said?

Indeed zlib needed an update, done that. We usually check for necessary updates of third party libraries before a release but we would gladly accept contributions regarding such updates. Just send patches to gpg4win-devel@wald.intevation.org

Regarding 2.1.18, yes this should come today or tomorrow, or so I was told :slight_smile:

gpg updated to 2.1.18 on 23 Jan, but git build packages.current still tries to download 2.1.15, so I assume that gpg4win.git hasn’t been updated yet.

What there any resolution to this? I’m trying to compile on Ubuntu 16.04 and am running into the same issues. I tried from source and from the GIT repo using directions at https://wiki.gnupg.org/Gpg4win/build. No luck.


/bin/bash …/libtool --mode=link i686-w64-mingw32-gcc -Wl,–export-all-symbols -mms-bitfields -fvisibility=hidden -o libiconv.la -rpath /home/user/test/gpg4win/src/playground/install/pkgs/libiconv-1.14/lib -version-info 7:1:5 -no-undefined iconv.lo localcharset.lo relocatable.lo iconv-exports.lo libiconv.res.lo
libtool: link: i686-w64-mingw32-gcc -shared .libs/iconv.o .libs/localcharset.o .libs/relocatable.o .libs/iconv-exports.o .libs/libiconv.res.o -Wl,–export-all-symbols -mms-bitfields -o .libs/libiconv-2.dll -Wl,–enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libiconv.dll.a
.libs/iconv.o:iconv.c:(.text+0x19302): undefined reference to aliases2_lookup' .libs/iconv.o:iconv.c:(.text+0x1948c): undefined reference to aliases2_lookup’
.libs/iconv.o:iconv.c:(.text+0x198c1): undefined reference to aliases2_lookup' .libs/iconv.o:iconv.c:(.text+0x19a4f): undefined reference to aliases2_lookup’
.libs/iconv.o:iconv.c:(.text+0x1a1b4): undefined reference to `aliases2_lookup’
collect2: error: ld returned 1 exit status
Makefile:71: recipe for target ‘libiconv.la’ failed

I have more errors.
I need to run
./autogen.sh --build-w32 --with-libgcc_s_sjlj-1=/dev/null --with-libstdc+±6=dev/null
to get past that missing error, but when I do, I get other errors.

Screendump attached.

Skärmavbild 2017-03-24 kl. 11.27.16.png

Thanks for following up.

Unfortunately, that does not get me past the error. Our output appears to be the same when referencing the undefined functions.

I have tried your solution on both gpg4win-2.3.3 and gpg4win-3.0.0-beta216. Both result in the same error.

Any other ideas?

As mentioned in: https://wald.intevation.org/forum/message.php?msg_id=4813&group_id=11

This is an iconv problem that you see with newer compilers / mingw then we are currently using.

Since my message libiconv 2.1.15 was released. I just updated gettext and iconv.

See: https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpg4win.git;a=commitdiff;h=ace4dd4978bdee94a91f5fbe8c9424641b2add15

That should hopefully fix your issue.