-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Flutter engine building #49
Comments
Yeah, that's what it says in the article by Chinmay Garde, but it's actually not that accurate. The flutter team uses tip-of-tree of their own fork of Clang/LLVM, which is not even stable Clang/LLVM 10. If you try to build the engine with clang-10/11, a lot of warnings are issued (these warnings didn't exist in clang-9, they were newly introduced to clang-10/11) and because the engine build is configured to abort on a warning ( For libcxx/libcxxabi I just use latest or latest stable clang. Using clang-9 would probably be fine though too. The instructions posted by @hhk7734 may be helpful too.
Yeah we'll see 😄 |
@hhk7734 Thanks for posting this. Even though this is for a different platform I tried adjusting the flags for ARM platform and here too, I had an error at libcxx building. I have mentioned it in the comments section of your page. |
@ardera Did you have to make any changes to the CMakeFiles.txt files of libcxxabi, like adding a rpath or something? Whichever manual I use, I'm always stuck at the same place.
How do I add an rpath or rpath-link? |
I remember having that error too, IIRC the cause was some dangling symlinks in my sysroot (i.e. some of the symlinks on the Raspberry Pi inside I think I fixed it using the sudo apt install symlinks
sudo symlinks -c /lib /usr /opt You can add the After that's done, copy the sysroot to your host machine again EDIT: changed |
@ardera This error remains even after trying out symlinks utility. 😶 @hhk7734 I also tried your method of avoiding the dynamic link issues, ended up having the same error. |
try this:
if this doesn't fix the issue, try adding the following flags to your -DCMAKE_C_FLAGS=-L/home/te_user/flutter-engine/sdk/sysroot/lib/arm-linux-gnueabihf/ -DCMAKE_CXX_FLAGS=-L/home/te_user/flutter-engine/sdk/sysroot/lib/arm-linux-gnueabihf/ |
@limbouser Mabey it is the same way as @ardera 's comment because build-essential depends on libc6-dev Etc. |
I used the flags I showed above and when I tried ninja as the next step, got the following error. Do you have any experience dealing with this? @hhk7734 @ardera
|
This means that your LLVM/Clang is too old for your engine sources / your engine sources are too new for your LLVM/Clang. This is because, when you follow the steps by @hhk7734 or Chinmay Garde's blogpost, you're setting up a development environment for the flutter engine, so you're basically downloading the most recent sources in existance. This is the correct way to do it if you want to build flutter master, and it seems like you'll have to use LLVM/Clang-10 instead if you really want to do it this way. If you instead want to build flutter stable, you'll need some older sources. (which will compile fine with LLVM/Clang-9) Go into your gclient sync --revision=https://github.com/flutter/engine.git@<engine commit hash here> where If you encounter issues while running the |
Thanks @ardera. I'll check. So are the engine-binaries you use based upon this stable branch? |
yep |
https://github.com/flutter/engine/commits/master/shell/platform/linux/config/BUILD.gn |
@hhk7734 Yep, just had some issues with that when I was building the engine. In case someone finds this useful: You'll probably encounter some errors while running the On your host, after every time you sync the sysroot, delete the Should look something like the following in practice:
There is an option for setting the path in which the flutter's |
def SetConfigPath(options):
"""Set the PKG_CONFIG_LIBDIR environment variable.
This takes into account any sysroot and architecture specification from the
options on the given command line.
"""
sysroot = options.sysroot
assert sysroot
# Compute the library path name based on the architecture.
arch = options.arch
if sysroot and not arch:
print("You must specify an architecture via -a if using a sysroot.")
sys.exit(1)
libdir = sysroot + '/usr/' + options.system_libdir + '/pkgconfig'
libdir += ':' + sysroot + '/usr/share/pkgconfig'
os.environ['PKG_CONFIG_LIBDIR'] = libdir
return libdir Maybe, I fixed the code above when the error occurred. PS. https://youtu.be/p6bzmdAJqjo |
Yeah, that works too. Ideally, of course, one would specify a custom
Looks very nice! It's cool to see flutter become a real alternative for embedded UIs. It's just so much better than Qt, electron or CEF in my opinion. |
@limbouser I added support to build the engine, flutter-pi and Deb packages. By default it builds the stable channel, and is tuned for the RPI3. In case below I mounted the RPI3 SD card on host.
|
Also I have Yocto recipes to build both the flutter engine and flutter-pi: |
Hi @jwinarske, can you give the cmake command line for building a cm4 arm64 raspbian? Thanks |
I have been trying to build the flutter engine for a long time now and followed the medium article too. Nothing worked. I would like to know why you have used two versions of LLVM(9 and 10). Since it's said to use TOT Clang/LLVM, I used v11 and always get stuck at building libcxx.
From what I understood from your script, you use LLVM v9.x for setting up the toolchain, ie, Clang/LLVM and then you setup the binutils. You use LLVM v10.x to build the libcxx and libcxxabi. After that comes the setting up the engine development environment and all. Is my understanding of your script right? I use a Ubuntu-16.04 64-bit to build all the packages.
I remember you sayingt that you wouldn't provide any help towards engine building but I've been stuck at this point for a while and I assure you I wouldn't bug you a lot on this. :)
The text was updated successfully, but these errors were encountered: