sony / flutter-elinux

Flutter tools for embedded Linux (eLinux)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMake error while building app

Tom3652 opened this issue · comments

commented

I am running the following command to build my basic app (generated by flutter-elinux create .) :

flutter-elinux build elinux --target-arch=arm64 --target-sysroot=/opt/arm64-sysroot \
    --system-include-directories=/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu \
    --debug

And i have the following output :

tom@tom-VirtualBox:~/StudioProjects/test$ flutter-elinux build elinux --target-arch=arm64 --target-sysroot=/opt/arm64-sysroot     --system-include-directories=/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu     --debug
Flutter 3.0.5 • channel unknown • unknown source
Framework • revision f1875d570e (4 weeks ago) • 2022-07-13 11:24:16 -0700
Engine • revision e85ea0e79c
Tools • Dart 2.17.6 • DevTools 2.12.2

💪 Building with sound null safety 💪

Building an eLinux application with wayland backend in debug mode for arm64 target...      1,365ms
Failed to cmake:
-- The CXX compiler identification is Clang 14.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ - broken
-- Configuring incomplete, errors occurred!
See also "/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeOutput.log".
See also "/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeError.log".

CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
  The C++ compiler

    "/usr/bin/clang++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_84996/fast && /usr/bin/gmake  -f
    CMakeFiles/cmTC_84996.dir/build.make CMakeFiles/cmTC_84996.dir/build
    gmake[1]: Entering directory '/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o
    /usr/bin/clang++ --target=aarch64-linux-gnu --sysroot=/opt/arm64-sysroot    -MD -MT
    CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o.d -o
    CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o -c
    /home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_84996
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84996.dir/link.txt --verbose=1
    /usr/bin/clang++ --target=aarch64-linux-gnu --sysroot=/opt/arm64-sysroot
    CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o -o cmTC_84996
    /usr/bin/ld: unrecognised emulation mode: aarch64linux
    Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    gmake[1]: *** [CMakeFiles/cmTC_84996.dir/build.make:100: cmTC_84996] Error 1
    gmake[1]: Leaving directory '/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_84996/fast] Error 2


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

And i have cat the file /home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeError.log :

tom@tom-VirtualBox:~/StudioProjects/test$ cat /home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeError.log
Detecting CXX compiler ABI info failed to compile with the following output:
Change Dir: /home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_0a0fb/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_0a0fb.dir/build.make CMakeFiles/cmTC_0a0fb.dir/build
gmake[1]: Entering directory '/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/clang++ --target=aarch64-linux-gnu --sysroot=/opt/arm64-sysroot   -v -MD -MT CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.22/Modules/CMakeCXXCompilerABI.cpp
Ubuntu clang version 14.0.0-1ubuntu1
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
 (in-process)
 "/usr/lib/llvm-14/bin/clang" -cc1 -triple aarch64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=non-leaf -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic -target-feature +neon -target-feature +v8a -target-abi aapcs -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp -resource-dir /usr/lib/llvm-14/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o.d -MT CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /opt/arm64-sysroot -internal-isystem /usr/lib/llvm-14/lib/clang/14.0.0/include -internal-isystem /opt/arm64-sysroot/usr/local/include -internal-externc-isystem /opt/arm64-sysroot/include -internal-externc-isystem /opt/arm64-sysroot/usr/include -fdeprecated-macro -fdebug-compilation-dir=/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/share/cmake-3.22/Modules/CMakeCXXCompilerABI.cpp
clang -cc1 version 14.0.0 based upon LLVM 14.0.0 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/opt/arm64-sysroot/usr/local/include"
ignoring nonexistent directory "/opt/arm64-sysroot/include"
ignoring nonexistent directory "/opt/arm64-sysroot/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/llvm-14/lib/clang/14.0.0/include
End of search list.
Linking CXX executable cmTC_0a0fb
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0a0fb.dir/link.txt --verbose=1
/usr/bin/clang++ --target=aarch64-linux-gnu --sysroot=/opt/arm64-sysroot  -v CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_0a0fb 
Ubuntu clang version 14.0.0-1ubuntu1
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/ld" --sysroot=/opt/arm64-sysroot -pie -EL -z relro --hash-style=gnu --build-id --eh-frame-hdr -m aarch64linux -dynamic-linker /lib/ld-linux-aarch64.so.1 -o cmTC_0a0fb Scrt1.o crti.o crtbeginS.o CMakeFiles/cmTC_0a0fb.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc crtendS.o crtn.o
/usr/bin/ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [CMakeFiles/cmTC_0a0fb.dir/build.make:100: cmTC_0a0fb] Error 1
gmake[1]: Leaving directory '/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_0a0fb/fast] Error 2


