Page MenuHome GnuPG

Cross build problem with v1.38
Closed, ResolvedPublic

Description

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.

Details

Version
1.38

Related Objects

Event Timeline

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.

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:

https://github.com/gpg/libgpg-error/commit/013720333c6ec1d38791689bc49ba039d98e16b3

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:

https://github.com/gpg/libgpg-error/commit/ce97528fa3dcc58d86e18d4d8820f210a624f63d

./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

http://s000.tinyupload.com/?file_id=88370776732567316883

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 gpg-error-config-test.sh when PKG_CONFIG_SYSROOT_DIR is enabled.

Or one liner patch would be enough:

diff --git a/src/gpg-error-config-test.sh.in b/src/gpg-error-config-test.sh.in
index 02bc881..b888aa2 100644
--- a/src/gpg-error-config-test.sh.in
+++ b/src/gpg-error-config-test.sh.in
@@ -8,6 +8,8 @@ export PKG_CONFIG_PATH
 
 if [ "$1" = --old-new ]; then
     PKG_CONFIG_CMD=./gpg-error-config-old
+    # Old gpg-error-config never supports PKG_CONFIG_SYSROOT_DIR
+    unset PKG_CONFIG_SYSROOT_DIR
 else
     pkg_config_min_version=0.29
     PKG_CONFIG_SYSROOT_DIR="/var/example-target"

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.Jul 9 2020, 7:05 AM
gniibe added a project: Restricted Project.