-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a |make config-emu| target for android emulator #25
Comments
I got an error message to complain that `stmfd sp!,{r0-r4}' is not supported by ARMv5 when I try to build Gecko for qemu. It is a line of inline assembly in linker.c. Why we need a copy of linker (from bionic?) here? Is it for implementing plugin? 'stmfd' and 'ldmia' in the linker.c:plt_reloc() should be replaced by other instructions supported by ARMv5. Submodule boot/kernel-android-qemu is not in goldfish branch for Android emulator. |
The reason we use a custom linker in Gecko is long and complicated; ask @michaelwu to tell you the story sometime ;). To fix that particular bug, you need to make a custom .mozconfig for the emulator that disables use of THUMB (and also forces ARMv5, IIRC). It needs to include these options ac_add_options --disable-thumb2 This new mozconfig can live in config/gecko-emulatorv5-gonk. Alternatively, if you run into a lot of ARM bugs inside the emulator, it might be a better use of time to import a newer ARMv7-compatible version of qemu. |
I have booted B2G with Android emulator. But, it stop at "Setting up Fennec...", it hanged. Current configuration is with ARMv7 for Gecko, but Android image was built for ARMv5. It seems workable. I will figure out what make it hanged later. |
Gonk is now ARMv6 + vfpv2 for Android emulator. But, gdb and gdbserver seem having no consensus on architecture of a debugged target. I am trying to find out a solution for remote debugging and will go back to hanging issue later. |
Nice work! |
I have a resolution for GDB issue, now. gdb-7.x provides a way to specify architecture features. You should set a target description file for GDB when you debug B2G for Android emulator. For example,
arm-with-iwmmxt.xml is provided by gdb in the gdb/features/ sub-directory. It makes gdb to support XScale features. Without this, gdbserver would send more data than expected when gdb requests for register values. To enable target description, you must build gdb-7.x with --with-expat option. I use gdb-7.3 from moz-gdb @ https://wiki.mozilla.org/Mobile/Fennec/Android/GDB. But, this version has a litte bug in configure/configure.ac that you can not cross-compile without dirty hacking. I have a fixed version @ git://github.com/ThinkerYzu/android-gdb.git. Following is my configuration command
|
Get SIGILL with si_code == ILL_ILLOPC. It means running an illegal instruction. I will try to add these instructions for Android emulator. |
I have switched Android emulator to tools_r13 branch. There is ARMv7 supporting code in the branch. But, it hangs at some place once boot it with any CPU model other than "arm926" (default one). |
Kernel can not recoganize CPU type for cortex-a8. Try to add proc_info for it from existing ones. |
It is successful to run B2G on Android emulator with ARMv7. Use goldfish_armv7_defconfig instead of goldfish_defconfig to config Linux. After building B2G with config-qemu, you can run Android emulator with following command for B2G.
This command runs Android emulator with 'cortex-a8'. |
Fantastic, nice work! :) Would you like to create a pull request for these changes? Andreas and I will be in the office this afternoon so we can discuss this in person. |
@ThinkerYzu want to close this issue? This works great for me! :) |
ok... Let's close it. |
B2G should be testable on top of (an) emulator for folks who don't have compatible hardware. Right now using the android emulator seems like the quickest path to success, but unfortunately it only supports up to ARMv6. That's a problem because Gecko is officially unsupported on ARMv6 and below.
The other complications can be dealt with indepedently of the build-system work to support the emulator target though.
The text was updated successfully, but these errors were encountered: