Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gcc inside qemu chroot (mipsel-softfloat-linux-gnu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
snikkers
n00b
n00b


Joined: 25 Jan 2012
Posts: 15

PostPosted: Mon Dec 31, 2012 2:41 pm    Post subject: gcc inside qemu chroot (mipsel-softfloat-linux-gnu) Reply with quote

hi there,

i've built a basic rootfs (mipsel-softfloat-linux-gnu) which is used for my tests with qemu-user (chroot). i'm able to chroot but binaries built within this environment refuse to run. look at this:

Code:

skynet mipsel-softfloat-linux-gnu # chroot .
skynet / # ls
bin  dev  etc  lib  packages  proc  root  run  sbin  sys  sys-include  tmp  usr  var
skynet / # cd root/
skynet ~ # gcc -v test.c -o test
Using built-in specs.
COLLECT_GCC=/usr/mipsel-softfloat-linux-gnu/gcc-bin/4.6.2/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/mipsel-softfloat-linux-gnu/4.6.2/lto-wrapper
Target: mipsel-softfloat-linux-gnu
Configured with: /usr/mipsel-softfloat-linux-gnu/tmp/portage/sys-devel/gcc-4.6.2/work/gcc-4.6.2/configure --prefix=/usr --bindir=/usr/mipsel-softfloat-linux-gnu/gcc-bin/4.6.2 --includedir=/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/include --datadir=/usr/share/gcc-data/mipsel-softfloat-linux-gnu/4.6.2 --mandir=/usr/share/gcc-data/mipsel-softfloat-linux-gnu/4.6.2/man --infodir=/usr/share/gcc-data/mipsel-softfloat-linux-gnu/4.6.2/info --with-gxx-include-dir=/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/include/g++-v4 --host=mipsel-softfloat-linux-gnu --target=mipsel-softfloat-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-lto --with-float=soft --disable-nls --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --disable-multilib --disable-libmudflap --disable-libssp --disable-libgomp --with-python-dir=/share/gcc-data/mipsel-softfloat-linux-gnu/4.6.2/python --enable-checking=release --disable-libgcj --enable-libstdcxx-time --disable-libquadmath --with-abi= --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.6.2 p1.5, pie-0.5.0'
Thread model: posix
gcc version 4.6.2 (Gentoo 4.6.2 p1.5, pie-0.5.0)
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-msoft-float' '-mllsc' '-mno-synci' '-mno-shared'
 /usr/libexec/gcc/mipsel-softfloat-linux-gnu/4.6.2/cc1 -quiet -v test.c -quiet -dumpbase test.c -msoft-float -mllsc -mno-synci -mno-shared -auxbase test -version -o /tmp/ccMHS3lB.s
GNU C (Gentoo 4.6.2 p1.5, pie-0.5.0) version 4.6.2 (mipsel-softfloat-linux-gnu)
        compiled by GNU C version 4.6.2, GMP version 5.1.0, MPFR version 3.1.1-p2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../../mipsel-softfloat-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/include
 /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/include-fixed
 /usr/include
End of search list.
GNU C (Gentoo 4.6.2 p1.5, pie-0.5.0) version 4.6.2 (mipsel-softfloat-linux-gnu)
        compiled by GNU C version 4.6.2, GMP version 5.1.0, MPFR version 3.1.1-p2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: a900afc6ed4eacab2b5971a2a41ea48d
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-msoft-float' '-mllsc' '-mno-synci' '-mno-shared'
 /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../../mipsel-softfloat-linux-gnu/bin/as -EL -no-mdebug -mabi=32 -mno-shared -KPIC -o /tmp/ccGgHIBj.o /tmp/ccMHS3lB.s
COMPILER_PATH=/usr/libexec/gcc/mipsel-softfloat-linux-gnu/4.6.2/:/usr/libexec/gcc/mipsel-softfloat-linux-gnu/4.6.2/:/usr/libexec/gcc/mipsel-softfloat-linux-gnu/:/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/:/usr/lib/gcc/mipsel-softfloat-linux-gnu/:/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../../mipsel-softfloat-linux-gnu/bin/
LIBRARY_PATH=/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/:/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../../mipsel-softfloat-linux-gnu/lib/:/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-msoft-float' '-mllsc' '-mno-synci' '-mno-shared'
 /usr/libexec/gcc/mipsel-softfloat-linux-gnu/4.6.2/collect2 --eh-frame-hdr -EL -dynamic-linker /lib/ld.so.1 -o test /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../crt1.o /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../crti.o /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/crtbegin.o -L/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2 -L/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../../mipsel-softfloat-linux-gnu/lib -L/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../.. /tmp/ccGgHIBj.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/crtend.o /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.6.2/../../../crtn.o
skynet ~ # ./test
bash: ./test: cannot execute binary file
skynet ~ # ls -la /lib/ld*
-rwxr-xr-x 1 root root 146096 Dec 26 13:03 /lib/ld-2.14.1.so
-rwxr-xr-x 1 root root 146200 Dec 26 13:28 /lib/ld-2.16.so
lrwxrwxrwx 1 root root     10 Dec 31 14:01 /lib/ld.so.1 -> ld-2.16.so
skynet ~ # gcc-config -l
 * Python seems to be broken, attempting to locate CHOST ourselves ...
/usr/bin/gcc-config: line 787: awk: command not found
/usr/bin/gcc-config: line 608: awk: command not found
 * gcc-config: Profile does not exist or invalid setting for /etc/env.d/gcc/mipsel-softfloat-linux-gnu-4.6.2
 [1] mipsel-softfloat-linux-gnu-4.6.2 *
skynet ~ # gcc -static test.c -o test
skynet ~ # exit
exit
skynet mipsel-softfloat-linux-gnu # qemu-static-mipsel root/test
Hello world!
skynet mipsel-softfloat-linux-gnu #


i have no python atm so gcc-config won't work for now.

Code:

skynet mipsel-softfloat-linux-gnu # mipsel-softfloat-linux-gnu-emerge --info
Portage 2.1.11.9 (arch/mips/mipsel, gcc-4.6.2, unavailable, 3.5.7-gentoo x86_64)
=================================================================
System uname: Linux-3.5.7-gentoo-x86_64-Intel-R-_Core-TM-_i7-2600K_CPU_@_3.40GHz-with-gentoo-2.1
Timestamp of tree: Wed, 26 Dec 2012 13:30:01 +0000
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9-r1
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.4.7, 4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo hasufell maggu2810-overlay
ACCEPT_KEYWORDS="mips ~mips"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -pipe  -fomit-frame-pointer"
CHOST="mipsel-softfloat-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
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"
CXXFLAGS="-Os -pipe  -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles news nodoc noinfo noman parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS=""
MAKEOPTS="-j8"
PKGDIR="/usr/mipsel-softfloat-linux-gnu/packages/"
PORTAGE_CONFIGROOT="/usr/mipsel-softfloat-linux-gnu/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/usr/mipsel-softfloat-linux-gnu/tmp/"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/hasufell /var/lib/layman/maggu2810-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="bindist cracklib cxx make-symlinks minimal mips modules zlib" ALSA_CARDS="au1x00" 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="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="fbdev impact newport" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


any hints / ideas how to fix it?
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 438

PostPosted: Thu Jan 03, 2013 5:06 pm    Post subject: Reply with quote

can you dig a bit why 'test' is apparently an invalid binary? What libraries does it pull in, what format is it?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum