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
Question regarding the flutter engine and arm softfloat support #26773
Comments
I think /engine/src/flutter/tools/gn can tell you more.
You can compile the engine using: |
@kangwang1988 Thanks for the response. Couple of things: my target isn't android but generic linux and the float abi is softfloat, not softfp (softfp is still fpu based). According to gn softfloat is supported ( I've built the flutter engine at least 10 times over the past 6 weeks trying to make it work on an arm cpu with no hardware floating support. It builds fine targeting an fpu-less arm1176jz-s, but dart keeps generating vfp dependent code. I'm just trying to make sure I'm not missing something, and that it is not in fact a supported target. It would be nice to get some official clarification from the flutter engine team on this. |
@mraleph |
This is definitely not a tested configuration. However it should be working. Does For release builds you would need to pass Let us know if that helps. |
@mraleph I haven't been able to get that far. Everything I have tried leads to invalid instruction errors. There are several things about flutter that are making this a difficult process.
In regard to the vfp issues, I studied the dart engine source code and haven't found anything that indicates it generates non-fpu code. The arm intrinsifier uses the vfp extensively, and the arm assembler asserts when vfp instructions are issued. The root cause of all of this is, obviously, my target device. Here's what I am up against:
Anyway, thank you all in advance for your help. It is greatly appreciated! |
Found out this which basically say that DartVM should support our environment:
If even Lego Mindstorm somehow work, I wonder why it is totally not working on our device and it still generate wrong code... As if when building dartVM as part of flutter engine, some of the parameters are not being passed down to the DartVM build... |
Intrinsifier should be guarding any VFP code with // Has floating point unit.
vfp_supported_ =
(CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) &&
FLAG_use_vfp; So if As an experiment you could flip the value of DEFINE_FLAG(bool, use_vfp, true, "Use vfp instructions if supported"); (there are multiple definitions of the flag - I think the one you are looking for is under
If you catch the invalid instruction error in the debugger and dump stack trace and disassembly around invalid instruction then I can try to help you locate which place generates incorrect instruction. |
@mraleph That is the |
If this is the same device that @JakeSays uses then Dart VM should not be generating VFP instructions. If we do - then it's a bug which we could fix upstream. As I mentioned - if you or @JakeSays get the SIGILL crash in the debugger we can help you to figure out where exactly the wrong instructions come from. |
@mraleph In an attempt to resolve the vfp issue I switched to experimenting directly with dart instead of dart through flutter - I have found places in flutter that always assume an fpu (libpng being one). I am not getting SIGILL but am getting asserts due to the Here is the results of dart with
I then flipped the (actually the results were the same regardless of whether or not I added
Thoughts? |
Makes sense - given that we don’t test this configuration anywhere it seems that we managed to break it a bit. Fix should be fairly straightforward - eg there should be no VFP register spilling if there are no VFP registers. I am away from work for the next 4 to 6 weeks, but @sjindel-google and @mkustermann should be able to provide guidance on how this can be fixed |
@mraleph as an experiment I hard coded all the use_*() methods for vfp and neon to return false. Same result. And thanks for your help! |
Google folks, since @mraleph is out, can someone shed some light on this issue? We're really engaged on bring this kind of device to flutter but those issues are blocking us :( Thanks! |
@sjindel-google, @mkustermann, As another experiment I made the following change, and it ran my hello world successfully. void StubCode::GenerateSharedStub(Assembler* assembler,
bool save_fpu_registers,
const RuntimeEntry* target,
intptr_t self_code_stub_offset_from_thread,
bool allow_return) {
//ADDED:
save_fpu_registers = save_fpu_registers & TargetCPUFeatures::vfp_supported();
// We want the saved registers to appear like part of the caller's frame, so
// we push them before calling EnterStubFrame.
RegisterSet all_registers;
all_registers.AddAllNonReservedRegisters(save_fpu_registers);
//...
} |
@JakeSays Sorry for the delay, we were OOO the last few days. We will take a look. |
@mkustermann no problem, and thanks! Let me know if you need anything. |
@JakeSays Could you try patching in the changes from https://dart-review.googlesource.com/c/sdk/+/91830 |
@mkustermann I applied the patches, and my hello world runs on the device using a snapshot. I can't run dart code from source on the device due to resource constraints but it seems to work. I also noticed an issue when trying to do full aot. I will see how the patches affect that issue as well. Thanks, |
…rt VFP The optimizing compiler should never emit IL instructions which need FPU registers/instructions if FlowGraphCompiler::SupportsUnboxedDoubles() is false. Issue flutter/flutter#26773 Change-Id: Ia72d239f448ee3ec7d156e70bfde3ba9501deccd Reviewed-on: https://dart-review.googlesource.com/c/91830 Reviewed-by: Aart Bik <ajcbik@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
@jakesays-old are you use this way to run the flutter application: Thank you all in advance for your help. It is greatly appreciated! |
@mkustermann @mraleph There is error when binary loading the engine library with internal error, I use the readelf -h libflutter_engine.so, the result is: Why the library is hard-float ABI, I used the 1.5 version of flutter engine code and I checked the code you are mentioned above is contains here. My compile command: Then: I also checked the android compile system, the libflutter.so is soft-ABI type. Thank you all in advance for your help. It is greatly appreciated! |
@ping996 I suspect this is because in |
I used a custom clang 8 armel build.
…On Wed, Aug 14, 2019 at 2:14 AM wuchuanping ***@***.***> wrote:
@mkustermann <https://github.com/mkustermann> @mraleph
<https://github.com/mraleph>
Hi, I have problem about build the flutter engine, I used the customed
toolchain of *tizen* system to compile the engine to a dynamic library,
then I used the same way to build a binary to load the engine to execute
the dart application which created by the command of *flutter build
bundle*.
there is error when binary loading the engine library with internal error,
I use the readelf -h libflutter_engine.so, the result is:
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: ARM
Version: 0x1
Entry point address: 0x116000
Start of program headers: 52 (bytes into file)
Start of section headers: 6735352 (bytes into file)
Flags: 0x5000400, Version5 EABI, *hard-float ABI*
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 11
Size of section headers: 40 (bytes)
Number of section headers: 30
Section header string table index: 29
Why the library is hard-float ABI, I used the 1.5 version of flutter
engine code and I checked the code you are mentioned above is contains here.
My compile command:
./flutter/tools/gn --target-os linux --linux-cpu arm --target-toolchain
/home/user/wu/src/src/buildtools/linux-x64/clang --target-triple
armv7l-unknown-linux-gnueabi --target-sysroot
~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/ --arm-float-abi softfp
--runtime-mode release
ninja -C out/linu_release_arm/ libflutter_engine.so
Any problems of my build commands? Or any suggestions about how to compile
the flutter engine to a custom platform?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26773?email_source=notifications&email_token=AAJIK3I2NM2UMQIZ66N5XITQEO5GHA5CNFSM4GRCPOFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4IBL4I#issuecomment-521147889>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJIK3MH7UGTALMIPYLKZRDQEO5GHANCNFSM4GRCPOFA>
.
|
Ah yes I remember this. There were patches made to the engine to fix soft
float issues, at least for JIT mode. I didn't try with AOT because that
wasn't a requirement.
…On Wed, Aug 14, 2019 at 9:55 AM Vyacheslav Egorov ***@***.***> wrote:
@ping996 <https://github.com/ping996> I suspect this is because in
runtime/vm/cpu_arm.cc flag sim_use_hardfp defaults to true in your build.
You can either explicitly pass --no-sim-use-hard-fp when building the
snapshot. Look at the code in
packages/flutter_tools/lib/src/base/build.dart in Flutter repo - you will
see when it explicitly passes this flag - and change that accordingly.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26773?email_source=notifications&email_token=AAJIK3JY3BXN2OF2M7NF7BLQEQTHHA5CNFSM4GRCPOFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4JH45Q#issuecomment-521305718>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJIK3IWJLHNZWLQKYTCNRTQEQTHHANCNFSM4GRCPOFA>
.
|
@mraleph , I changed the flag of sim_use_hardfp to false and then compile the engine again, but the library is also a hard-cvfp one. my application also can't load the library successfully. Any idea about my question? |
@ping996 I misread the question - you are getting |
@mraleph Sorry for my wrong description,I want to use the way of https://github.com/chinmaygarde/flutter_wayland mentioned here to run flutter application, it is works fine on windows/linux desktop platform with x86. I want to use the same way to run my demos on an armv7 platform of Raspberry Pi 3 with tizen system. So the most important step is porting flutter engine to tizen system, I use the tizen compile toolchain to build flutter engine, just like build on android platform, I also checked the tizen system is not support hard vfp of my devices. it compiled successfully. But the library is also hard-vfp type, does the flutter engine code or setting will cause this situation? I also tired use the same compile toolchain to build other binary or dynamic library, all is soft ABI type.
Thank you all in advance for your help. It is greatly appreciated! |
Since you're on a pi why not use egl? Or are the pi bcm libs not supported on tizen. I have a full embedder that works fine on the pi. I also have a version for Wayland, but haven't tried it on a pi. Can you tell me more about tizen on the pi? I would like to play with it. |
I use the egl. Would you like to share your engine library to me
| |
吴川平
邮箱:wcpstone@126.com
|
签名由 网易邮箱大师 定制
On 08/15/2019 21:04, Big Jake wrote:
GCC isn't a supported compiler. You will have much better luck with clang. Also, since you're on a pi why not use egl?
I have a full embedder that works fine on the pi. I also have a version for Wayland.
I actually have a clang build that works well.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
It's currently a private repo (I intend on open sourcing it when I get a chance) but I added you as a collaborator. |
Thanks for your support
| |
吴川平
邮箱:wcpstone@126.com
|
签名由 网易邮箱大师 定制
On 08/15/2019 21:17, Big Jake wrote:
It's currently a private repo (I intend on open sourcing it when I get a chance) but I added you as a collaborator. https://github.com/JakeSays/EmbeddedFlutter
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi JakeSays, I used the pi3 Model B hardware and bringup it with tizen system(https://wiki.tizen.org/3.0_Porting_Guide/Setup_RPI3_for_Tizen_Instruction), you can go through the official website to download the image, it also noticed how to run it. I try to use the tizen toolchain to build the engine, and use my program link the engine to run flutter application, my program is also based on the wayland by use the |
I'm using the engine built for armv7 soft (webos) :) if you want me i can send over some stuff, i built clang llvm in docker, setup a sysroot from linaro, built some missing stuff, then the engine, ofc with bare minimal. but in the end im still rebuilding it like daily to get it working since the first context setup fails (probably constrained tot he main thread) not sure about that, eglx3002 right at engine run :) |
Is that softfloat or softfp? I would be surprised if WebOS requires true softfloat. |
@JakeSays processor : 1 Hardware : LG Electronics DTV SoC :) PS, almost forgot this: |
Yes that cpu has a full blown fpu with neon support. You shouldn't need
pure softfloat.
…On Wed, Aug 28, 2019, 1:28 PM David Fodor ***@***.***> wrote:
@JakeSays <https://github.com/JakeSays>
***@***.***:# ps ax | grep ssh
2001 ? S 0:00
/media/cryptofs/apps/usr/palm/services/com.palmdts.devmode.service/binaries-armv71/opt/openssh/sbin/sshd
-o StrictModes=no -f
/media/cryptofs/apps/usr/palm/services/com.palmdts.devmode.service/binaries-armv71/opt/openssh/etc/ssh/sshd_config
-h /var/lib/devmode/sshd/ssh_host_rsa_key -D -p 22
2214 ? Ss 0:00 sshd: ***@***.***/6
3037 pts/6 S+ 0:00 grep ssh
***@***.***:# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 0 (v7l)
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0
processor : 1
model name : ARMv7 Processor rev 0 (v7l)
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part :
0xc09/Users/dalestales/Documents/webos_sysroot/netflixdump/README
CPU revision : 0
Hardware : LG Electronics DTV SoC
Revision : 0000
Serial : 0000000000000000
***@***.***:~# cat /proc/version
Linux version 3.16.0-p.3.badlands.m14tv.1 ***@***.***)
(gcc version 4.8.3 20140401 (prerelease) (crosstool-NG 1.20.0 -
4.8-2014.11-x86_64) ) #1 <#1> SMP
PREEMPT Wed Dec 12 04:47:01 UTC 201
:)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26773?email_source=notifications&email_token=ALXGO3XWKGNYVSUCRCSLR5LQG3GW3A5CNFSM4GRCPOFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5MGTIY#issuecomment-525887907>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALXGO3QBN37TSC7SPEHHX2LQG3GW3ANCNFSM4GRCPOFA>
.
|
@fourscience , Thanks for your help, I want to build the flutter engine on tizen system with soft float type armv7l type. But you are work on another system, it will not works on my device system here. |
feel free to contact me via mail. otherwise if you want a simpler way of doing it you can check https://github.com/jwinarske/flutter_embedded and config that up. |
@fourscience I use the tizen system of version 5.0. |
@fourscience , Follow the steps of https://github.com/jwinarske/flutter_embedded, can I build the flutter engine library successfully? |
You should be able to yes, we are using a different setup but ye it's similar.
Regarding tizen 5.0, don't they have an almost up to date clang in their sdk? if so you can probably skip a lot of this. anyway a bare bone "help": |
@ping996 My target was ARMv6 without fpu, not ARMv7-l. I have a clang-8 toolchain only supports softfloat for ARMv6. You are welcome to it if you need. The problem with jwinarske's cmake stuff is it tends to build much more than is needed, or at least it did at one point. He did a good job tough . I know for my ARMv6 build I had to make some small changes to a few .gn files, but that may no longer be required. This was back in December. I also have a clang-8 toolchain for the ARMv7 that I can send you. |
The original issue should've been addressed with dart-lang/sdk@7213306 . So I assume we can close this one? If there's still an issue, please re-open or file a new issue. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Hello,
I am asking this question here because I know of nowhere else to ask it. I have been tasked with porting flutter to an armv6 arm1176jz-s cpu, which has no vfp (completely soft float). I read that this combination should be supported, but the dart arm assembler appears to use the vfp all over the place.
So my question is, is soft float really supported by flutter?
Thanks,
-Jake
The text was updated successfully, but these errors were encountered: