Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653938 - app-crypt/pinentry-1.1.0-r1: cross build fails: tries to use unavailable 64bit libraries for libcap and libncursesw
Summary: app-crypt/pinentry-1.1.0-r1: cross build fails: tries to use unavailable 64bi...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Mikle Kolyada (RETIRED)
URL: https://dev.gnupg.org/T3949
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks:
 
Reported: 2018-04-24 05:25 UTC by Joe Harvell
Modified: 2021-02-07 14:22 UTC (History)
4 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 05:25 UTC, Joe Harvell
Details
output of sudo emerge --info (emerge-info.txt,6.39 KB, text/plain)
2018-04-24 05:26 UTC, Joe Harvell
Details
build.log (build.log,25.86 KB, text/plain)
2018-04-24 05:28 UTC, Joe Harvell
Details
eclass-debug.log (eclass-debug.log,2.93 KB, text/plain)
2018-04-24 05:28 UTC, Joe Harvell
Details
environment (environment,104.22 KB, text/plain)
2018-04-24 05:28 UTC, Joe Harvell
Details
elibtool.log (elibtool.log,699 bytes, text/plain)
2018-04-24 05:29 UTC, Joe Harvell
Details
config.log (config.log,63.00 KB, text/plain)
2018-04-24 05:29 UTC, Joe Harvell
Details
configure (configure,370.33 KB, text/plain)
2018-04-24 05:30 UTC, Joe Harvell
Details
autoheader.out (autoheader.out,193 bytes, text/plain)
2018-04-24 05:30 UTC, Joe Harvell
Details
automake.out (automake.out,244 bytes, text/plain)
2018-04-24 05:31 UTC, Joe Harvell
Details
autoconf.out (autoconf.out,266 bytes, text/plain)
2018-04-24 05:31 UTC, Joe Harvell
Details
aclocal.out (aclocal.out,262 bytes, text/plain)
2018-04-24 05:31 UTC, Joe Harvell
Details
libtool-elt.patch (libtool-elt.patch,831 bytes, text/plain)
2018-04-24 05:32 UTC, Joe Harvell
Details
fix path where configure looks for gpg-error-config relative to SYSROOT (gpg-error-config-sysroot-path.patch,773 bytes, patch)
2018-04-24 18:52 UTC, Joe Harvell
Details | Diff
fix path where configure looks for libassuan-config relative to SYSROOT (libassuan-config-sysroot-path.patch,490 bytes, patch)
2018-04-24 18:54 UTC, Joe Harvell
Details | Diff
add USE flag for fltk (pinentry.ebuild.patch,869 bytes, patch)
2018-04-24 20:01 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 05:25:51 UTC
Created attachment 528374 [details]
output of sudo armv7a-pip-linux-gnueabi-emerge --info

armv7a-pip-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I..   -I/usr/include/ncursesw -I../pinentry -Wall  -march=armv7-a -mtune=cortex-a8 -mfpu=neon-vfpv3 -mfloat-abi=hard -Os 
-pipe -fomit-frame-pointer -ftree-vectorize -flto=10 -fno-lto -fno-use-linker-plugin -Wall -Wno-pointer-sign -Wpointer-arith -c -o pinentry-curses.o pinentry-curses.c
armv7a-pip-linux-gnueabi-gcc  -march=armv7-a -mtune=cortex-a8 -mfpu=neon-vfpv3 -mfloat-abi=hard -Os -pipe -fomit-frame-pointer -ftree-vectorize -flto=10 -fno-lto -fno-use-
linker-plugin -Wall -Wno-pointer-sign -Wpointer-arith  -flto=10 -fuse-ld=gold -fuse-linker-plugin -fno-lto -fno-use-linker-plugin -o pinentry-curses pinentry-curses.o ../p
inentry/libpinentry.a ../pinentry/libpinentry-curses.a ../secmem/libsecmem.a -L/usr/lib64 -lassuan -lgpg-error -lgpg-error  -lcap -lncursesw  
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: warning: skipping incompatible /usr/lib64/libassuan.so while searching for assuan
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: warning: skipping incompatible /usr/lib64/libgpg-error.so while searching for gpg-error
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: warning: skipping incompatible /usr/lib64/libgpg-error.so while searching for gpg-error
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: /lib64/libcap.so.2: incompatible target
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: /lib64/libncursesw.so.6: incompatible target
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: warning: skipping incompatible /usr/lib64/libc.so while searching for c


followed by lots of undefined references to symbols that actually are present in /usr/lib/libcap.so and /usr/lib/libncurses.so.
joey@akita package.env$ ls -l /usr/armv7a-pip-linux-gnueabi/usr/lib/libncurses.so /usr/armv7a-pip-linux-gnueabi/usr/lib/libcap.so 
-rwxr-xr-x 1 root root 494 22 avril 20:25 /usr/armv7a-pip-linux-gnueabi/usr/lib/libcap.so
-rwxr-xr-x 1 root root 498 22 avril 19:50 /usr/armv7a-pip-linux-gnueabi/usr/lib/libncurses.so

Apparently adding -L/usr/lib64 makes the linker (ld.gold in this case) fail to search in /usr/lib.  -L/usr/lib64 should *not* be in the argument list.  Not sure which eclass is responsible for this.  I don'tthink this is even related to the fact that this is a cross build.  Seems like it just doesn't work for 32bit ABI builds.
Comment 1 Joe Harvell 2018-04-24 05:26:21 UTC
Created attachment 528376 [details]
output of sudo emerge --info
Comment 2 Joe Harvell 2018-04-24 05:28:03 UTC
Created attachment 528378 [details]
build.log
Comment 3 Joe Harvell 2018-04-24 05:28:27 UTC
Created attachment 528380 [details]
eclass-debug.log
Comment 4 Joe Harvell 2018-04-24 05:28:49 UTC
Created attachment 528382 [details]
environment
Comment 5 Joe Harvell 2018-04-24 05:29:15 UTC
Created attachment 528384 [details]
elibtool.log
Comment 6 Joe Harvell 2018-04-24 05:29:52 UTC
Created attachment 528386 [details]
config.log
Comment 7 Joe Harvell 2018-04-24 05:30:09 UTC
Created attachment 528388 [details]
configure
Comment 8 Joe Harvell 2018-04-24 05:30:44 UTC
Created attachment 528390 [details]
autoheader.out
Comment 9 Joe Harvell 2018-04-24 05:31:08 UTC
Created attachment 528392 [details]
automake.out
Comment 10 Joe Harvell 2018-04-24 05:31:30 UTC
Created attachment 528394 [details]
autoconf.out
Comment 11 Joe Harvell 2018-04-24 05:31:51 UTC
Created attachment 528396 [details]
aclocal.out
Comment 12 Joe Harvell 2018-04-24 05:32:54 UTC
Created attachment 528398 [details]
libtool-elt.patch
Comment 13 Joe Harvell 2018-04-24 18:52:44 UTC
Created attachment 528438 [details, diff]
fix path where configure looks for gpg-error-config relative to SYSROOT

This makes configure find gpg-error-config when it searches for it relative to SYSROOT.
Comment 14 Joe Harvell 2018-04-24 18:54:34 UTC
Created attachment 528440 [details, diff]
fix path where configure looks for libassuan-config relative to SYSROOT

This makes configure find libassuan-config when searching for it relative to SYSROOT
Comment 15 Joe Harvell 2018-04-24 18:58:12 UTC
The two patches above actually have the side-effect of removing -L/usr/lib64 from the command line of the compile/link.  So the link errors I describe in the original problem report go away.  Instead I get the following link errors also related to incorrectly searching for 64bit libraries.

I suggest keeping this bug open since the nature of this subsequent link error is the same.

