Cross build problem with v1.38
Testing, NormalPublic


Hi, all previous versions always cross build just fine until v1.38, this is the error message:

gpg-error.h:1117:19: error: flexible array member in union
posix-lock.c: In function '_gpgrt_lock_destroy':
posix-lock.c:252:11: error: empty scalar initializer
posix-lock.c:252:11: error: (near initialization for 'tmp.u._priv')
Makefile:945: recipe for target 'libgpg_error_la-posix-lock.lo' failed
make[7]: *** [libgpg_error_la-posix-lock.lo] Error 1

Thank you in advance.

Related Objects

rcinterstate updated the task description. (Show Details)Jun 9 2020, 10:48 AM
rcinterstate updated the task description. (Show Details)
werner assigned this task to gniibe.Jun 10 2020, 10:05 AM
werner added a subscriber: werner.

Thanks for the report. It would be helpful if you can tell us your environment; in particular your build and target(host ) system.

rcinterstate added a comment.EditedJun 11 2020, 2:27 AM

Thank you also for the reply, the environment / build host is Ubuntu 18.04 LTS x86-x64 GNU/Linux and target host systems are MIPS and ARM.

FYI this didn't fixed it:

gniibe triaged this task as Normal priority.Jun 11 2020, 3:52 AM

Thanks for your report. I think it fails to generate src/lock-obj-pub.native.h.

Pushed a change to detect objdump for host.

After this change:

./configure: line 17470: syntax error near unexpected token `fi'
./configure: line 17470: ` if test ! -d src; mkdir src; fi'

Sorry for repeated mistake of mine.
I fixed it and tested with 'make distcheck' in the environment of cross-build for ppc64el host.

No problem, in fact there's several issues with the cross build code, i'll report them later today.

Confirm gpg-error-config works... no

Makefile:1667: recipe for target 'gpg-error-config' failed

Please give us full build log here, so that we can investigate what's going on. You can upload log file by the "upload" button in comment edit dialog.

Specifically, I don't understand the path /root/testbuild/arm-uclibc/stage.

IIUC, you build libgpg-error with setting PKG_CONFIG_SYSROOT_DIR.
It results errors, because while old gpg-error-config never supports PKG_CONFIG_SYSROOT_DIR, it compares result from old gpg-error-config and gpgrt-config gpg-error.

Perhaps, it's good to skip the tests by when PKG_CONFIG_SYSROOT_DIR is enabled.

Or one liner patch would be enough:

diff --git a/src/ b/src/
index 02bc881..b888aa2 100644
--- a/src/
+++ b/src/
@@ -8,6 +8,8 @@ export PKG_CONFIG_PATH
 if [ "$1" = --old-new ]; then
+    # Old gpg-error-config never supports PKG_CONFIG_SYSROOT_DIR
rcinterstate added a comment.EditedJun 15 2020, 4:29 AM

Yes, i always build it with PKG_CONFIG_SYSROOT_DIR but never had any issues with it until 1.38 version, your suggestion definitely fixed it. Thank you.

It's me who should say "thank you".

My intention of the changes of libgpg-error is two: (1) support of pkg-config for developers who want use it. (2) Removal of (unnecessary) early dependency of libgpg-error when bootstrapping OS build by improving how cross build is done.

So, testing in cross build in some configuration of pkg-config really helps.
Thank you.

You are very welcome, i'll let you know if i found more issues in the future, same goes to libgcrypt.

gniibe changed the task status from Open to Testing.