Determining if the CXX compiler works failed with the following output:
Change Dir: /home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_84996/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_84996.dir/build.make CMakeFiles/cmTC_84996.dir/build
gmake[1]: Entering directory '/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o
/usr/bin/clang++ --target=aarch64-linux-gnu --sysroot=/opt/arm64-sysroot    -MD -MT CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o -c /home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_84996
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84996.dir/link.txt --verbose=1
/usr/bin/clang++ --target=aarch64-linux-gnu --sysroot=/opt/arm64-sysroot CMakeFiles/cmTC_84996.dir/testCXXCompiler.cxx.o -o cmTC_84996 
/usr/bin/ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [CMakeFiles/cmTC_84996.dir/build.make:100: cmTC_84996] Error 1
gmake[1]: Leaving directory '/home/tom/StudioProjects/test/build/elinux/arm64/debug/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_84996/fast] Error 2

I have installed all the mandatory dependencies :

$ sudo apt install curl unzip git clang cmake pkg-config
$ sudo apt install libegl1-mesa libgles2-mesa libxkbcommon-dev

Thanks in advance for your help

commented

I have tried running the flutter-elinux clean and the usual flutter clean as well, but i am so new to linux i have no real idea of what may cause this or how to fix it unfortunately.
Is it because i am running the command from a virtual machine ? I have found this but not sure what to do either : https://stackoverflow.com/questions/54406361/ld-unrecognised-emulation-mode-aarch64linux

commented

I have done :

sudo apt-get install g++-aarch64-linux-gnu

And now i am getting the error :


