Giter Site home page Giter Site logo

Comments (13)

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

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.

from b2g.

joneschrisg avatar joneschrisg commented on June 23, 2024

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
ac_add_options --with-thumb=no

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.

from b2g.

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

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.

from b2g.

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

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.

from b2g.

joneschrisg avatar joneschrisg commented on June 23, 2024

Nice work!

from b2g.

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

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,

set tdesc filename /path/to/gdb-src/gdb/features/arm-with-iwmmxt.xml

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

../configure --target=arm-linux-androideabi --with-python=yes --prefix=/root/moz-gdb --with-gdb-datadir=/root/moz-gdb/utils --with-system-gdbinit=/root/moz-gdb/utils/gdbinit --with-expat

from b2g.

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

Get SIGILL with si_code == ILL_ILLOPC. It means running an illegal instruction. I will try to add these instructions for Android emulator.

from b2g.

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

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).

from b2g.

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

Kernel can not recoganize CPU type for cortex-a8. Try to add proc_info for it from existing ones.

from b2g.

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

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.

$B2G_HOME/glue/gonk/out/host/linux-x86/bin/emulator \
    -kernel $B2G_HOME/boot/kernel-android-qemu/arch/arm/boot/zImage \
    -sysdir $B2G_HOME/glue/gonk/out/target/product/generic/ \
    -data $B2G_HOME/glue/gonk/out/target/product/generic/userdata.img \
    -memory 512 \
    -verbose \
    -qemu -cpu 'cortex-a8'

This command runs Android emulator with 'cortex-a8'.
You can pull changes, of B2G for Android emulator, from git://github.com/ThinkerYzu/B2G.git.

from b2g.

joneschrisg avatar joneschrisg commented on June 23, 2024

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.

from b2g.

joneschrisg avatar joneschrisg commented on June 23, 2024

@ThinkerYzu want to close this issue? This works great for me! :)

from b2g.

ThinkerYzu avatar ThinkerYzu commented on June 23, 2024

ok... Let's close it.

from b2g.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.