Skip to content
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

Closed
jakesays-old opened this issue Jan 18, 2019 · 43 comments
Closed

Question regarding the flutter engine and arm softfloat support #26773

jakesays-old opened this issue Jan 18, 2019 · 43 comments
Assignees
Labels
dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels.

Comments

@jakesays-old
Copy link

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

@kangwang1988
Copy link
Contributor

I think /engine/src/flutter/tools/gn can tell you more.

KyleWongdeMacBook-Pro:src kylewong$ ./flutter/tools/gn --help
usage: gn [-h] [--unoptimized] [--runtime-mode {debug,profile,release}]
          [--dynamic] [--interpreter] [--dart-debug]
          [--target-os {android,ios,linux}] [--android]
          [--android-cpu {arm,x64,x86,arm64}] [--ios] [--ios-cpu {arm,arm64}]
          [--simulator] [--linux-cpu {x64,x86,arm64,arm}]
          [--arm-float-abi {hard,soft,softfp}] [--goma] [--no-goma] [--lto]
          [--no-lto] [--clang] [--no-clang] [--target-sysroot TARGET_SYSROOT]
          [--target-toolchain TARGET_TOOLCHAIN]
          [--target-triple TARGET_TRIPLE]
          [--toolchain-prefix TOOLCHAIN_PREFIX]
          [--operator-new-alignment OPERATOR_NEW_ALIGNMENT] [--enable-vulkan]
          [--embedder-for-target]

A script run` gn gen`.

optional arguments:
  -h, --help            show this help message and exit
  --unoptimized
  --runtime-mode {debug,profile,release}
  --dynamic
  --interpreter
  --dart-debug
  --target-os {android,ios,linux}
  --android
  --android-cpu {arm,x64,x86,arm64}
  --ios
  --ios-cpu {arm,arm64}
  --simulator
  --linux-cpu {x64,x86,arm64,arm}
  --arm-float-abi {hard,soft,softfp}
  --goma
  --no-goma
  --lto
  --no-lto
  --clang
  --no-clang
  --target-sysroot TARGET_SYSROOT
  --target-toolchain TARGET_TOOLCHAIN
  --target-triple TARGET_TRIPLE
  --toolchain-prefix TOOLCHAIN_PREFIX
  --operator-new-alignment OPERATOR_NEW_ALIGNMENT
  --enable-vulkan
  --embedder-for-target

You can compile the engine using:
./flutter/tools/gn --unoptimized --runtime-mode=release --target-os=android --android-cpu=arm --arm-float-abi=softfp
and https://github.com/flutter/flutter/wiki/Compiling-the-engine
@JakeSays

@jakesays-old
Copy link
Author

jakesays-old commented Jan 19, 2019

@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 (--arm-float-abi {hard,soft,softfp}).

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.

@kangwang1988
Copy link
Contributor

@mraleph
Any idea or this is not actually supported now?

@zoechi zoechi added engine flutter/engine repository. See also e: labels. dependency: dart Dart team may need to help us labels Jan 20, 2019
@mraleph
Copy link
Member

mraleph commented Jan 21, 2019

@JakeSays

This is definitely not a tested configuration. However it should be working.

Does flutter run --debug work on your device? In this case Dart should be detecting CPU features dynamically - so it should not be using VFP is none is present.

For release builds you would need to pass --no-use-vfp --no-sim-use-hardfp to gen_snapshot to disable VFP usage.

Let us know if that helps.

@jakesays-old
Copy link
Author

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

  • The lack of support for GCC. This is an issue because clang's compiler-rt does not support soft float arm cpus. Building clang to work with flutter's requirements and the device limitations has been a nightmare.
  • The overall friction involved in getting flutter to build/work with toolchains not directly provided by flutter. The toolchain for compiling the host snapshot tool does not work out of the box when using a custom arm toolchain.
  • Newer kernel requirements (reported in a different issue - not related to cpu)

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:

  • ARM1176jz-s cpu (no fpu, no gpu, 400mhz)
  • 64MB ram
  • kernel 3.0.0.56 and no ability to upgrade.
  • glibc so old that I have to ship my own runtime environment with any app using modern tooling (which requires a custom ld.so to achieve).
  • the device is a handheld point of sale terminal and security is extremely tight which makes it difficult to work with.

Anyway, thank you all in advance for your help. It is greatly appreciated!

@galvesribeiro
Copy link

Found out this which basically say that DartVM should support our environment:

The default clang cross-compiler toolchain will target ARMv7 processors. The Dart VM also supports ARMv6 (e.g. RaspberryPi), and has experimental support ARMv5TE processors (e.g. Lego Mindstorm). For those processors, you will need to provide your own compiler toolchain.

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

@mraleph
Copy link
Member

mraleph commented Jan 22, 2019

The arm intrinsifier uses the vfp extensively, and the arm assembler asserts when vfp instructions are issued.

Intrinsifier should be guarding any VFP code with if (TargetCPUFeatures::vfp_supported()), which boils down to this check:

  // Has floating point unit.
  vfp_supported_ =
      (CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) &&
      FLAG_use_vfp;

So if /proc/cpuinfo on the device does not report vfp in the list of supported features then neither JIT nor any handwritten code should be using vfp instructions. Though as I said we are not testing this continuously so somewhere the code might have slipped through that generates these instructions.

As an experiment you could flip the value of FLAG_use_vfp to false by default by editing the line that defines it:

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 TARGET_ARCH_ARM_6 - but you can use #error to check which branch is actually compiled).

Everything I have tried leads to invalid instruction errors.

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.

@galvesribeiro
Copy link

~ $ cat /proc/cpuinfo 
Processor       : ARMv6-compatible processor rev 5 (v6l)
BogoMIPS        : 398.13
Features        : swp half thumb fastmult edsp java 
CPU implementer : 0x41
CPU architecture: 6TEJ
CPU variant     : 0x1
CPU part        : 0xb36
CPU revision    : 5

Hardware        : Broadcom BCM5892 Chip
Revision        : 0000
Serial          : 0000000000000000

@mraleph That is the /dev/cpuinfo on the device if that help...

@mraleph
Copy link
Member

mraleph commented Jan 22, 2019

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.

@jakesays-old
Copy link
Author

jakesays-old commented Jan 31, 2019

@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 vfp_supported() checks.

Here is the results of dart with --use_vfp=false:

/data/opt $ ./dart --use_vfp=false hw.dart
Creating timer 1, flags: 00080000
Creating timer succeeded w:7 r:9
../../runtime/vm/compiler/assembler/assembler_arm.cc: 752: error: expected: TargetCPUFeatures::vfp_supported()
thread=1103, isolate=vm-isolate(0x424759e0)
  [0x4069bc24] dart::Profiler::DumpStackTrace(void*)
  [0x4069bc24] dart::Profiler::DumpStackTrace(void*)
  [0x409a9708] dart::Assert::Fail(char const*, ...)
  [0x4079099c] dart::Assembler::EmitMultiVDMemOp(dart::Condition, dart::BlockAddressMode, bool, dart::Register, dart::DRegister, int)
  [0x407997f4] dart::Assembler::PushRegisters(dart::RegisterSet const&)
  [0x4074aa90] dart::StubCode::GenerateSharedStub(dart::Assembler*, bool, dart::RuntimeEntry const*, int, bool)
  [0x4074b16c] dart::StubCode::GenerateNullErrorSharedWithFPURegsStub(dart::Assembler*)
  [0x407481cc] dart::StubCode::Generate(char const*, dart::ObjectPoolWrapper*, void (*)(dart::Assembler*))
  [0x40747a60] dart::StubCode::Init()
  [0x40501d84] dart::Dart::Init(unsigned char const*, unsigned char const*, _Dart_Isolate* (*)(char const*, char const*, char const*, char const*, Dart_IsolateFlags*, void*, char**), void (*)(void*), void (*)(void*), void (*)(), void* (*)(char const*, bool), void (*)(unsigned char**, int*, void*), void (*)(void const*, int, void*), void (*)(void*), bool (*)(unsigned char*, int), _Dart_Handle* (*)(), bool)
  [0x40978c34] Dart_Initialize
  [0x402435f4] dart::bin::main(int, char**)
  [0x402442bc] Unknown symbol
-- End of DumpStackTrace
Aborted

I then flipped the use_vfp default to false and added --no-use-vfp --no-sim-use-hardfp as you suggested, which caused the build to fail while pre-compiling the snapshots:

(actually the results were the same regardless of whether or not I added --no-use-vfp --no-sim-use-hardfp)

./clang_x86/gen_snapshot --no-use-vfp --no-sim-use-hardfp --deterministic --snapshot_kind=core --vm_snapshot_data=gen/runtime/bin/vm_snapshot_
data.bin --vm_snapshot_instructions=gen/runtime/bin/vm_snapshot_instructions.bin --isolate_snapshot_data=gen/runtime/bin/isolate_snapshot_data.bin --isolate_snapshot_instructions=gen/runt
ime/bin/isolate_snapshot_instructions.bin /home/jake/pax/dart/source/sdk/out/debug/vm_platform_strong.dill
../../runtime/vm/compiler/assembler/assembler_arm.cc: 752: error: expected: TargetCPUFeatures::vfp_supported()
thread=19689, isolate=vm-isolate(0x2ac8d10)
  [0x007c509c] Unknown symbol
  [0x007c509c] Unknown symbol
  [0x00a86994] Unknown symbol
  [0x00a904eb] Unknown symbol
  [0x008c97f8] Unknown symbol
  [0x008d06b4] Unknown symbol
  [0x008664c6] Unknown symbol
  [0x00866aef] Unknown symbol
  [0x008644d3] Unknown symbol
  [0x00863d37] Unknown symbol
  [0x00667c90] Unknown symbol
  [0x00a61fd6] Unknown symbol
  [0x00555977] Unknown symbol
  [0x00556944] Unknown symbol
