Page MenuHome GnuPG

libgpg-error cross-compilation error
Closed, InvalidPublic

Description

Hello,
Error report in regard to libgpg-error
Cross-compiling with target Win10 x64, using mingw64 under ubuntu 21.10,
It cross-compiles successfully with https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.43.tar.bz2
It does NOT cross-compile using the latest git commit : fd83c3e29744c8d7829df3de8c10f9c68f11e429
I am unsure which commit since 1.43 causes the issue.
Error log:

libtool: compile:  x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/share/locale\" -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -Wall -Wpointer-arith -Wno-psabi -MT libgpg_error_la-b64dec.lo -MD -MP -MF .deps/libgpg_error_la-b64dec.Tpo -c b64dec.c -o libgpg_error_la-b64dec.o
mv -f .deps/libgpg_error_la-b64dec.Tpo .deps/libgpg_error_la-b64dec.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/share/locale\"  -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include  -Wall -Wpointer-arith -Wno-psabi -MT libgpg_error_la-b64enc.lo -MD -MP -MF .deps/libgpg_error_la-b64enc.Tpo -c -o libgpg_error_la-b64enc.lo `test -f 'b64enc.c' || echo './'`b64enc.c
mv -f .deps/libgpg_error_la-init.Tpo .deps/libgpg_error_la-init.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/share/locale\"  -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include  -Wall -Wpointer-arith -Wno-psabi -MT libgpg_error_la-argparse.lo -MD -MP -MF .deps/libgpg_error_la-argparse.Tpo -c -o libgpg_error_la-argparse.lo `test -f 'argparse.c' || echo './'`argparse.c
libtool: compile:  x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/share/locale\" -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -Wall -Wpointer-arith -Wno-psabi -MT libgpg_error_la-b64enc.lo -MD -MP -MF .deps/libgpg_error_la-b64enc.Tpo -c b64enc.c -o libgpg_error_la-b64enc.o
libtool: compile:  x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/share/locale\" -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -Wall -Wpointer-arith -Wno-psabi -MT libgpg_error_la-argparse.lo -MD -MP -MF .deps/libgpg_error_la-argparse.Tpo -c argparse.c -o libgpg_error_la-argparse.o
mv -f .deps/libgpg_error_la-b64enc.Tpo .deps/libgpg_error_la-b64enc.Plo
/bin/bash ../libtool --mode=compile --tag=RC x86_64-w64-mingw32-windres -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/share/locale\"  -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -i "versioninfo.rc" -o "versioninfo.lo"
libtool: compile:  x86_64-w64-mingw32-windres -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/share/locale\" -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -i versioninfo.rc -o versioninfo.o
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I..   -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include  -Wall -Wpointer-arith -Wno-psabi -MT gen-w32-lock-obj.o -MD -MP -MF .deps/gen-w32-lock-obj.Tpo -c -o gen-w32-lock-obj.o gen-w32-lock-obj.c
mv -f .deps/libgpg_error_la-code-to-errno.Tpo .deps/libgpg_error_la-code-to-errno.Plo
cd .. && /bin/bash ./config.status src/gpgrt-config
mv -f .deps/libgpg_error_la-argparse.Tpo .deps/libgpg_error_la-argparse.Plo
cd .. && /bin/bash ./config.status src/gpg-error-config-old
mv -f .deps/libgpg_error_la-estream.Tpo .deps/libgpg_error_la-estream.Plo
mv -f .deps/libgpg_error_la-sysutils.Tpo .deps/libgpg_error_la-sysutils.Plo
config.status: creating src/gpgrt-config
config.status: creating src/gpg-error-config-old
Confirm gpg-error-config works... /bin/bash: ./gpg-error-config-test.sh: No such file or directory
no
***  Please report to <https://bugs.gnupg.org> with gpg-error-config-test.log
make[3]: *** [Makefile:1733: gpg-error-config] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/libgpg_error_la-logging.Tpo .deps/libgpg_error_la-logging.Plo
mv -f .deps/gen-w32-lock-obj.Tpo .deps/gen-w32-lock-obj.Po
make[3]: Leaving directory '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git/src'
make[2]: *** [Makefile:695: all] Error 2
make[2]: Leaving directory '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git/src'
make[1]: *** [Makefile:517: all-recursive] Error 1
make[1]: Leaving directory '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git'
make: *** [Makefile:449: all] Error 2

Details

Version
after 1.43

Event Timeline

The cross-compilation settings:

{ # 2019.12.13 # https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=summary
	#'repo_type' : 'archive',
	'#url' : 'https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.43.tar.bz2',
	#
	'repo_type' : 'git',
	'recursive_git' : True,
	'url' : 'git://git.gnupg.org/libgpg-error.git', # https://git.gnupg.org/ # https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=summary
	##'url' : 'https://dev.gnupg.org/source/libgpg-error.git', # https://git.gnupg.org/ # https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=summary
	#
	'configure_options': '--host={target_host} --prefix={target_prefix} --disable-shared --enable-static --disable-rpath --disable-doc --disable-tests --with-libiconv-prefix={target_prefix}', # --with-libintl=no --with-libpth=no',
	'custom_cflag' : ' ', # 2019.12.13 it fails to build with anything other than this, eg it crashes with -O3 and -fstack-protector-all -D_FORTIFY_SOURCE=2 
	'run_post_regexreplace' : (
		'autoreconf -fiv',
		'./autogen.sh --build-w64 ', 								 
	),
	'depends_on' : (
		'iconv', 
	),
}
werner removed a project: Bug Report.
werner added a subscriber: werner.

No autoreconf etc. Use only our method to cross build. That is $src/libgcrypt/autogen.sh --build-w32.

And pretty please - no bug report to the tracker for unreleased development states. I'll close this.

