Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
qemu-system-aarch64
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
honeymak
Guru
Guru


Joined: 30 Dec 2002
Posts: 481

PostPosted: Tue Jun 13, 2017 6:29 am    Post subject: qemu-system-aarch64 Reply with quote

Hi Guys,
I have installed qemu-system-aarch64 in my workstation.
I want to setup a guest of aarch64.
But virt-manager requires an install media. What can I specify there?

Thanks.
:oops:
_________________
hackers - make sth real
academics - read sth said to be real
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Jun 13, 2017 8:42 am    Post subject: Reply with quote

honeymak,

Don't do it quite like that.

There is a wealth of information in the Embedded Handbook
In particular, Compiling with qemu user chroot

In summary, build app-emulation/qemu statically on your amd64 or whatever.
Make a chroot directory for your aarch64 install.
Unpack the aarch64 stage3 there.
Install the static qemu into the aarch64 install.
Now chroot into the aarch64 install.

If all is well, it works because the static qeum in the chroot is emulating an arm64 CPU which is running the arm64 code in the chroot.
Its very slow because software emulation of a CPU is slow. Slower than a real Raspberry Pi.
I discovered that at least one essemtial ioctrl was missing, so
Code:
emerge -K ...
to install an existing arm64 binary locked up with an error message.
That might have been fixed by now.
_________________
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
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Thu Jan 25, 2018 1:36 pm    Post subject: Reply with quote

Hi Team,

I have a cheap Amlogic 905W box and wanted to speedup compilation somehow.

I have setup qemu chroot as per Embedded Handbook wiki and I can chroot into it without problems using qemu-system-aarch64.
However - 'emerge -v ccache' takes about 20 minutes on AMD 8320 octa core, 3.5GHz (getting syscalls errors but thats another thing).

1) Is such long time normal for qemu chroot or i'm doing something wrong?

2) I guess the cross-compiled method is much faster but also creates more troubles related to setup/configuration (separate portage, etc)?

3) Is native compiling the best method to achieve reasonably good speed and to avoid syscalls/configuration issues?
How long would it take to compile e.g. firefox on 905W box (A53 quad core, 2GB RAM)?

Thank you for any help provided.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Jan 25, 2018 4:08 pm    Post subject: Reply with quote

fanthom,

You will have a
Code:
/usr/aarch64-unknown-linux-gnu/etc/portage/
that applies inside the chroot.
It is almost but not quite right for cross compiling with emerge-wrapper too.

I did some benchmarking with a Raspberry Pi and glibc and various build methods.

Quote:
1) Is such long time normal for qemu chroot or i'm doing something wrong?

ccache causes all sorts of build issues. I avoid it.

Quote:
2) I guess the cross-compiled method is much faster but also creates more troubles related to setup/configuration (separate portage, etc)?

Its much faster when it works. The setup is almost free.

Quote:
3) Is native compiling the best method to achieve reasonably good speed and to avoid syscalls/configuration issues?
How long would it take to compile e.g. firefox on 905W box (A53 quad core, 2GB RAM)?

If native compiling includes cross distcc with pump mode, its the fastest' again when it works.
Firefox needs you to build rust and caro. Rust has its own llvm and it want to build every target. Also, the rust build system does not respect your MAKEOPTS, it just counts cores.
That broken when you have less than 1GB RAM per core. There are several fixed ebuilds for rust on the net
_________________
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
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Thu Jan 25, 2018 7:18 pm    Post subject: Reply with quote

Great stuff - thank you for sharing.

I see compiling glibc took 50 minutes on your qemu chroot while on my one ccache (very small package) took nearly 20 minutes!
I guess there is something wrong with my setup. Must find out whats causing this ....

Thanks
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Jan 25, 2018 7:34 pm    Post subject: Reply with quote

fanthom,

Here's my QEMU chroot make.conf

The
Code:
PYTHON_SINGLE_TARGET="python3_4"
PYTHON_TARGETS="python2_7 python3_4"
entries need to be removed.
_________________
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
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Fri Jan 26, 2018 6:56 pm    Post subject: Reply with quote

I have given up with qemu chroot (due to slowness and syscall errors) and using cross compilation now. Works like a charm except for few errors and keywording :)

Thank you for all the help provided Neddy. I'm sure i'll come back with other questions.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Jan 26, 2018 8:18 pm    Post subject: Reply with quote

fanthom,

Keywording ???

File pull requests or bugs. Join #gentoo-arm on irc.freenode.net
_________________
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
fanthom
n00b
n00b


Joined: 31 May 2007
Posts: 60

PostPosted: Sat Jan 27, 2018 10:20 pm    Post subject: Reply with quote

Initially i was hoping to use stable packages but this is not possible on arm64. After fighting with keywords i given up and used default[/code]:
Code:
ACCEPT_KEYWORDS="arm64 ~arm64"


Thanks
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Jan 27, 2018 10:46 pm    Post subject: Reply with quote

fanthom,

arm64 is considered an experimental arch on Gentoo.

Code:
ACCEPT_KEYWORDS="arm64 ~arm64"
is a good start.
Only the packages in the stage3 are marked stable, or the stage3 build process won't work.

Don't be afraid to use your package.accept_keywords/ directory. Lots of things work, just nobody knows yet.
_________________
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
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM 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