jwinarske / meta-flutter

Yocto meta layer for recipes related to using Google Flutter Engine
MIT License
45 stars 21 forks source link

`arm_tune` argument not present in Gatesgarth on aarch64 #30

Closed xobs closed 3 years ago

xobs commented 3 years ago

The arm_tune parameter does not appear to work with the version of the compiler generated by Dunfell. Or rather, I'm not sure if it's the compiler version or something Flutter related:

ERROR: flutter-engine-git-r0 do_compile: Execution of '/opt/Ion/yocto/imx-yocto-bsp/mek-build/tmp/work/cortexa35-poky-linux/flutter-engine/git-r0/temp/run.do_compile.5061' failed with exit code 1:
ninja: Entering directory `out/linux_release_arm64'
[1/1] Regenerating ninja files
FAILED: build.ninja
../../flutter/third_party/gn/gn --root=../.. -q --check --export-compile-commands gen .
ERROR at build arg file (use "gn args <out_dir>" to edit):43:2: Undefined identifier
-e arm_tune = "armv8a+crc+cortexa35+crypto"
 ^
ninja: error: rebuilding 'build.ninja': subcommand failed
WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in: /opt/Ion/yocto/imx-yocto-bsp/mek-build/tmp/work/cortexa35-poky-linux/flutter-engine/git-r0/temp/log.do_compile.5061
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot', 'virtual:native:/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', '/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-devtools/gcc/gcc-cross_10.2.bb:do_populate_sysroot', 'virtual:native:/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', '/opt/Ion/yocto/imx-yocto-bsp/sources/meta-flutter/recipes-devtools/depot-tools/depot-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-devtools/python/python3_3.8.5.bb:do_populate_sysroot', 'virtual:native:/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-extended/zip/zip_3.0.bb:do_populate_sysroot', '/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-graphics/fontconfig/fontconfig_2.13.1.bb:do_populate_sysroot', '/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_10.2.bb:do_populate_sysroot', '/opt/Ion/yocto/imx-yocto-bsp/sources/poky/meta/recipes-core/glibc/glibc_2.32.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['quilt-native', 'patch-native', 'gcc-cross-aarch64', 'pseudo-native', 'depot-tools-native', 'python3-native', 'zip-native', 'fontconfig', 'gcc-runtime', 'glibc', 'autoconf-native', 'libtool-native', 'automake-native', 'gnu-config-native', 'attr-native', 'binutils-cross-aarch64', 'gmp-native', 'xz-native', 'texinfo-dummy-native', 'libmpc-native', 'linux-libc-headers', 'flex-native', 'mpfr-native', 'zlib-native', 'libtirpc-native', 'util-linux-native', 'libnsl2-native', 'libffi-native', 'sqlite3-native', 'pkgconfig-native', 'bzip2-native', 'gdbm-native', 'readline-native', 'openssl-native', 'util-linux', 'freetype', 'zlib', 'expat', 'libgcc', 'm4-native', 'gettext-minimal-native', 'libpcre2-native', 'ncurses-native', 'libcap-ng-native', 'opkg-utils', 'libpam', 'bash-completion', 'libxcrypt', 'ncurses', 'libcap-ng', 'libpng', 'cracklib', 'flex']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_compile
| ninja: Entering directory `out/linux_release_arm64'
| [1/1] Regenerating ninja files
| FAILED: build.ninja
| ../../flutter/third_party/gn/gn --root=../.. -q --check --export-compile-commands gen .
| ERROR at build arg file (use "gn args <out_dir>" to edit):43:2: Undefined identifier
| -e arm_tune = "armv8a+crc+cortexa35+crypto"
|  ^
| ninja: error: rebuilding 'build.ninja': subcommand failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/opt/Ion/yocto/imx-yocto-bsp/mek-build/tmp/work/cortexa35-poky-linux/flutter-engine/git-r0/temp/run.do_compile.5061' failed with exit code 1:
| ninja: Entering directory `out/linux_release_arm64'
| [1/1] Regenerating ninja files
| FAILED: build.ninja
| ../../flutter/third_party/gn/gn --root=../.. -q --check --export-compile-commands gen .
| ERROR at build arg file (use "gn args <out_dir>" to edit):43:2: Undefined identifier
| -e arm_tune = "armv8a+crc+cortexa35+crypto"
|  ^
| ninja: error: rebuilding 'build.ninja': subcommand failed
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/opt/Ion/yocto/imx-yocto-bsp/sources/meta-flutter/recipes-graphics/flutter-engine/flutter-engine_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4345 tasks of which 4310 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /opt/Ion/yocto/imx-yocto-bsp/sources/meta-flutter/recipes-graphics/flutter-engine/flutter-engine_git.bb:do_compile
Summary: There were 3 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
user@Cuboid:/opt/Ion/yocto/imx-yocto-bsp/mek-build$

Regardless, this patch fixes the compile issue:

diff --git a/recipes-graphics/flutter-engine/flutter-engine_git.bb b/recipes-graphics/flutter-engine/flutter-engine_git.bb
index dcf7e7a..553f949 100644
--- a/recipes-graphics/flutter-engine/flutter-engine_git.bb
+++ b/recipes-graphics/flutter-engine/flutter-engine_git.bb
@@ -91,7 +91,7 @@ GN_ARGS_append_armv7a = " --arm-float-abi ${TARGET_FPU}"
 GN_ARGS_append_armv7ve = " --arm-float-abi ${TARGET_FPU}"

 ARGS_GN = ""
-ARGS_GN_append_aarch64 = "arm_tune = \"${@gn_get_tune_features(d)}\""
+#ARGS_GN_append_aarch64 = "arm_tune = \"${@gn_get_tune_features(d)}\""
 ARGS_GN_append_armv7 = "arm_tune = \"${@gn_get_tune_features(d)}\""
 ARGS_GN_append_armv7a = "arm_tune = \"${@gn_get_tune_features(d)}\""
 ARGS_GN_append_armv7ve = "arm_tune = \"${@gn_get_tune_features(d)}\""
tomstokes commented 3 years ago

The echo -e on this line is causing the problem: https://github.com/jwinarske/meta-flutter/blob/dunfell/recipes-graphics/flutter-engine/flutter-engine_git.bb#L178

Dropping the -e or switching to printf should fix the problem.

jwinarske commented 3 years ago

@xobs Thanks for reporting issue.

Can you provide more info on your host environment?

xobs commented 3 years ago

I'm running Ubuntu 20.04 under WSL2.

The fix reported by @tomstokes seems to work:

diff --git a/recipes-graphics/flutter-engine/flutter-engine_git.bb b/recipes-graphics/flutter-engine/flutter-engine_git.bb
index dcf7e7a..395dd94 100644
--- a/recipes-graphics/flutter-engine/flutter-engine_git.bb
+++ b/recipes-graphics/flutter-engine/flutter-engine_git.bb
@@ -175,7 +175,7 @@ do_configure() {

     ./flutter/tools/gn ${GN_ARGS}

-    echo -e ${ARGS_GN} >> ${ARGS_GN_FILE}
+    echo ${ARGS_GN} >> ${ARGS_GN_FILE}
 }
 do_configure[depends] += "depot-tools-native:do_populate_sysroot"

I am now working on getting an end-to-end build, which unfortunately involves fixing U-Boot on this brand-new platform. Once I confirm that works, I'll post an update here.

jwinarske commented 3 years ago

@xobs sure thing. I'll run that change on my end. If it looks good, it'll check it in.

xobs commented 3 years ago

The rebuild just finished, and I can confirm the patch worked.

xobs commented 3 years ago

Apologies, I've just realized I'm using Gatesgarth.

jwinarske commented 3 years ago

@xobs No worries. I also confirmed on my end. Fix checked in.

Thanks @xobs + @tomstokes