[Buildroot] [PATCH vRFC 0/3] Initial flutter packages
Adam Duskett
adam.duskett at amarulasolutions.com
Thu Jul 20 23:36:26 UTC 2023
Preface: Thank you for all the help, thoughts and insight for this initial
RFC of the flutter-engine library. There are many other flutter packages that
need to be ported, but this is the largest hurdle to overcome.
There are many issues with the flutter-engine package:
- The release tarballs from https://github.com/flutter/engine are in no state
to compile. They are only for the use of gclient to download a source
directory structure suitable to build the Flutter engine! If you download,
extract and attempt to run `./tools/gn --no-goma --no-prebuilt-dart-sdk`, you
receive the error message:
`No such file or directory: 'flutter/flutter/third_party/gn/gn.'
But wait! Wasn't the gn binary just called? No, that's a wrapper in the
Flutter source tree that formats arguments to call the real gn binary.
The real gn is not provided in the tarball but is downloaded via gclient
(among many other supporting repositories.)
Even worse, the flutter repository depends on the .git dirs being present.
(https://github.com/meta-flutter/meta-flutter/issues/271) This dependency
means it is not possible to create a reproducible tarball from the downloaded
sources, which is why there is no .hash file provided.
I have asked the flutter project to release full tarballs suitable for
compiling here: https://github.com/flutter/flutter/issues/130734
- The clang toolchain wrapper does not work properly, resulting in the immediate
errors of:
-Wl,-z,now: 'linker' input unused
-Wl,-z,relro: 'linker' input unused
The solution is to use clang.br_real and clang++.br_real.
- If using per_package builds, flutter-engine tries to use the host /usr/bin/ld
instead of the one provided by the compiler, resulting in linking errors.
As such, if BR2_PER_PACKAGE_DIRECTORIES is enabled, we search for the ld
provided by the compiler in the host directory and set the path accordingly.
- libtessellator.so (built by flutter) requires three files:
crtbeginS.o crtendS.o libgcc.a. However, the toolchain path isn't referenced
when linking. The solution is to copy those three files to the staging lib
directory before building.
Tested with:
- Debian 11 and 12
- Ubuntu 18.04, 20.04, and 22.04
- Fedora 38
- Per package directory enabled and disabled
- x86_64, arm64
Adam Duskett (3):
package/python-httplib2: add host variant
package/depot-tools: new package
package/flutter-engine: new package
DEVELOPERS | 4 +
package/Config.in | 1 +
package/Config.in.host | 1 +
.../0001-Disable-ninjalog-upload.patch | 35 +++
package/depot-tools/Config.in.host | 10 +
package/depot-tools/depot-tools.hash | 3 +
package/depot-tools/depot-tools.mk | 33 ++
.../0001-disable-pre-canned-sysroot.patch | 32 ++
.../0002-remove-explicit-x11-dependency.patch | 33 ++
.../0003-disable-undefined-version.patch | 32 ++
...onfig.py-do-not-prepend-sysroot-path.patch | 34 +++
package/flutter-engine/Config.in | 93 ++++++
package/flutter-engine/flutter-engine.mk | 286 ++++++++++++++++++
package/flutter-engine/gclient | 16 +
package/python-httplib2/python-httplib2.mk | 1 +
15 files changed, 614 insertions(+)
create mode 100644 package/depot-tools/0001-Disable-ninjalog-upload.patch
create mode 100644 package/depot-tools/Config.in.host
create mode 100644 package/depot-tools/depot-tools.hash
create mode 100644 package/depot-tools/depot-tools.mk
create mode 100644 package/flutter-engine/0001-disable-pre-canned-sysroot.patch
create mode 100644 package/flutter-engine/0002-remove-explicit-x11-dependency.patch
create mode 100644 package/flutter-engine/0003-disable-undefined-version.patch
create mode 100644 package/flutter-engine/0004-pkg-config.py-do-not-prepend-sysroot-path.patch
create mode 100644 package/flutter-engine/Config.in
create mode 100644 package/flutter-engine/flutter-engine.mk
create mode 100644 package/flutter-engine/gclient
--
2.41.0
More information about the buildroot
mailing list