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.
Created attachment 528376 [details] output of sudo emerge --info
Created attachment 528378 [details] build.log
Created attachment 528380 [details] eclass-debug.log
Created attachment 528382 [details] environment
Created attachment 528384 [details] elibtool.log
Created attachment 528386 [details] config.log
Created attachment 528388 [details] configure
Created attachment 528390 [details] autoheader.out
Created attachment 528392 [details] automake.out
Created attachment 528394 [details] autoconf.out
Created attachment 528396 [details] aclocal.out
Created attachment 528398 [details] libtool-elt.patch
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.
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
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]
There is no logic to use SYSROOT to look for fltk-config. It only searches PATH.
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.
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.
Upstream bug report https://dev.gnupg.org/T3949
It seems ncurses is built with the host compiler, not the target. I will file a bug about it
(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
I confirm cross-compile ncurses is unusable. You have to compile natively (or in a qemu chroot), not cross-compile it.
(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.
(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
fltk-config does not support cross compile, upstream bug[1] [1] http://www.fltk.org/str.php?L3497
fltk has been disabled.