Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653930 - dev-libs/libgcrypt-1.8.2-r2: cross build fails: configure: error: libgpg-error is needed
Summary: dev-libs/libgcrypt-1.8.2-r2: cross build fails: configure: error: libgpg-erro...
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:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-04-24 01:59 UTC by Joe Harvell
Modified: 2018-04-27 18:23 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-24 02:16 UTC, Joe Harvell
Details
output of sudo emerge --info (emerge-info.txt,6.39 KB, text/plain)
2018-04-24 02:17 UTC, Joe Harvell
Details
build.log (build.log,12.16 KB, text/plain)
2018-04-24 02:17 UTC, Joe Harvell
Details
build-.arm.log (build-.arm.log,10.58 KB, text/plain)
2018-04-24 02:18 UTC, Joe Harvell
Details
eclass-debug.log (eclass-debug.log,4.06 KB, text/plain)
2018-04-24 02:18 UTC, Joe Harvell
Details
environment (environment,113.10 KB, text/plain)
2018-04-24 02:19 UTC, Joe Harvell
Details
config.log (config.log,58.67 KB, text/x-log)
2018-04-24 02:19 UTC, Joe Harvell
Details
configure (configure,633.11 KB, text/plain)
2018-04-24 02:20 UTC, Joe Harvell
Details
autoheader.out (autoheader.out,194 bytes, text/plain)
2018-04-24 02:20 UTC, Joe Harvell
Details
automake.out (automake.out,462 bytes, text/plain)
2018-04-24 02:21 UTC, Joe Harvell
Details
autoconf.out (autoconf.out,336 bytes, text/plain)
2018-04-24 02:21 UTC, Joe Harvell
Details
aclocal.out (aclocal.out,470 bytes, text/plain)
2018-04-24 02:21 UTC, Joe Harvell
Details
libtoolize.out (libtoolize.out,179 bytes, text/plain)
2018-04-24 02:22 UTC, Joe Harvell
Details
libtool-elt.patch (libtool-elt.patch,1.46 KB, patch)
2018-04-24 02:22 UTC, Joe Harvell
Details | Diff
diff of ebuild that fixes the problem (libgcrypt-1.8.2-r2.ebuild.diff,471 bytes, patch)
2018-04-24 04:54 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-24 01:59:39 UTC
I am building a Gentoo system for my ARM based Beaglebone Black from scratch using a toolchain setup with crossdev.  Most packages in @system build fine, but a handful fail, including this one.  More detailed error message below:

>>> Configuring source in /usr/armv7a-pip-linux-gnueabi/tmp/portage/dev-libs/libgcrypt-1.8.2-r2/work/libgcrypt-1.8.2 ...
 * .arm: running multilib-minimal_abi_src_configure
 * econf: updating libgcrypt-1.8.2/build-aux/config.guess with /usr/share/gnuconfig/config.guess
 * econf: updating libgcrypt-1.8.2/build-aux/config.sub with /usr/share/gnuconfig/config.sub
/usr/armv7a-pip-linux-gnueabi/tmp/portage/dev-libs/libgcrypt-1.8.2-r2/work/libgcrypt-1.8.2/configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=armv7a-pip-linux-gnueabi --mandir=/u
sr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/libgcr
ypt-1.8.2-r2 --htmldir=/usr/share/doc/libgcrypt-1.8.2-r2/html --libdir=/usr/lib --disable-dependency-tracking --enable-noexecstack --disable-O-flag-munging --disable-static --without-cap
abilities GPG_ERROR_CONFIG=/usr/bin/armv7a-pip-linux-gnueabi-gpg-error-config
[snip]
checking for gpg-error-config... /usr/bin/armv7a-pip-linux-gnueabi-gpg-error-config
checking for GPG Error - version >= 1.25... no
configure: error: libgpg-error is needed.
                See ftp://ftp.gnupg.org/gcrypt/libgpg-error/ .

