Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 654042 - app-crypt/gnupg-2.2.6 cross compile fails due to -L/usr/lib64 because of finding wrong library config tools
Summary: app-crypt/gnupg-2.2.6 cross compile fails due to -L/usr/lib64 because of find...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Kristian Fiskerstrand (RETIRED)
URL: https://dev.gnupg.org/T3950
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks:
 
Reported: 2018-04-25 07:20 UTC by Joe Harvell
Modified: 2019-05-01 19:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
output of sudo armv7a-pip-linux-gnueabi-emerge --info (pip-emerge-info.txt,4.72 KB, text/plain)
2018-04-25 07:20 UTC, Joe Harvell
Details
gnupg-2.2.6.ebuild (gnupg-2.2.6.ebuild,3.19 KB, patch)
2018-04-25 07:24 UTC, Joe Harvell
Details | Diff
gpg-error.m4 (gpg-error-config-sysroot-path.patch,773 bytes, patch)
2018-04-25 07:25 UTC, Joe Harvell
Details | Diff
ksba.m4 (upgrade-ksba.m4.patch,5.35 KB, patch)
2018-04-25 07:26 UTC, Joe Harvell
Details | Diff
libassuan.m4 (upgrade-libassuan.m4-from-pinentry.patch,6.71 KB, patch)
2018-04-25 07:26 UTC, Joe Harvell
Details | Diff
libgcrypt.m4 (upgrade-libgcrypt.m4.patch,1.17 KB, patch)
2018-04-25 07:27 UTC, Joe Harvell
Details | Diff
npth.m4 (upgrade-npth.m4.patch,6.84 KB, patch)
2018-04-25 07:27 UTC, Joe Harvell
Details | Diff
gnupg-2.2.6.ebuild.patch (gnupg-2.2.6.ebuild.patch,446 bytes, patch)
2018-04-27 16:48 UTC, Joe Harvell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Harvell 2018-04-25 07:20:06 UTC
Created attachment 528490 [details]
output of sudo armv7a-pip-linux-gnueabi-emerge --info

Cross compiling:

gnupg autoconfigure finds the wrong library path for the following libraries:

libgpg-error
libksba
libassuan
libgcrypt
libnpth

This is because of the same error repeated several times.  Instead of finding the target version of the library config program, it found the one on the build machine.

example:
instead of finding /usr/armv7a-pip-linux-gnueabi/usr/bin/gpg-error-config it found /usr/bin/gpg-error-config.  This happened for all libraries above.  I don't have the original logs becuase I fixed each case and am attaching patches.

When it uses the /usr/bin version instead of the <sysroot>/usr/bin version it inserts /usr/lib64 into the library path instead of /usr/lib.  The result is that it fails to find any libraries from /usr/lib and fails to link.

Some of the patches I created are copied from pinentry.  Apparently the sources for these two packages have the same provenance.  In some cases the versions of the .m4 files from pinentry were modified to support <sysroot>, but were only looking in <sysroot>/bin instead of <sysroot>/usr/bin.  So they were easy to fix.  The other ones are just older clones of the upgraded pinentry ones.  So the fixes are just clones of the pinentry fixes.


Refer to https://bugs.gentoo.org/show_bug.cgi?id=653938 to see the bug report I made for the pinentry issue.
Comment 1 Joe Harvell 2018-04-25 07:22:44 UTC
Oh, to reproduce the failure:

1.Create cross toolcain (crossdev -t armv7a-pip-linux-gnueabi)
2.Unpack latest portage snapshot into /usr/armv7a-pip-linux-gnueabi/usr
3.Update /usr/armv7a-pip-linux-gnueabi/etc/portage/make.profile symlink to point to ../../usr/portage/profiles/default/linux/arm/13.0/armv7a
4. sudo armv7a-pip-linux-gnueabi-emerge -a1v --noreplace --keep-going @system
5. repeat step 4 as necessary until emerge actually attempts to build app-crypt/gnupg

Also, https://bugs.gentoo.org/653930 is another bug for the same issue for apparently the same upstream codebase.
Comment 2 Joe Harvell 2018-04-25 07:24:59 UTC
Created attachment 528492 [details, diff]
gnupg-2.2.6.ebuild
Comment 3 Joe Harvell 2018-04-25 07:25:43 UTC
Created attachment 528494 [details, diff]
gpg-error.m4
Comment 4 Joe Harvell 2018-04-25 07:26:08 UTC
Created attachment 528496 [details, diff]
ksba.m4
Comment 5 Joe Harvell 2018-04-25 07:26:33 UTC
Created attachment 528498 [details, diff]
libassuan.m4
Comment 6 Joe Harvell 2018-04-25 07:27:01 UTC
Created attachment 528500 [details, diff]
libgcrypt.m4
Comment 7 Joe Harvell 2018-04-25 07:27:19 UTC
Created attachment 528502 [details, diff]
npth.m4
Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2018-04-27 07:49:52 UTC
Thanks!
But we are downstream we do not fork upstream.
Please workout with upstream to embed this or any other solution.
Once merged downstream will be follow.
Comment 9 Joe Harvell 2018-04-27 16:48:33 UTC
Created attachment 528712 [details, diff]
gnupg-2.2.6.ebuild.patch
Comment 10 Joe Harvell 2018-04-27 17:37:58 UTC
Upstream bug report https://dev.gnupg.org/T3950
Comment 11 Kristian Fiskerstrand (RETIRED) gentoo-dev 2018-10-21 09:11:25 UTC
Can you please test 2.2.10-r1?
Comment 12 Joe Harvell 2019-05-01 19:37:08 UTC
I successfully merged 2.2.15-r1