Page MenuHome GnuPG

GnuPG: GnuPG 2.2.40 LTS FTBFS against new Libgpg-error 1.46
Testing, NormalPublic


Reporting this as a Libgpg-error bug due it seemingly related to changes in Libgpg-error 1.46 specifically to src/estream.c (addition of new SOCKET based I/O in lines 1190-1393). Attempting to build GnuPG 2.2.40 LTS against the new Libgpg-error 1.46 gives a link failure as follows:

i686-w64-mingw32-gcc -I/usr/i686-w64-mingw32/include  -I/usr/i686-w64-mingw32/include -I/usr/i686-w64-mingw32/include -Wall -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -g -Os  -Xlinker --no-insert-timestamp -static -o gpgv.exe gpgv.o build-packet.o compress.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 rmd160.o openfile.o keyid.o parse-packet.o cpr.o plaintext.o sig-check.o keylist.o pkglue.o ecdh.o verify.o ../kbx/libkeybox.a ../common/libcommon.a ../regexp/libregexp.a ../common/libgpgrl.a -lz   -lws2_32 -L/usr/i686-w64-mingw32/lib -lgcrypt -L/usr/i686-w64-mingw32/lib -lgpg-error   gpgv-w32info.o  
/usr/bin/i686-w64-mingw32-ld: /usr/i686-w64-mingw32/lib/libgpg-error.a(libgpg_error_la-estream.o): in function `func_sock_ioctl':
./build-i686-w64-mingw32/src/../../src/estream.c:1342: undefined reference to `_imp__ioctlsocket@12'
collect2: error: ld returned 1 exit status

Build was attempted for Ubuntu 22.04 LTS Jammy, so the most recent Ubuntu LTS release available.



Related Objects

Event Timeline

savoury1 renamed this task from Libgpg-error: GnuPG 2.2.40 LTS FTBFS against new Libgpg-error 1.46 to GnuPG: GnuPG 2.2.40 LTS FTBFS against new Libgpg-error 1.46.Oct 18 2022, 2:15 AM
savoury1 changed Version from 1.46 to 2.2.40.

Renamed bug due it being incorrect to assume this was a bug with libgpg-error. Turns out that a simple patch to g10/ in GnuPG 2.2.40 LTS source fixes the linking error. Patch that fixed build for me is attached, which basically puts -lws2_32 in the correct location for builds with the new libgpg-error 1.46 version.

gniibe triaged this task as Normal priority.
gniibe added projects: gnupg (gpg22), Windows.
gniibe added a subscriber: gniibe.

Thank you for your report. The issue is handling of static linking in GnuPG.

To fix, we need to move`-lws2_32` after -lgpg-error. Let me see, how we can do it (by configure).

Pushed the changes to 2.2 and master.

Ah, sorry, I did my own changes before looking T6244#164317

gniibe changed the task status from Open to Testing.Oct 19 2022, 3:21 AM