!!! Please attach the following file when seeking support:
!!! /usr/armv7a-pip-linux-gnueabi/tmp/portage/dev-libs/libgcrypt-1.8.2-r2/work/libgcrypt-1.8.2-.arm/config.log
 * ERROR: dev-libs/libgcrypt-1.8.2-r2::gentoo failed (configure phase):
 *   econf failed


Reproducible: Always

Steps to Reproduce:
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 dev-libs/libgcrypt-1.8.2-r2

Actual Results:  
dev-libs/libgcrypt-1.8.2-r2 compile fails

Expected Results:  
dev-libs/libgcrypt-1.8.2-r2 succeeds

I have successfully installed 113 of the 134 packages in @system.  There are 5 failing compile and the remaining 19 cannot be compiled due to dependencies on the 5 failing ones.

joey@akita ~$ eix --installed cross-armv7a-pip-linux-gnueabi/\*
[I] cross-armv7a-pip-linux-gnueabi/binutils [1]
     Available versions:  
     (2.25.1) 2.25.1-r1
     (2.26.1) 2.26.1
     (2.27) (~)2.27-r1
     (2.28.1) 2.28.1
     (2.29.1) 2.29.1-r1
     (2.30) (~)2.30 (~)2.30-r1
     (git)  **9999
       {(+)cxx doc multitarget (+)nls static-libs test vanilla zlib}
     Installed versions:  2.30-r1(2.30)(18:38:46 22/04/2018)(cxx nls -doc -multitarget -static-libs -test)
     Homepage:            https://sourceware.org/binutils/
     Description:         Tools necessary to build programs

[I] cross-armv7a-pip-linux-gnueabi/gcc [1]
     Available versions:  
     (2.95.3) ~*2.95.3-r10^s
     (3.3.6) ~3.3.6-r1^s
     (3.4.6) 3.4.6-r2^s
     (4.0.4) **4.0.4^s
     (4.1.2) 4.1.2^s
     (4.2.4) (~)4.2.4-r1^s
     (4.3.6) 4.3.6-r1^s
     (4.4.7) 4.4.7^s
     (4.5.4) 4.5.4^s
     (4.6.4) 4.6.4^s
     (4.7.4) 4.7.4-r1^s
     (4.8.5) 4.8.5-r1^s
     (4.9.4) 4.9.4^s
     (5.4.0) 5.4.0-r4^s
     (6.4.0) 6.4.0^s 6.4.0-r1^s
     (7.2.0) (~)7.2.0^s (~)7.2.0-r1^s
     (7.3.0) (~)7.3.0^s (~)7.3.0-r1^s **7.3.0-r2^s
       {altivec awt boundschecking cilk +cxx d debug doc fixed-point +fortran gcj go graphite hardened jit libssp mpx mudflap multilib +nls nopie nossp +nptl objc objc++ objc-gc +openmp +pch pgo +pie regression-test +sanitize +ssp vanilla +vtv}
     Installed versions:  7.3.0-r1(7.3.0)^s(18:53:05 22/04/2018)(cxx fortran nls nptl openmp pch pie ssp -altivec -awt -cilk -debug -doc -fixed-point -gcj -go -graphite -hardened -jit -libssp -mpx -multilib -objc -objc++ -objc-gc -pgo -regression-test -sanitize -vanilla -vtv)
     Homepage:            https://gcc.gnu.org/
     Description:         The GNU Compiler Collection

[I] cross-armv7a-pip-linux-gnueabi/glibc [1]
     Available versions:  (2.2) (~)2.18-r1^s 2.19-r1^s **2.19-r2^s 2.20-r2^s 2.21-r2^s 2.22-r4^s 2.23-r4^s (~)2.24-r4^s 2.25-r10^s 2.25-r11^s (~)2.26-r6^s **2.27-r1^s **9999^s
       {audit caps compile-locales debug doc gd hardened headers-only multilib nscd profile +rpc selinux suid systemtap vanilla}
     Installed versions:  2.26-r6(2.2)^s(18:47:14 22/04/2018)(caps -audit -debug -doc -gd -hardened -headers-only -multilib -nscd -profile -selinux -suid -systemtap -vanilla)
     Homepage:            https://www.gnu.org/software/libc/
     Description:         GNU libc C library

