flutter-elinux icon indicating copy to clipboard operation
flutter-elinux copied to clipboard

Unable to cross compile with Yocto SDK

Open voloder opened this issue 1 year ago • 4 comments
trafficstars

Hello, I am trying to compile using Variscite's Yocto toolchain, but I am getting the following errors:

.../elinux/flutter/ephemeral/cpp_client_wrapper/core_implementations.cc:16:10: fatal error:
'cassert' file not found
#include <cassert>
         ^~~~~~~~~

/opt/fslc-framebuffer/4.0/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: 'gnu/stubs-soft.h' file not found
# include <gnu/stubs-soft.h>
          ^~~~~~~~~~~~~~~~~~

Things I've done:

  • Added latest meta-flutter and meta-clang layers to the sdk
  • Bitbaked with -c populate_sdk
  • Installed SDK
  • Symlinked ld to the arm one sudo cp -a arm-fslc-linux-gnueabi/arm-fslc-linux-gnueabi-ld ld in /opt/fslc-framebuffer/4.0/sysroots/x86_64-fslcsdk-linux/usr/bin
  • Added the following to OEToolchainConfig.cmake in the SDK sysroot
set ( CMAKE_C_COMPILER_WORKS 1 )
set ( CMAKE_CXX_COMPILER_WORKS 1 )
  • Ran
flutter-elinux build elinux --target-arch=arm64 \
     --target-sysroot=/opt/fslc-framebuffer/4.0/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi \
     --target-backend-type=gbm

Any help would be appreciated, thank you!

voloder avatar Feb 24 '24 23:02 voloder

Are you using PNC (persuade) build with Yocto? If yes, I don't think you need to use --target-sysroot and --target-arch option.

HidenoriMatsubayashi avatar Feb 25 '24 01:02 HidenoriMatsubayashi

Are you using PNC (persuade) build with Yocto? If yes, I don't think you need to use --target-sysroot and --target-arch option.

Removed it, tried again, still happens. I am not sure what PNC is, could you elaborate?

voloder avatar Feb 25 '24 09:02 voloder

@voloder you're using a 32 bit cross-toolchain (and this is correct because DART-6UL uses an iMX6UL SOC, which has a Cortex-A7 core) but using --target-arch=arm64

usually, when building with a Yocto toolchain, you just have to setup the environment and:

 . /opt/yocto/sdk/desk-mx8m-l-4.0.0/environment-setup-armv8a-poky-linux
flutter-elinux build elinux --target-arch=arm64 --target-compiler-triple=aarch64-poky-linux-

I'm pretty new to flutter-elinux but it seems that aarch32 is NOT supported (see #141 )

andreascian avatar Mar 27 '24 21:03 andreascian

Refer https://bugs.llvm.org/show_bug.cgi?id=13796

I think it is clang with hardfp issue.

nguyenlkdn avatar Apr 03 '24 14:04 nguyenlkdn