-- End of DumpStackTrace
Aborted (core dumped)

Thoughts?

@mraleph
Copy link
Member

mraleph commented Jan 31, 2019

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

@jakesays-old
Copy link
Author

@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!

@galvesribeiro
Copy link

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!

@jakesays-old
Copy link
Author

jakesays-old commented Feb 1, 2019

@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);

  //...
}

@mkustermann
Copy link
Member

@JakeSays Sorry for the delay, we were OOO the last few days. We will take a look.

@mkustermann mkustermann self-assigned this Feb 3, 2019
@jakesays-old
Copy link
Author

@mkustermann no problem, and thanks! Let me know if you need anything.

@mkustermann
Copy link
Member

@JakeSays Could you try patching in the changes from https://dart-review.googlesource.com/c/sdk/+/91830
and see if it fixes your issue?

@jakesays-old
Copy link
Author

@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,
-Jake

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Feb 5, 2019
…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>
@ping996
Copy link

ping996 commented Aug 14, 2019

@jakesays-old are you use this way to run the flutter application:
1, To build applications written by dart, ./flutter build bundles
2, compile the flutter engine to the given platform, use ./flutter/tools/gn && ninja -C [out_dir]
3, use the way of https://github.com/chinmaygarde/flutter_wayland to load the application.

Thank you all in advance for your help. It is greatly appreciated!
--Ping

@ping996
Copy link

ping996 commented Aug 14, 2019

@mkustermann @mraleph
Hi, I have problem about build the flutter engine, I use the way of https://github.com/chinmaygarde/flutter_wayland to load a flutter application, 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 based on wayland 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

Then:
ninja -C out/linux_release_arm/ libflutter_engine.so

I also checked the android compile system, the libflutter.so is soft-ABI type.
Any problems of my build commands? Or any suggestions about how to compile the flutter engine to a custom platform? Or is there another way to porting flutter on tizen platform?

Thank you all in advance for your help. It is greatly appreciated!

@mraleph
Copy link
Member

mraleph commented Aug 14, 2019

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

@jakesays-old
Copy link
Author

jakesays-old commented Aug 14, 2019 via email

@jakesays-old
Copy link
Author

jakesays-old commented Aug 14, 2019 via email

@ping996
Copy link

ping996 commented Aug 15, 2019

@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.
I aslo noticed the --no-sim-use-hard-fp in packages/flutter_tools/lib/src/base/build.dart, this is the flutter repo, not the engine repo, how does it work in my compile? Or is it my misunderstand on how to compile engine?
I use the guide: https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment and https://github.com/flutter/flutter/wiki/Compiling-the-engine to set up my environment to build engine.

Any idea about my question?

@mraleph
Copy link
Member

mraleph commented Aug 15, 2019

@ping996 I misread the question - you are getting libflutter_engine.so which is hard float ABI. I thought you are getting snapshot which are hard-float ABI. I don't exactly know how you would need to change BUILD files to get softfp library.

@ping996
Copy link

ping996 commented Aug 15, 2019

@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?
If the way of run flutter application is wrong, is there any solutions to run a flutter application on my device?

I also tired use the same compile toolchain to build other binary or dynamic library, all is soft ABI type.
The command copyed from ninja compile process is:

/home/wu/flutter-engine/src/src/buildtools/linux-x64/clang/bin/clang --target=armv7l-unknown-linux-gnueabi --sysroot /home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/ -DUSE_OPENSSL=1 -DTOOLCHAIN_VERSION=bac220c15490dcf7b7d8136f75100bbc77e8d217 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DFLUTTER_RUNTIME_MODE_DEBUG=1 -DFLUTTER_RUNTIME_MODE_PROFILE=2 -DFLUTTER_RUNTIME_MODE_RELEASE=3 -DFLUTTER_RUNTIME_MODE=1 -I../.. -Igen -I../../third_party/libcxx/include -I../../third_party/libcxxabi/include -I../.. -fno-strict-aliasing -fstack-protector --param=ssp-buffer-size=4 -march=armv7-a -mtune=generic-armv7-a -mthumb -fPIC -pipe -pthread -fcolor-diagnostics -mfpu=neon -Wall -Wextra -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -fvisibility=hidden --sysroot=/home/oppo/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/ -Wheader-hygiene -Wstring-conversion -Wthread-safety -O2 -fno-ident -fdata-sections -ffunction-sections -g0 -fvisibility-inlines-hidden -fno-rtti -nostdinc++ -fno-exceptions -o hello hello.c -lgcc_eh