[I] cross-armv7a-pip-linux-gnueabi/linux-headers [1]
     Available versions:  (*)2.4.33.3^bs (~*)2.4.36^bs 3.18^bs 4.4^bs (~)4.9^bs 4.13^bs (~)4.14^bs (~)4.15^bs (~)4.16^bs (~)4.16-r1^bs {headers-only}
     Installed versions:  4.16-r1^bs(18:44:15 22/04/2018)(-headers-only)
     Homepage:            https://www.kernel.org/ https://www.gentoo.org/
     Description:         Linux system headers

[1] "crossdev" /mnt/striped/opt/portage/crossdev

Found 4 matches
Comment 1 Joe Harvell 2018-04-24 02:06:41 UTC
The problem seems to be that libgcrypt is not taking into account $ROOT when looking for /usr/bin/armv7a-pip-linux-gnueabi-gpg-error-config.  So it is looking for it on the build system instead of in the host system.  See below:

=====
joey@akita files$ cat ~/bin/pipenv 
#!/bin/bash

export PORTAGE_CONFIGROOT=/usr/armv7a-pip-linux-gnueabi
export ROOT=/usr/armv7a-pip-linux-gnueabi
export SYSROOT=/usr/armv7a-pip-linux-gnueabi
exec $*
======

joey@akita files$ ~/bin/pipenv equery files dev-libs/libgpg-error | grep gpg-error-config
/usr/bin/armv7a-pip-linux-gnueabi-gpg-error-config
/usr/bin/gpg-error-config

joey@akita files$ ls -l /usr/bin/armv7a-pip-linux-gnueabi-gpg-error-config
ls: cannot access '/usr/bin/armv7a-pip-linux-gnueabi-gpg-error-config': No such file or directory
joey@akita files$ ls -l /usr/armv7a-pip-linux-gnueabi/usr/bin/armv7a-pip-linux-gnueabi-gpg-error-config
-rwxr-xr-x 1 root root 2355 Apr 23 19:44 /usr/armv7a-pip-linux-gnueabi/usr/bin/armv7a-pip-linux-gnueabi-gpg-error-config
Comment 2 Joe Harvell 2018-04-24 02:14:19 UTC
Full disclosure:  I had to patch dev-libs/libgpg-error to get it to build in this cross environment.  I ended up applying the patch I reference in https://bugs.gentoo.org/653912#c11.

I think this is unrelated, since that patch was just about making libgpg-error find the right header file to include given the name of CHOST.

