Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] qemu-arm in chroot: emerge doesn't start
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
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3025
Location: de

PostPosted: Sat Aug 20, 2016 6:04 pm    Post subject: [solved] qemu-arm in chroot: emerge doesn't start Reply with quote

Hi!

With some trouble and a lot of learning I got the chroot for arm running using this guide. I created with qemu-img a disk container, unpacked the arm stage3 tarball into it and mounted this container to /usr/armv7a-hardfloat-linux-gnueabi. After installing qemu-arm (static) to the root path of this environment and starting binfmt I tried to compile the system.

emerge -1u ncurses:

* IMPORTANT: 10 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

Calculating dependencies... done!

The following packages are causing rebuilds:

  (sys-libs/ncurses-6.0-r1:0/6::gentoo, ebuild scheduled for merge) causes rebuilds for:
    (sys-apps/util-linux-2.28:0/0::gentoo, ebuild scheduled for merge)
    (app-editors/nano-2.6.1:0/0::gentoo, ebuild scheduled for merge)
    (sys-apps/openrc-0.21.3:0/0::gentoo, ebuild scheduled for merge)
    (sys-apps/less-483-r1:0/0::gentoo, ebuild scheduled for merge)
  (net-firewall/iptables-1.6.0:0/11::gentoo, ebuild scheduled for merge) causes rebuilds for:
    (sys-apps/iproute2-4.6.0:0/0::gentoo, ebuild scheduled for merge)

And at this point it hangs. Qemu-arm runs with 100% of cpu-last on one core. Even if I let it working for a couple of hours, nothing changes.

My make.conf:
Code:
# CPU: 88F6810  http://www.marvell.com/embedded-processors/armada-38x/
# CPU: ARMv7 Cortex-A9 Single Core with NEON
# cpuinfo: ARMv7 Processor rev 1 (v7l)
# Features: swp half thumb fastmult vfp edsp neon vfpv3 tls
# Ethernet: 2 x 1/2.5G bE
# PCIe: 3x PCIe 2.0 x1
# USB: 2x USB3, 1x USB2
# UART: 2x
# SATA: 2x SATA3
# Device Bus: 8/16 bit Device bus

# https://community.arm.com/groups/tools/blog/2013/04/15/arm-cortex-a-processors-and-gcc-command-lines
# Auto-Vectorizer: nur mit -O3 oder -Ofast (enthält -O3)
# aapcs=ABI standard
# keine Virtualisierung
# Architektur: armv7-a = Cortex-a9
#CFLAGS="-Ofast -march=armv7-a -mtune=cortex-a9 -pipe -fomit-frame-pointer"
CFLAGS="-Ofast -march=armv7-a -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST=armv7a-hardfloat-linux-gnueabi

ACCEPT_KEYWORDS="arm ~arm"
MAKEOPTS="-j13"
#EMERGE_DEFAULT_OPTS="--jobs=12 --load-average=12"

# /var/tmp/portage
PORTAGE_TMPDIR=/var/tmp/

# Distfiles-Directory
DISTDIR=/var/portage/distfiles

# Binaries
PKGDIR=${PORTDIR}/packages

AUTOCLEAN="yes"
FEATURES="-collision-protect sandbox buildpkg noman noinfo nodoc"
PORTAGE_NICENESS="3"

USE="${ARCH} -pam -acl -avahi -consolekit -cracklib -cron -dso -dv -emboss -fam -firefox -gdbm -gnome -ipv6 -ldap -libav -libcanberra -modemmanager -pm-utils -pulseaudio -qt-static -vlc -kde"

GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://gentoo.mneisen.org/ http://de-mirror.org/distro/gentoo/ http://gentoo.supp.name/ http://gentoo.krasko.sk/"


############### Zeug aus Cross-Compiling-Umgebung ##########
#CBUILD=x86_64-pc-linux-gnu
#ARCH="arm"
#
#HOSTCC=x86_64-pc-linux-gnu-gcc
#
#ROOT=/usr/${CHOST}/
#CCFULL=/usr/x86_64-pc-linux-gnu/armv7a-hardfloat-linux-gnueabi/gcc-bin/4.9.3/armv7a-hardfloat-linux-gnueabi-gcc
##CCFULL=/usr/x86_64-pc-linux-gnu/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0/armv7a-hardfloat-linux-gnueabi-gcc
#CC=${CCFULL}-gcc
#CXX=${CCFULL}-g++
#######################################

# Be sure we dont overwrite pkgs from another repo..
PKGDIR=${ROOT}packages/

ELIBC="glibc"

PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/"
#PORTDIR_OVERLAY="/usr/portage/local/"


Is there something misconfigured in my make.conf?


Last edited by musv on Sun Aug 21, 2016 9:28 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 36550
Location: 56N 3W

PostPosted: Sat Aug 20, 2016 6:20 pm    Post subject: Reply with quote

musv,

100% of one core is running the arm CPU emulator.

I suspect qemu-arm only emulates a single arm core. Look in /proc/cpuinfo.
Your emulated CPU BOGOmips may make your eyes water too.
Compare it to the target system.

Code:
MAKEOPTS="-j13"
should be
Code:
MAKEOPTS="-j2"
but its not building anything yet.

Allowing for the number of emulated cores you have and the BOGOmips drop, you can make a guess at how slow it will be.

In my experience 100% of a 3.4GHz core got me a 200MHz SPARC.
There is no reason to expect arm to be any better.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3025
Location: de

PostPosted: Sun Aug 21, 2016 9:27 am    Post subject: Reply with quote

Quote:
I suspect qemu-arm only emulates a single arm core.

Yes and no. Found out, if you have MAKEOPTS higher than one, then there are multiple qemu-arm processes.

But the problem was something different.

My idea was:
  • inside chroot just call: emerge foo bar
  • cross-compile from outside: ROOT=/usr/arm... CHOST=... armv7a-hardfloat-linux-gnueabi-emerge foo bar


This isn't working. For some reason I don't understand yet, emerge fails in this way and keeps hanging. Instead you need to set the full cross-compile environment in the chroot make.conf and modify some stuff if you want to compile inside the chroot. More clearly:
  • inside chroot: ROOT=/ CC=armv7a-hardfloat-linux-gnueabi-gcc CXX=armv7a-hardfloat-linux-gnueabi-g++ emerge foo bar
  • cross-compile from outside: armv7a-hardfloat-linux-gnueabi-emerge foo bar
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