ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.18k stars 220 forks source link

Question about ODROID target #962

Open MichaIng opened 1 month ago

MichaIng commented 1 month ago

For which particular Odroid SBC is the ODROID target meant?

It sets build flags for ARM Cortex-A9 and VFPv4, which seems conflicting, since the Cortex-A9 supports VFPv3 only and optionally: https://en.wikipedia.org/wiki/Comparison_of_ARM_processors#ARMv7-A

The only 2 ODROID SBCs with a Cortex-A9 are Odroid U2 and U3 with a Samsung Exynos 4412 with VFPv3: https://en.wikipedia.org/wiki/ODROID

The much more relevant (32-bit) Odroid XU3/XU4/MC1/HC1/HC2 (all same SoC) have Cortex-A7 and Cortex-A15 (big.LITTLE), Odroid C0/C1/C1+ (all same SoC) have Cortex-A5. These both have a VFPv4, so no issues with that part.

I have not much insights about what the compiler does with the flags, so I want to evaluate whether it still makes sense to use the ODROID target for above SBCs, or better just use generic ARM_DYNAREC, and in case whether it makes sense to add two new targets for these more relevant Odroid SBCs?

ptitSeb commented 1 month ago

The ODROID target was the XU4. You can do a PR with more odroid target if you want.

MichaIng commented 1 month ago

Does it make sense to name the target ODROIDXU4 then, leaving ODROID as alias for backwards compatibility?

Since Cortex-A9 is older than the other 3 CPUs, it is probably a feasible minimal compatible flag. However, for the XU4, gcc 4.9 added support for e.g. -mcpu=cortex-a15.cortex-a7 to optimise for this big.LITTLE combinations. If you do not want to keep support for older gcc versions, shall I update it? I can test build and binary as well here.

For a Odroid C1 target, I first need to find someone who is able and open to test the binary, since I have no C1, just provide install options for them 🙂.

ptitSeb commented 1 month ago

Yeah, you can update, that sounds reasonable to me.

MichaIng commented 3 weeks ago

PR open for the first part: #970

I decided to not leave the ODROID target for backwards compatibility. IMO it is better when everyone directly recognises this change and selects the appropriate new target instead. Quite possible that some used the ODROID target, while others would have matched better, and as an alias for ODROIDXU4, when now -mcpu=cortex-a15.cortex-a7 is used, it will work even less well or not at all on other ODROID SBCs. However, if you wish to keep the ODROID target, as alias or with its old options, I will of course re-add it.

I'll add an ODROID-C1 target with a dedicated PR.