armv7a-pip-linux-gnueabi-g++ -std=c++11 -march=armv7-a -mtune=cortex-a8 -mfpu=neon-vfpv3 -mfloat-abi=hard -Os -pipe -fomit-frame-pointer -ftree-vectorize -flto=10 -fno-lto -fno-use-linker-plugin -std=gnu++11  -flto=10 -fuse-ld=gold -fuse-linker-plugin -fno-lto -fno-use-linker-plugin -o pinentry-fltk main.o pinwindow.o passwindow.o qualitypasswindow.o ../pinentry/libpinentry.a ../secmem/libsecmem.a -lassuan -lgpg-error -lgpg-error  -lcap -L/usr/lib64/fltk -Wl,-rpath,/usr/lib64/fltk -flto=10 -fuse-ld=gold -fuse-linker-plugin -fno-lto -fno-use-linker-plugin -lfltk -lXrender -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11 ../pinentry/libpinentry-curses.a -lncursesw  
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: warning: skipping incompatible /usr/lib64/fltk/libfltk.so while searching for fltk
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lfltk
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lXrender
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lXcursor
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lXfixes
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lXext
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lXft
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lfontconfig
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lXinerama
/usr/libexec/gcc/armv7a-pip-linux-gnueabi/ld.gold: error: cannot find -lX11
main.o:main.cxx:function is_short(char const*): error: undefined reference to 'fl_utf_nb_char'
main.o:main.cxx:function fltk_cmd_handler(pinentry*): error: undefined reference to 'Fl::check()'
main.o:main.cxx:function fltk_cmd_handler(pinentry*): error: undefined reference to 'Fl_Window::Fl_Window(int, int, int, int, char const*)'
main.o:main.cxx:function fltk_cmd_handler(pinentry*): error: undefined reference to 'Fl_Window::border(int)'
main.o:main.cxx:function fltk_cmd_handler(pinentry*): error: undefined reference to 'Fl_Window::show(int, char**)'
main.o:main.cxx:function fltk_cmd_handler(pinentry*): error: undefined reference to 'Fl_Window::hide()'
main.o:main.cxx:function fltk_cmd_handler(pinentry*): error: undefined reference to 'fl_message_title(char const*)'
[snip]
Comment 16 Joe Harvell 2018-04-24 19:06:42 UTC
There is no logic to use SYSROOT to look for fltk-config.  It only searches PATH.
Comment 17 Joe Harvell 2018-04-24 20:01:26 UTC
Created attachment 528442 [details, diff]
add USE flag for fltk

This package has a configure option for --enable-pinentry-fltk, but the Gentoo ebuild has no corresponding USE flag.  I was able to disable the package's broken attempt to find fltk (broken because it doesn't respect SYSROOT) bu simply adding a USE flag and not enabling it.

With this and the previous two patches I am able to successfully build it.

Technically upstream is "broken" in that it doesn't support cross compiling without disabling fltk.
Comment 18 Alon Bar-Lev (RETIRED) gentoo-dev 2018-04-27 07:50:47 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 19 Joe Harvell 2018-04-27 17:22:03 UTC
Upstream bug report https://dev.gnupg.org/T3949
Comment 20 Xavier Miller (RETIRED) gentoo-dev 2018-05-08 08:24:37 UTC
It seems ncurses is built with the host compiler, not the target.
I will file a bug about it
Comment 21 Xavier Miller (RETIRED) gentoo-dev 2018-05-08 08:33:00 UTC
(In reply to Xavier Miller from comment #20)
> It seems ncurses is built with the host compiler, not the target.
> I will file a bug about it

never mind, ncurses is OK
Comment 22 Xavier Miller (RETIRED) gentoo-dev 2018-05-08 11:52:25 UTC
I confirm cross-compile ncurses is unusable.
You have to compile natively (or in a qemu chroot), not cross-compile it.
Comment 23 Joe Harvell 2018-05-08 16:11:17 UTC
(In reply to Xavier Miller from comment #22)
> I confirm cross-compile ncurses is unusable.
> You have to compile natively (or in a qemu chroot), not cross-compile it.

Could you provide an example of this?  I have a cross-compiled ncurses on a runnning system but have not yet noticed any problems.
Comment 24 Kristian Fiskerstrand (RETIRED) gentoo-dev 2018-05-12 15:56:46 UTC
(In reply to Joe Harvell from comment #17)
> Created attachment 528442 [details, diff] [details, diff]
> add USE flag for fltk
> 
> This package has a configure option for --enable-pinentry-fltk, but the
> Gentoo ebuild has no corresponding USE flag.  I was able to disable the
> package's broken attempt to find fltk (broken because it doesn't respect
> SYSROOT) bu simply adding a USE flag and not enabling it.

This is fixed c.f bug 655290
Comment 25 Alon Bar-Lev (RETIRED) gentoo-dev 2018-10-06 20:56:40 UTC
fltk-config does not support cross compile, upstream bug[1]

[1] http://www.fltk.org/str.php?L3497
Comment 26 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2021-02-07 14:22:38 UTC
fltk has been disabled.
Comment 27 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2021-02-07 14:22:38 UTC
fltk has been disabled.