Thank you all in advance for your help. It is greatly appreciated!

@JakeSays
Copy link

JakeSays commented Aug 15, 2019

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.

@ping996
Copy link

ping996 commented Aug 15, 2019 via email

@JakeSays
Copy link

JakeSays commented Aug 15, 2019

It's currently a private repo (I intend on open sourcing it when I get a chance) but I added you as a collaborator.

@ping996
Copy link

ping996 commented Aug 15, 2019 via email

@ping996
Copy link

ping996 commented Aug 16, 2019

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.

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 ecore_wl2 which is the interface of tizen EFL system, I think this is the best way to run flutter run tizen system, if you have any idea, please share it with me. Thanks for your help!

@fourscience
Copy link

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

:)

@JakeSays
Copy link

Is that softfloat or softfp? I would be surprised if WebOS requires true softfloat.

@fourscience
Copy link

fourscience commented Aug 28, 2019

@JakeSays
root@LGwebOSTV:# 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: root@pts/6
3037 pts/6 S+ 0:00 grep ssh
root@LGwebOSTV:
# 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
CPU revision : 0

Hardware : LG Electronics DTV SoC
Revision : 0000
Serial : 0000000000000000
root@LGwebOSTV:~# cat /proc/version
Linux version 3.16.0-p.3.badlands.m14tv.1 (gatekeeper.tvsw@ubuntu-1204) (gcc version 4.8.3 20140401 (prerelease) (crosstool-NG 1.20.0 - 4.8-2014.11-x86_64) ) #1 SMP PREEMPT Wed Dec 12 04:47:01 UTC 201

:)

PS, almost forgot this:
root@b525686058cd:/WORKINGDIR# readelf -h ./build/lib/libflutter_engine.so
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: 0x0
Start of program headers: 52 (bytes into file)
Start of section headers: 22062752 (bytes into file)
Flags: 0x5000200, Version5 EABI, soft-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 10
Size of section headers: 40 (bytes)
Number of section headers: 33
Section header string table index: 32

@JakeSays
Copy link

JakeSays commented Aug 28, 2019 via email

@ping996
Copy link

ping996 commented Aug 29, 2019

@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.
Would you like to share you steps and commands about how to build flutter engine to a soft float one?
I am waiting for your reply.

@fourscience
Copy link

@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.
Would you like to share you steps and commands about how to build flutter engine to a soft float one?
I am waiting for your reply.
@JakeSays ye sorry did not realise that you mentioned no vfp.
@ping996 May i ask which tizen system you are targeting?

  • got linaros sysroot/toolchain (4.9)
  • used that to build bintutils -> llvm/clang -> libcxxabi -> libcxxx
  • moved the headers
  • sync flutter engine
  • patched /src/build/config/compiler (line: 572+), reset flags, added own, nothing specifal, turn off integrated assembler, set std to libcxx, set ldflags
  • this whole thing runs in docker

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.

@ping996
Copy link

ping996 commented Aug 29, 2019

@fourscience I use the tizen system of version 5.0.

@ping996
Copy link

ping996 commented Aug 29, 2019

@fourscience , Follow the steps of https://github.com/jwinarske/flutter_embedded, can I build the flutter engine library successfully?

@fourscience
Copy link

@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.
What we have is:

  • Dockerfile generated based on the target system
  • Depot tools, cmake 3.14.5
  • bizon, flex, texinfo etc. setup
  • linaro's sysroot and toolchain dloaded, extracted
  • get github tar of binutils, clang/llvm, libcxx, libcxxabi, wayland, extraced, configured then build it (order: binutils, clang/llvm, libcxxabi, libcxx, flutter, wayland for us)
    (triple: arm-linux-gnueabi, target: ARM
  • get flutter with gsync
  • patch compiler build gn
  • build flutter with the builroot above, exact command can be different, but we are building most stuff with the basic set with turning off examples, docs, etc

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":
https://gist.github.com/fourscience/d912e43145c52545be82d88ec1c0f86a

@JakeSays
Copy link

JakeSays commented Aug 29, 2019

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

@mkustermann
Copy link
Member

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.

@github-actions
Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependency: dart Dart team may need to help us engine flutter/engine repository. See also e: labels.
Projects
None yet
Development

No branches or pull requests

9 participants