Cross-compiling GPGME

Robert J. Hansen rjh at sixdemonbag.org
Thu Jun 28 06:40:36 CEST 2012


I have a small Qt application that uses GPGME.  It compiles cleanly
under Linux (on a Fedora 17/x64 setup).  Although F17 has a really
lovely mingw32 cross-compiler, and a pre-built libgpg-error for Win32
that I can use, it's missing gpgme -- meaning I need to cross-compile my
own, so that the mingw32 linker can operate correctly.

This has been a frustrating experience.  Particularly, libassuan is
refusing to build, and since that's a dependency for libgpgme...

Before I go further: I'm calling the configure scripts through the
mingw32-configure wrapper, in accordance with Fedora's guidelines for
cross-compiling.  Likewise, make is called through mingw32-make.

Anyway, regarding libassuan: everything compiles fine, but at the link
stage I'm getting:



libtool: link:  i686-w64-mingw32-gcc -shared .libs/libassuan-0.dll.def
.libs/libassuan_la-assuan.o .libs/libassuan_la-context.o
.libs/libassuan_la-system.o .libs/libassuan_la-debug.o
.libs/libassuan_la-conversion.o .libs/libassuan_la-sysutils.o
.libs/libassuan_la-client.o .libs/libassuan_la-server.o
.libs/libassuan_la-assuan-error.o .libs/libassuan_la-assuan-buffer.o
.libs/libassuan_la-assuan-handler.o .libs/libassuan_la-assuan-inquire.o
.libs/libassuan_la-assuan-listen.o
.libs/libassuan_la-assuan-pipe-server.o
.libs/libassuan_la-assuan-socket-server.o
.libs/libassuan_la-assuan-pipe-connect.o
.libs/libassuan_la-assuan-socket-connect.o
.libs/libassuan_la-assuan-uds.o .libs/libassuan_la-assuan-logging.o
.libs/libassuan_la-assuan-socket.o .libs/libassuan_la-system-w32.o
.libs/libassuan_la-assuan-io.o .libs/putc_unlocked.o .libs/memrchr.o
.libs/stpcpy.o .libs/setenv.o .libs/vasprintf.o   -lws2_32
-L/usr/i686-w64-mingw32/sys-root/mingw/lib -lgpg-error  -O2
-Wl,.libs/versioninfo.o   -o .libs/libassuan-0.dll
-Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker
.libs/libassuan.dll.a
/usr/lib64/gcc/i686-w64-mingw32/4.7.0/../../../../i686-w64-mingw32/bin/ld:
.libs/libassuan-0.dll.def:5: syntax error
/usr/lib64/gcc/i686-w64-mingw32/4.7.0/../../../../i686-w64-mingw32/bin/ld:.libs/libassuan-0.dll.def:
file format not recognized; treating as linker script
/usr/lib64/gcc/i686-w64-mingw32/4.7.0/../../../../i686-w64-mingw32/bin/ld:.libs/libassuan-0.dll.def:2:
syntax error
collect2: error: ld returned 1 exit status
make[3]: *** [libassuan.la] Error 1
make[3]: Leaving directory `/home/rjh/Downloads/libassuan-2.0.3/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/rjh/Downloads/libassuan-2.0.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/rjh/Downloads/libassuan-2.0.3'
make: *** [all] Error 2



... Does anyone have any guidance for me here?  I know that GPG4WIN is
built on a Linux system with a cross-compiler: how do the maintainers
build GPGME (and libassuan)?





More information about the Gnupg-users mailing list