In this package, it is looking for gpg-error-config using the right value for CHOST.  It is just looking on the build system instead of correctly prepending $ROOT when looking for that file.
Comment 3 Joe Harvell 2018-04-24 02:16:38 UTC
Created attachment 528334 [details]
output of sudo armv7a-pip-linux-gnueabi-emerge --info
Comment 4 Joe Harvell 2018-04-24 02:17:10 UTC
Created attachment 528336 [details]
output of sudo emerge --info
Comment 5 Joe Harvell 2018-04-24 02:17:45 UTC
Created attachment 528338 [details]
build.log
Comment 6 Joe Harvell 2018-04-24 02:18:13 UTC
Created attachment 528340 [details]
build-.arm.log
Comment 7 Joe Harvell 2018-04-24 02:18:49 UTC
Created attachment 528342 [details]
eclass-debug.log
Comment 8 Joe Harvell 2018-04-24 02:19:16 UTC
Created attachment 528344 [details]
environment
Comment 9 Joe Harvell 2018-04-24 02:19:57 UTC
Created attachment 528346 [details]
config.log
Comment 10 Joe Harvell 2018-04-24 02:20:16 UTC
Created attachment 528348 [details]
configure
Comment 11 Joe Harvell 2018-04-24 02:20:48 UTC
Created attachment 528350 [details]
autoheader.out
Comment 12 Joe Harvell 2018-04-24 02:21:14 UTC
Created attachment 528352 [details]
automake.out
Comment 13 Joe Harvell 2018-04-24 02:21:38 UTC
Created attachment 528354 [details]
autoconf.out
Comment 14 Joe Harvell 2018-04-24 02:21:58 UTC
Created attachment 528356 [details]
aclocal.out
Comment 15 Joe Harvell 2018-04-24 02:22:27 UTC
Created attachment 528358 [details]
libtoolize.out
Comment 16 Joe Harvell 2018-04-24 02:22:46 UTC
Created attachment 528360 [details, diff]
libtool-elt.patch
Comment 17 Ryan James 2018-04-24 03:11:02 UTC
I am encountering this bug also. Note since you brought up the libgpg-error patch I did not go that route. I built my toolchain as arm-linux-gnueabihf which breezed right past the issue on that other bug.

