Patch fixes the following error that occurs when cross-compiling sys-apps/kbd-1.12* for powerpc: =============================================== >>> Source unpacked. >>> Compiling source in /var/tmp/portage/kbd-1.12-r6/work/kbd-1.12 ... Configuring for PREFIX=/usr Configuring for DATADIR=/usr/share Configuring for MANDIR=/usr/share/man checking for gcc You have <locale.h> NLS disabled Done. You can run make now. for i in src openvt po data; do make -C $i all || exit 1; done make[1]: Entering directory `/var/tmp/portage/kbd-1.12-r6/work/kbd-1.12/src' powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" dumpkeys.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" ksyms.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" xmalloc.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" getfd.c bison -y loadkeys.y flex -8 -t analyze.l > analyze.c mv -f y.tab.c loadkeys.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" findfile.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" showkey.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" setfont.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" mapscrn.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" loadunimap.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" kdmapop.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" kdfontop.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" psffontop.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" utf8.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" showconsolefont.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" setleds.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" setmetamode.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" kbd_mode.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" chvt.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" deallocvt.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" psfxtable.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" kbdrate.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" fgconsole.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" getkeycodes.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" setkeycodes.c powerpc-softfloat-linux-uclibc-gcc -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -pipe -DDATADIR=\"/usr/share\" resizecons.c powerpc-softfloat-linux-uclibc-gcc -Os -pipe -Wall -Wmissing-prototypes -Wstrict-prototypes -DDATADIR=\"/usr/share\" -DMAIN -c mapscrn.c -o main_mapscrn.o resizecons.c:81:22: sys/perm.h: No such file or directory resizecons.c: In function `vga_init_io': resizecons.c:373: warning: implicit declaration of function `iopl' resizecons.c: In function `vga_set_cursor': resizecons.c:354: error: impossible constraint in `asm' resizecons.c:361: error: impossible constraint in `asm' resizecons.c:354: error: impossible constraint in `asm' resizecons.c:354: error: impossible constraint in `asm' resizecons.c:361: error: impossible constraint in `asm' resizecons.c:354: error: impossible constraint in `asm' make[1]: *** [resizecons.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/var/tmp/portage/kbd-1.12-r6/work/kbd-1.12/src' make: *** [all] Error 1 !!! ERROR: sys-apps/kbd-1.12-r6 failed. Call stack: ebuild.sh, line 1527: Called dyn_compile ebuild.sh, line 931: Called src_compile kbd-1.12-r6.ebuild, line 84: Called die !!! emake failed !!! If you need support, post the topmost build error, and the call stack if relevant.
Created attachment 87111 [details, diff] kbd-1.12-xcompile-fix.patch
Submitted patch upstream. The maintainer acknowledged receipt but hasn't yet communicated what action, if any, he intends to take. So this one's still up in the air.
Comment on attachment 87111 [details, diff] kbd-1.12-xcompile-fix.patch sorry, patch is no good it'd break on i486/i586/i686 targets as well as sparc64 see the src Makefile where ARCH is actually used
(In reply to comment #3) > (From update of attachment 87111 [details, diff] [edit]) > sorry, patch is no good > > it'd break on i486/i586/i686 targets as well as sparc64 > > see the src Makefile where ARCH is actually used With respect to i486/i586/i686 targets, this patch behaves *exactly* as the original code behaved, which was: ARCH=`uname -m | sed s/i.86/i386/` echo "ARCH=$ARCH" >> make_include As you can see the original behavior was to collapse all x86 target strings to "i386", so this is what the replacement code emulates. This patch doesn't attempt to change that behavior because that's not the issue it addresses. File a separate bug on the original x86 target behavior if it's a problem. As for sparc64 targets, that issue was considered and the folks on #gentoo-sparc were consulted. However, the sparc64 weirdness is present even without this patch, thus sparc64 handling is an entirely seperate issue that this patch has no business trying to address--file a new bug for that.
Created attachment 88402 [details, diff] kbd-1.12-xcompile.patch Here's another attempt. Hopefully it moots the concerns raised by the previous patch. This one proceeds from the assumption that kbd should build the binaries "getkeycodes" and "setkeycodes" for all 64-bit SPARC CPUs (regardless of whether they're running 32 or 64 bit userland), and should not build them for 32-bit SPARC CPUs. (I've attempted to avoid Bash-isms in the code just in case upstream wants to incorporate this patch.)
Fixed in kbd-1.12-r7 ~arch