Thanks for your report.

It seems that it's not clean build, but something like continuous integration, keeping past built things.

I fixed automake thingy in rEfd83c3e29744: build: Fix for configure generated files.. In general, such a change may require clean build.

Anyhow, I push a change rE0fcfca8e9ffa: build: Fix dependency to gpg-error-config-test.sh., to try to solve your particular case.

Thank you !

Success cross-compiling libgpg-error from latest git clone. Or, in part, depending on how you look at it ... no doubt I am doing something wrong (knowing little about cross-compilation).

I just re-ran the same cross-compilation script twice with results:

a) (with 'autoreconf -fiv' before autogen) and the cross-compilation worked with no errors thrown.

b) (without 'autoreconf -fiv' before autogen) and the cross-compilation failed per the log below.

Log without 'autoreconf -fiv' :-

Changing dir from /home/u/Desktop/_working/workdir to /home/u/Desktop/_working/workdir/x86_64
[23:29:59][DEBUG] cd /home/u/Desktop/_working/workdir/x86_64
[23:29:59][INFO] Git Shallow Cloning 'git://git.gnupg.org/libgpg-error.git' to '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git'
[23:29:59][DEBUG] git clone --recursive --depth 1 --progress "git://git.gnupg.org/libgpg-error.git" "libgpg-error_git.tmp"
[23:29:59][DEBUG] Running 'git clone --recursive --depth 1 --progress "git://git.gnupg.org/libgpg-error.git" "libgpg-error_git.tmp"' in '/home/u/Desktop/_working/workdir/x86_64'
Cloning into 'libgpg-error_git.tmp'...
remote: Counting objects: 295, done.        
remote: Compressing objects: 100% (293/293), done.        
remote: Total 295 (delta 87), reused 12 (delta 0)        B/s
Receiving objects: 100% (295/295), 960.04 KiB | 602.00 KiB/s, done.
Resolving deltas: 100% (87/87), done.
[23:30:03][DEBUG] mv "libgpg-error_git.tmp" "libgpg-error_git"
[23:30:03][DEBUG] Running 'mv "libgpg-error_git.tmp" "libgpg-error_git"' in '/home/u/Desktop/_working/workdir/x86_64'
[23:30:03][INFO] Finished GIT cloning 'git://git.gnupg.org/libgpg-error.git' to 'libgpg-error_git'
Changing dir from /home/u/Desktop/_working/workdir/x86_64 to libgpg-error_git
[23:30:03][DEBUG] cd libgpg-error_git
[23:30:03][DEBUG] git clean -ffdx
[23:30:03][DEBUG] Running 'git clean -ffdx' in '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git'
[23:30:03][DEBUG] git submodule foreach --recursive git clean -ffdx
[23:30:03][DEBUG] Running 'git submodule foreach --recursive git clean -ffdx' in '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git'
[23:30:03][DEBUG] git reset --hard
[23:30:03][DEBUG] Running 'git reset --hard' in '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git'
HEAD is now at 0fcfca8 build: Fix dependency to gpg-error-config-test.sh.
[23:30:03][DEBUG] git submodule foreach --recursive git reset --hard
[23:30:03][DEBUG] Running 'git submodule foreach --recursive git reset --hard' in '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git'
[23:30:03][DEBUG] git submodule update --init --recursive
[23:30:03][DEBUG] Running 'git submodule update --init --recursive' in '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git'
[23:30:03][DEBUG] Setting CFLAGS to ' '
[23:30:03][INFO] Set CFLAGS, now: " "
[23:30:03][INFO] Set CXXFLAGS, now: " "
[23:30:03][INFO] Set CPPFLAGS, now: " "
[23:30:03][INFO] Set LDFLAGS, now: " "
##############################
[23:30:03][INFO] Running run_post_regexreplace-command: './autogen.sh --force --build-w64 -prefix=/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32'
[23:30:03][DEBUG] Running './autogen.sh --force --build-w64 --prefix=/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32' in '/home/u/Desktop/_working/workdir/x86_64/libgpg-error_git'
autogen.sh: Using /home/u/w64root as standard install directory
./autogen.sh: 348: /home/u/Desktop/_working/workdir/x86_64/libgpg-error_git/configure: not found

Build parameters (with #'autoreconf -fiv' not commented out for (a) and commented out for (b) :-

{ # 2019.12.13 # https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=summary
	#'repo_type' : 'archive',
	#'url' : 'https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.43.tar.bz2',
	#
	'repo_type' : 'git',
	'recursive_git' : True,
	'url' : 'git://git.gnupg.org/libgpg-error.git', # https://git.gnupg.org/ # https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=summary
	##'url' : 'https://dev.gnupg.org/source/libgpg-error.git', # https://git.gnupg.org/ # https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=summary
	#
	'custom_cflag' : ' ', # 2019.12.13 it fails to build with anything other than this, eg it crashes with -O3 and -fstack-protector-all -D_FORTIFY_SOURCE=2 
	'run_post_regexreplace' : (
		#'autoreconf -fiv', # https://dev.gnupg.org/T5696
		'./autogen.sh --force --build-w64 --prefix={target_prefix}', # -prefix={target_prefix},	# https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blob_plain;f=README.GIT;hb=HEAD https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blob_plain;f=README;hb=HEAD
	),
	'configure_options': '--host={target_host} --prefix={target_prefix} --disable-shared --enable-static --disable-rpath --disable-doc --disable-tests --with-libiconv-prefix={target_prefix}', # --with-libintl=no --with-libpth=no',
	'depends_on' : (
		'iconv', 
	),
	'update_check' : { 'type' : 'git', },
	'_info' : { 'version' : 'git master', 'fancy_name' : 'libgpg-error for libaacs' },
}