Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257977 - sys-apps/coreutils-6.12-r2: "/bin/sh: line 2: ./ginstall: cannot execute binary file" when cross-compiling
Summary: sys-apps/coreutils-6.12-r2: "/bin/sh: line 2: ./ginstall: cannot execute bina...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-07 03:12 UTC by Jacob Godserv
Modified: 2009-02-22 00:16 UTC (History)
0 users

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


Attachments
Failed build.log (build.log,180.10 KB, text/plain)
2009-02-07 03:38 UTC, Jacob Godserv
Details
Cross-compile patch (cross-compile.patch,1.14 KB, patch)
2009-02-07 03:46 UTC, Jacob Godserv
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Godserv 2009-02-07 03:12:53 UTC
I have encountered a bug when attempting to cross-compile coreutils-6.12-r2. I will attach a failed build.log and a suggested patch shortly.

Reproducible: Always

Steps to Reproduce:




~ # cross-emerge --info
Portage 2.1.6.7 (default/linux/arm/2008.0, gcc-4.3.2, glibc-2.9_p20081201-r1, 2.6.24-19-xen x86_64)
=================================================================
System uname: Linux-2.6.24-19-xen-x86_64-Dual-Core_AMD_Opteron-tm-_Processor_2214-with-glibc2.0
Timestamp of tree: Thu, 05 Feb 2009 14:05:01 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
app-shells/bash:     3.2_p48
dev-lang/python:     2.4.4-r14
dev-python/pycrypto: 2.0.1-r7
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.1-r1
sys-apps/sandbox:    1.3.2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="arm ~arm"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe"
CHOST="armv7a-softfloat-linux-gnueabi"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CTARGET="armv7a-softfloat-linux-gnueabi"
CXXFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--buildpkg"
FEATURES="ccahe distcc distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS=""
LDFLAGS="-Wl,-O1 -L/usr/armv7a-softfloat-linux-gnueabiusr/lib -L/usr/armv7a-softfloat-linux-gnueabilib"
MAKEOPTS="-j10"
PKGDIR="/usr/local/pandora/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC=""
USE="arm berkdb bzip2 cli crypt cups fortran gdbm gpm ipv6 isdnlog midi mudflap ncurses nptl nptlonly openmp pcre perl pppd python readline reflection session spl ssl sysfs tcpd unicode xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse touchscreen" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev"
Unset:  CPPFLAGS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jacob Godserv 2009-02-07 03:38:19 UTC
Created attachment 181211 [details]
Failed build.log

The issue here is pretty simple. It builds ginstall as part of the coreutils package, and then tries to use it. Obviously that doesn't work in a cross-compile environment.

Here's a snippet of the error:
case 'uname chroot hostid nice who users pinky stty df [ chcon chgrp chown chmod cp dd dircolors du ginstall link ln dir vdir ls mkdir mkfifo mknod mktemp mv nohup readlink rm rmdir shred stat sync touch unlink cat cksum comm csplit cut expand fmt fold head join md5sum nl od paste pr ptx sha1sum sha224sum sha256sum sha384sum sha512sum shuf sort split sum tac tail tr tsort unexpand uniq wc basename date dirname echo env expr factor false id logname pathchk printenv printf pwd runcon seq sleep tee test true tty whoami yes base64 arch' in *\[*) \
          echo "./ginstall '[' '/var/tmp/portage/sys-apps/coreutils-6.12-r3/image//usr/bin/['"; \
          ./ginstall '[' '/var/tmp/portage/sys-apps/coreutils-6.12-r3/image//usr/bin/[';; esac
./ginstall '[' '/var/tmp/portage/sys-apps/coreutils-6.12-r3/image//usr/bin/['
/bin/sh: line 2: ./ginstall: cannot execute binary file
make[5]: *** [cu-install-binPROGRAMS] Error 126
make[5]: Leaving directory `/var/tmp/portage/sys-apps/coreutils-6.12-r3/work/coreutils-6.12/src'
make[4]: *** [install-exec-am] Error 2

You may notice "-r3". The only difference between -r2 and -r3 is the patch listed here: http://bugs.gentoo.org/show_bug.cgi?id=92694#c16
Comment 2 Jacob Godserv 2009-02-07 03:46:06 UTC
Created attachment 181214 [details, diff]
Cross-compile patch

This patch draws its inspiration from upstream. The "inspiration" (original patch) can be found in coreutils git, commit 9a4e22d03600c836673033089e396e141c7d1f08 <http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=9a4e22d03600c836673033089e396e141c7d1f08>

However, the original patch does not apply cleanly to coreutils-6.12-r2, so I essentially downloaded the above commit's "blob", or full file, diffed the blob with coreutils-6.12-r2's Makefile, and chopped out everything except the relevant bits.

If you apply this patch to an unmodified coreutils-6.12-r2 and try to build, it will fail on a bug entirely different than this one, with the error "help2man: can't get `--help' info from arch.td/arch". You can find the patch to make that error go away at bug #92694.
Comment 3 SpanKY gentoo-dev 2009-02-22 00:16:17 UTC
coreutils-7.1 now in the tree