Did your libtool patch work for you? I'm using glibc on my end looks like I'll need to make a few tweaks.
Comment 18 Joe Harvell 2018-04-24 03:35:04 UTC
(In reply to Ryan James from comment #17)
> I am encountering this bug also. Note since you brought up the libgpg-error
> patch I did not go that route. I built my toolchain as arm-linux-gnueabihf
> which breezed right past the issue on that other bug.
> 
> Did your libtool patch work for you? I'm using glibc on my end looks like
> I'll need to make a few tweaks.

I tried to go the route you went before I fully understood the libgpg-error bug. 
 I tried building my toolchain as arm-pip-linux-gnueabihf (would not have worked around the libgpg-error bug), but the toolchain build itself failed when trying to build glibc with the stage1.  It looked like it didn't like the "arm" part.  Anyway it's working now so I'm not going to mess with it!

Which libtool patch are you talking about? For this package?  The libtool-elt patch attached here must be part of the package in portage...because I didn't add it.
Comment 19 Joe Harvell 2018-04-24 04:11:22 UTC
(In reply to Ryan James from comment #17)
> I am encountering this bug also. Note since you brought up the libgpg-error
> patch I did not go that route. I built my toolchain as arm-linux-gnueabihf
> which breezed right past the issue on that other bug.
> 
> Did your libtool patch work for you? I'm using glibc on my end looks like
> I'll need to make a few tweaks.

I just sent you an email about cross building an ARM system on Gentoo that's not directly related to this bug.
Comment 20 Joe Harvell 2018-04-24 04:54:51 UTC
Created attachment 528372 [details, diff]
diff of ebuild that fixes the problem

I was able to modify the ebuild to make it work properly in a cross environment.  I just changed ${EPREFIX} to ${EROOT}.  This should work for either cross or prefix Gentoo.  See https://wiki.gentoo.org/wiki/Project:Prefix/Technical_Documentation#EPREFIX_variable
Comment 21 Joe Harvell 2018-04-24 05:38:43 UTC
(In reply to Joe Harvell from comment #18)
> (In reply to Ryan James from comment #17)
> > I am encountering this bug also. Note since you brought up the libgpg-error
> > patch I did not go that route. I built my toolchain as arm-linux-gnueabihf
> > which breezed right past the issue on that other bug.
> > 
> > Did your libtool patch work for you? I'm using glibc on my end looks like
> > I'll need to make a few tweaks.
> 
> I tried to go the route you went before I fully understood the libgpg-error
> bug. 
>  I tried building my toolchain as arm-pip-linux-gnueabihf (would not have
> worked around the libgpg-error bug), but the toolchain build itself failed
> when trying to build glibc with the stage1.  It looked like it didn't like
> the "arm" part.  Anyway it's working now so I'm not going to mess with it!
> 
> Which libtool patch are you talking about? For this package?  The
> libtool-elt patch attached here must be part of the package in
> portage...because I didn't add it.

Correcton.  I had tried to build the toolchain as armv7-pip-linux-gnueabihf, not arm-pip-linux-gnueabihf.
Comment 22 Alon Bar-Lev (RETIRED) gentoo-dev 2018-04-27 07:53:43 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 23 Joe Harvell 2018-04-27 16:39:20 UTC
Alon, the patch is to the ebuild.  Are you saying that upstream maintains the ebuild?
Comment 24 Alon Bar-Lev (RETIRED) gentoo-dev 2018-04-27 16:53:06 UTC
(In reply to Joe Harvell from comment #23)
> Alon, the patch is to the ebuild.  Are you saying that upstream maintains
> the ebuild?

sorry, applied.
please understand that the bugs database is not scratch pad, especially for niche issues like cross-compile, please provide a focused description of downstream issues.
you already opened too many upstream specific issues that it is very hard to keep track after the relevant fixes.
Comment 25 Larry the Git Cow gentoo-dev 2018-04-27 16:53:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbed82e27825480ab0c3b75d18042e9829bb359f

commit fbed82e27825480ab0c3b75d18042e9829bb359f
Author:     Alon Bar-Lev <alonbl@gentoo.org>
AuthorDate: 2018-04-27 16:50:16 +0000
Commit:     Alon Bar-Lev <alonbl@gentoo.org>
CommitDate: 2018-04-27 16:50:16 +0000

    dev-libs/libgcrypt: fix cross compile with libgpg-error
    
    Closes: https://bugs.gentoo.org/show_bug.cgi?id=653930
    Thanks-To: Joe Harvell

 dev-libs/libgcrypt/libgcrypt-1.8.2-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 26 Joe Harvell 2018-04-27 18:09:09 UTC
(In reply to Alon Bar-Lev from comment #24)
> (In reply to Joe Harvell from comment #23)
> > Alon, the patch is to the ebuild.  Are you saying that upstream maintains
> > the ebuild?
> 
> sorry, applied.
> please understand that the bugs database is not scratch pad, especially for
> niche issues like cross-compile, please provide a focused description of
> downstream issues.
> you already opened too many upstream specific issues that it is very hard to
> keep track after the relevant fixes.

Thanks for the fix.

Just to clarify.  If I find a bug in the future that I know to be only upstream, do you want a Gentoo bug report to track it or not?

I understand you also want a better summary.
Comment 27 Kristian Fiskerstrand (RETIRED) gentoo-dev 2018-04-27 18:23:25 UTC
(In reply to Joe Harvell from comment #26)
> (In reply to Alon Bar-Lev from comment #24)
> > (In reply to Joe Harvell from comment #23)
> > > Alon, the patch is to the ebuild.  Are you saying that upstream maintains
> > > the ebuild?
> > 
> > sorry, applied.
> > please understand that the bugs database is not scratch pad, especially for
> > niche issues like cross-compile, please provide a focused description of
> > downstream issues.
> > you already opened too many upstream specific issues that it is very hard to
> > keep track after the relevant fixes.
> 
> Thanks for the fix.
> 
> Just to clarify.  If I find a bug in the future that I know to be only
> upstream, do you want a Gentoo bug report to track it or not?
> 
> I understand you also want a better summary.

It depends a bit on the context. Having a bug downstream makes it easier to locate the upstream bug, so in particular if an issue might stay open for a while, it is nice to have a collection of workarounds and patches downstream that users can apply.

If only filing one bug, it should be upstream as that is where the fix should ultimately land. We try to avoid carrying downstream patches that aren't very specific to Gentoo, in particular for security related packages (although build issues are likely easier to accept than a change in rng etc..)