[  +58 ms] Building an eLinux application with wayland backend in debug mode for arm64 target... (completed in 10.9s)
[   +1 ms] "flutter elinux" took 11,399ms.
[   +6 ms] Failed to cmake build:
           [  0%] Built target flutter_assemble
           [  7%] Building CXX object flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o
           [ 15%] Building CXX object flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o
           [ 23%] Building CXX object flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/plugin_registrar.cc.o
           [ 30%] Linking CXX static library libflutter_wrapper_plugin.a
           [ 30%] Built target flutter_wrapper_plugin
           [ 38%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o
           [ 46%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o
           [ 53%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/flutter_engine.cc.o
           [ 61%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/flutter_view_controller.cc.o
           [ 69%] Linking CXX static library libflutter_wrapper_app.a
           [ 69%] Built target flutter_wrapper_app
           [ 76%] Building CXX object runner/CMakeFiles/test.dir/flutter_window.cc.o
           [ 84%] Building CXX object runner/CMakeFiles/test.dir/main.cc.o
           [ 92%] Building CXX object runner/CMakeFiles/test.dir/__/flutter/generated_plugin_registrant.cc.o
           [100%] Linking CXX executable test
           
           /usr/bin/aarch64-linux-gnu-ld: warning: libdl.so.2, needed by /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_engine.so, not found (try
using -rpath
           or -rpath-link)
           /usr/bin/aarch64-linux-gnu-ld: warning: libpthread.so.0, needed by /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_engine.so, not found
(try using
           -rpath or -rpath-link)
           /usr/bin/aarch64-linux-gnu-ld: warning: libxkbcommon.so.0, needed by /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so, not
found (try
           using -rpath or -rpath-link)
           /usr/bin/aarch64-linux-gnu-ld: warning: libwayland-client.so.0, needed by
/home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so, not found
           (try using -rpath or -rpath-link)
           /usr/bin/aarch64-linux-gnu-ld: warning: libwayland-cursor.so.0, needed by
/home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so, not found
           (try using -rpath or -rpath-link)
           /usr/bin/aarch64-linux-gnu-ld: warning: libwayland-egl.so.1, needed by /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so,
not found
           (try using -rpath or -rpath-link)
           /usr/bin/aarch64-linux-gnu-ld: warning: libEGL.so.1, needed by /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so, not found
(try using
           -rpath or -rpath-link)
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `xkb_state_serialize_mods@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_get_fd'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_keyboard_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_output_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`xkb_state_unref@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_compositor_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`eglCreateWindowSurface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglBindAPI'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_dispatch'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `wl_proxy_marshal_constructor'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`xkb_context_unref@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_disconnect'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglCreateContext'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `wl_proxy_destroy'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_dispatch_pending'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_pointer_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_proxy_add_listener'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`xkb_state_new@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `xkb_keymap_new_from_string@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglMakeCurrent'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `xkb_keymap_new_from_names@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_data_device_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`eglDestroySurface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`xkb_keymap_unref@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`eglGetConfigAttrib'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_roundtrip'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `xkb_keymap_mod_get_index@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_cursor_theme_destroy'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `wl_display_flush'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglGetDisplay'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`xkb_context_new@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglChooseConfig'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`xkb_keysym_to_utf32@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_callback_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_connect'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglInitialize'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_touch_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`eglGetProcAddress'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_subsurface_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `xkb_state_update_key@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_subcompositor_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_prepare_read'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `wl_data_device_manager_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`eglGetCurrentContext'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_read_events'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_egl_window_destroy'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_registry_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `xkb_state_update_mask@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_seat_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `xkb_state_key_get_one_sym@V_0.5.0'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_cursor_theme_load'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `wl_shm_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_cursor_theme_get_cursor'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_surface_interface'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglSwapBuffers'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglGetError'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_egl_window_create'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_display_cancel_read'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `eglTerminate'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_cursor_image_get_buffer'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
           `wl_proxy_marshal_constructor_versioned'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_egl_window_resize'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to `wl_proxy_marshal'
           /usr/bin/aarch64-linux-gnu-ld: /home/tom/StudioProjects/test/elinux/flutter/ephemeral/libflutter_elinux_wayland.so: undefined reference to
`wl_data_source_interface'
           clang: error: linker command failed with exit code 1 (use -v to see invocation)
           gmake[2]: *** [runner/CMakeFiles/test.dir/build.make:132: runner/test] Error 1
           gmake[1]: *** [CMakeFiles/Makefile2:198: runner/CMakeFiles/test.dir/all] Error 2
           gmake: *** [Makefile:136: all] Error 2
[  +16 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      NativeBundle.build (package:flutter_elinux/elinux_build_target.dart:393:7)
           <asynchronous suspension>
           #2      ELinuxBuilder.buildBundle (package:flutter_elinux/elinux_builder.dart:137:7)
           <asynchronous suspension>
           #3      BuildPackageCommand.runCommand (package:flutter_elinux/commands/build.dart:129:5)
           <asynchronous suspension>
           #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1183:27)
           <asynchronous suspension>
           #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #12     main (package:flutter_elinux/executable.dart:83:3)
           <asynchronous suspension>
commented

Clearly there are some missing packages to be installed here or something... I have tried to install : sudo apt install binutils-aarch64-linux-gnu as well but i am still getting the same kind of error :

Capture d’écran 2022-08-10 à 18 30 17

commented

Well i have a simple Ubuntu 22.04 LTS.
I have tried the buildroot toolchain that is not working, i will try with Yocto today and then finally docker.

Thanks

commented

I have got the following error using the docker solution :

tom@tom-VirtualBox:~/test_app$ flutter-elinux build elinux --target-arch=arm64 --target-sysroot=/home/tom/ubuntu18-arm64-sysroot --system-include-directories=/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu --debug
Flutter 3.0.5 • channel unknown • unknown source
Framework • revision f1875d570e (4 weeks ago) • 2022-07-13 11:24:16 -0700
Engine • revision e85ea0e79c
Tools • Dart 2.17.6 • DevTools 2.12.2

💪 Building with sound null safety 💪

Building an eLinux application with wayland backend in debug mode for arm64 target...      1,658ms
Failed to cmake:
-- The CXX compiler identification is unknown
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /home/tom/ubuntu18-arm64-sysroot/usr/bin/clang++
-- Check for working CXX compiler: /home/tom/ubuntu18-arm64-sysroot/usr/bin/clang++ - broken
-- Configuring incomplete, errors occurred!
See also "/home/tom/test_app/build/elinux/arm64/debug/CMakeFiles/CMakeOutput.log".
See also "/home/tom/test_app/build/elinux/arm64/debug/CMakeFiles/CMakeError.log".

CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
  The C++ compiler

    "/home/tom/ubuntu18-arm64-sysroot/usr/bin/clang++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/tom/test_app/build/elinux/arm64/debug/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_848af/fast && /usr/bin/gmake  -f
    CMakeFiles/cmTC_848af.dir/build.make CMakeFiles/cmTC_848af.dir/build
    gmake[1]: Entering directory '/home/tom/test_app/build/elinux/arm64/debug/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_848af.dir/testCXXCompiler.cxx.o
    /home/tom/ubuntu18-arm64-sysroot/usr/bin/clang++    -o CMakeFiles/cmTC_848af.dir/testCXXCompiler.cxx.o -c
    /home/tom/test_app/build/elinux/arm64/debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    aarch64-binfmt-P: Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory
    gmake[1]: *** [CMakeFiles/cmTC_848af.dir/build.make:78: CMakeFiles/cmTC_848af.dir/testCXXCompiler.cxx.o] Error 255
    gmake[1]: Leaving directory '/home/tom/test_app/build/elinux/arm64/debug/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_848af/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

This especially : Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory

I think this issue was fixed. Can you please try again?

commented

Thanks for working on this.

I have the same error for now unfortunately..
Do i need to upgrade flutter-elinux somehow ?
I have ran flutter-elinux upgrade and i see as output :

tom@tom-VirtualBox:~/StudioProjects/test_app$ flutter-elinux upgrade
Flutter 3.0.5 • channel unknown • unknown source
Framework • revision f1875d570e (4 weeks ago) • 2022-07-13 11:24:16 -0700
Engine • revision e85ea0e79c
Tools • Dart 2.17.6 • DevTools 2.12.2
flutter-elinux is already up to date

Please try the following steps.

  1. cd
  2. git pull
  3. rm bin/cache/*
commented

Thanks for the update.

I have the following error now :


tom@tom-VirtualBox:~/StudioProjects/test$ flutter-elinux build elinux --target-arch=arm64 --target-sysroot=/home/tom/ubuntu18-arm64-sysroot
Flutter 3.0.5 • channel unknown • unknown source
Framework • revision f1875d570e (4 weeks ago) • 2022-07-13 11:24:16 -0700
Engine • revision e85ea0e79c
Tools • Dart 2.17.6 • DevTools 2.12.2
Running pub upgrade...
Resolving dependencies...
  _fe_analyzer_shared 34.0.0 (46.0.0 available)
  analyzer 3.2.0 (4.6.0 available)
  archive 3.1.11 (3.3.1 available)
  args 2.3.0 (2.3.1 available)
  async 2.8.2 (2.9.0 available)
  boolean_selector 2.1.0
  browser_launcher 1.1.0 (1.1.1 available)
  build 2.3.0
  built_collection 5.1.1
  built_value 8.1.4 (8.4.0 available)
  characters 1.2.0 (1.2.1 available)
  charcode 1.3.1
  cli_util 0.3.5
  clock 1.1.0 (1.1.1 available)
  code_builder 4.2.0
  collection 1.16.0
  completion 1.0.0
  convert 3.0.1 (3.0.2 available)
  coverage 1.2.0 (1.5.0 available)
  crypto 3.0.1 (3.0.2 available)
  csslib 0.17.1 (0.17.2 available)
  dart_style 2.2.1 (2.2.3 available)
  dds 2.2.0 (2.2.6 available)
  dds_service_extensions 1.3.0 (1.3.1 available)
  devtools_shared 2.11.4 (2.16.0 available)
  dwds 12.1.1 (15.0.0 available)
  fake_async 1.3.0 (1.3.1 available)
  file 6.1.2
  fixnum 1.0.0 (1.0.1 available)
  flutter 0.0.0 from sdk flutter
  flutter_template_images 4.0.0 (4.2.0 available)
  flutter_test 0.0.0 from sdk flutter
  flutter_tools 0.0.0 from path flutter/packages/flutter_tools
  frontend_server_client 2.1.2 (2.1.3 available)
  glob 2.0.2 (2.1.0 available)
  html 0.15.0
  http 0.13.4 (0.13.5 available)
  http_multi_server 3.2.0 (3.2.1 available)
  http_parser 4.0.0 (4.0.1 available)
  intl 0.17.0
  io 1.0.3
  js 0.6.4
  json_rpc_2 3.0.1 (3.0.2 available)
  logging 1.0.2
  matcher 0.12.11 (0.12.12 available)
  material_color_utilities 0.1.4 (0.2.0 available)
  meta 1.7.0 (1.8.0 available)
  mime 1.0.1 (1.0.2 available)
  mockito 5.3.0
  multicast_dns 0.3.2 (0.3.2+1 available)
  mustache_template 2.0.0
  native_stack_traces 0.4.5 (0.5.0 available)
  node_preamble 2.0.1
  package_config 2.0.2 (2.1.0 available)
  path 1.8.1 (1.8.2 available)
  pedantic 1.11.1 (discontinued replaced by lints)
  petitparser 5.0.0
  platform 3.1.0
  pool 1.5.0 (1.5.1 available)
  process 4.2.4
  pub_semver 2.1.1
  shelf 1.1.4 (1.3.2 available)
  shelf_packages_handler 3.0.0 (3.0.1 available)
  shelf_proxy 1.0.1 (1.0.2 available)
  shelf_static 1.1.0 (1.1.1 available)
  shelf_web_socket 1.0.1 (1.0.2 available)
  sky_engine 0.0.99 from sdk flutter
  source_gen 1.2.2
  source_map_stack_trace 2.1.0
  source_maps 0.10.10
  source_span 1.8.2 (1.9.1 available)
  sse 4.1.0
  stack_trace 1.10.0
  stream_channel 2.1.0
  string_scanner 1.1.0 (1.1.1 available)
  sync_http 0.3.0 (0.3.1 available)
  term_glyph 1.2.0 (1.2.1 available)
  test 1.20.2 (1.21.4 available)
  test_api 0.4.9 (0.4.12 available)
  test_core 0.4.11 (0.4.16 available)
  typed_data 1.3.0 (1.3.1 available)
  usage 4.0.2 (4.1.0 available)
  uuid 3.0.6
  vector_math 2.1.2
  vm_service 8.2.2 (9.3.0 available)
  vm_snapshot_analysis 0.7.1 (0.7.2 available)
  watcher 1.0.1
  web_socket_channel 2.1.0 (2.2.0 available)
  webdriver 3.0.0
  webkit_inspection_protocol 1.0.0 (1.1.0 available)
  xml 5.4.1 (6.1.0 available)
  yaml 3.1.0 (3.1.1 available)
No dependencies changed.
1 package is discontinued.
56 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Compiling flutter-elinux...
Info: Compiling without sound null safety

💪 Building with sound null safety 💪

Building an eLinux application with wayland backend in release mode for arm64 target...      1,743ms
Failed to cmake:
-- The CXX compiler identification is Clang 14.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: //bin/clang++
-- Check for working CXX compiler: //bin/clang++ - broken
-- Configuring incomplete, errors occurred!
See also "/home/tom/StudioProjects/test/build/elinux/arm64/release/CMakeFiles/CMakeOutput.log".
See also "/home/tom/StudioProjects/test/build/elinux/arm64/release/CMakeFiles/CMakeError.log".

CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
  The C++ compiler

    "//bin/clang++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/tom/StudioProjects/test/build/elinux/arm64/release/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_80374/fast && /usr/bin/gmake  -f
    CMakeFiles/cmTC_80374.dir/build.make CMakeFiles/cmTC_80374.dir/build
    gmake[1]: Entering directory '/home/tom/StudioProjects/test/build/elinux/arm64/release/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_80374.dir/testCXXCompiler.cxx.o
    //bin/clang++ --sysroot=/home/tom/ubuntu18-arm64-sysroot    -MD -MT
    CMakeFiles/cmTC_80374.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_80374.dir/testCXXCompiler.cxx.o.d -o
    CMakeFiles/cmTC_80374.dir/testCXXCompiler.cxx.o -c
    /home/tom/StudioProjects/test/build/elinux/arm64/release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_80374
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_80374.dir/link.txt --verbose=1
    //bin/clang++ --sysroot=/home/tom/ubuntu18-arm64-sysroot CMakeFiles/cmTC_80374.dir/testCXXCompiler.cxx.o -o
    cmTC_80374
    //bin/ld: cannot find Scrt1.o: No such file or directory
    //bin/ld: cannot find crti.o: No such file or directory
    //bin/ld: cannot find -lm: No such file or directory
    //bin/ld: cannot find libgcc_s.so.1: No such file or directory
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    gmake[1]: *** [CMakeFiles/cmTC_80374.dir/build.make:100: cmTC_80374] Error 1
    gmake[1]: Leaving directory '/home/tom/StudioProjects/test/build/elinux/arm64/release/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_80374/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)