Skip to content

Engine build failure targeting armv6 #55439

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

Closed
jwinarske opened this issue Apr 23, 2020 · 10 comments
Closed

Engine build failure targeting armv6 #55439

jwinarske opened this issue Apr 23, 2020 · 10 comments

Comments

@jwinarske
Copy link

jwinarske commented Apr 23, 2020

Has armv6 been deprecated? The target is Raspberry Pi 0-W ($10) w/LCD hat.

In file included from ../../third_party/dart/runtime/vm/thread_interrupter_linux.cc:12:
In file included from ../../third_party/dart/runtime/vm/profiler.h:19:
In file included from ../../third_party/dart/runtime/vm/thread_interrupter.h:10:
../../third_party/dart/runtime/vm/signal_handler.h:99:18: error: inline asm clobber list contains reserved registers: R11, SP [-Werror,-Winline-asm]
    asm volatile("nop; nop; nop; nop;"
                 ^
<inline asm>:1:1: note: instantiated into assembly here
        nop; nop; nop; nop;
^
../../third_party/dart/runtime/vm/signal_handler.h:99:18: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
    asm volatile("nop; nop; nop; nop;"
                 ^
<inline asm>:1:1: note: instantiated into assembly here
        nop; nop; nop; nop;
^
1 error generated.

Steps to Reproduce

Clang8 Toolchain with default triple of arm-linux-gnueabi

./flutter/tools/gn --runtime-mode debug --embedder-for-target --full-dart-sdk --enable-fontconfig --target-os linux --linux-cpu arm --arm-float-abi hard --target-triple arm-linux-gnueabihf --target-sysroot /media/joel/SolidState/rpi/rpi0w/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/flutter-engine/git-r0/recipe-sysroot --target-toolchain /media/joel/SolidState/LLVM8.0

Post Config:

append to args file

arm_float_abi = "hard"
arm_tune = "arm1176jzf-s"

Then

diff --git a/build/config/arm.gni b/build/config/arm.gni
index 7a293e6..1ce6f39 100644
--- a/build/config/arm.gni
+++ b/build/config/arm.gni
@@ -7,7 +7,7 @@ if (current_cpu == "arm" || current_cpu == "arm64") {
     # Version of the ARM processor when compiling on ARM. Ignored on non-ARM
     # platforms.
     if (current_cpu == "arm") {
-      arm_version = 7
+      arm_version = 6
     } else if(current_cpu == "arm64") {
       arm_version = 8
     } else {
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 294843d..8310bab 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -635,14 +635,14 @@ if (is_win) {
 
   if (!use_xcode) {
     default_warning_flags += [
-      "-Wno-implicit-int-float-conversion",
-      "-Wno-c99-designator",
+#      "-Wno-implicit-int-float-conversion",
+#      "-Wno-c99-designator",
     ]
     if (!is_fuchsia) {
       default_warning_flags += [
-        "-Wno-non-c-typedef-for-linkage",
-        "-Wno-deprecated-copy",
-        "-Wno-range-loop-construct",
+#        "-Wno-non-c-typedef-for-linkage",
+#        "-Wno-deprecated-copy",
+#        "-Wno-range-loop-construct",
       ]
     }
   }

@TahaTesser
Copy link
Member

Hi @jwinarske
can you please provide your `flutter doctor -v'?

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 23, 2020
@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 23, 2020
@jwinarske
Copy link
Author

jwinarske commented Apr 23, 2020

git log -1
commit 3a27de1

@jwinarske jwinarske reopened this Apr 23, 2020
@jwinarske
Copy link
Author

Given I'm using a current Kernel, I'm figuring this is safe

diff --git a/runtime/vm/signal_handler.h b/runtime/vm/signal_handler.h
index 41eea90dc5..4ff27f91b7 100644
--- a/runtime/vm/signal_handler.h
+++ b/runtime/vm/signal_handler.h
@@ -44,7 +44,7 @@ struct sigset_t {};
 #if defined(HOST_ARCH_ARM) &&                                                  \
     (defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)) &&                    \
     !defined(__thumb__)
-#define USE_SIGNAL_HANDLER_TRAMPOLINE
+//#define USE_SIGNAL_HANDLER_TRAMPOLINE
 #endif
 
 namespace dart {

@jwinarske
Copy link
Author

src/third_party/libpng/arm/filter_neon.S is hard coded for armv-a and neon


FAILED: obj/third_party/libpng/arm/libpng.filter_neon.o 
/media/joel/SolidState/LLVM8.0/bin/clang -MD -MF obj/third_party/libpng/arm/libpng.filter_neon.o.d --target=arm-linux-gnueabihf --sysroot /media/joel/SolidState/rpi/rpi0w/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/flutter-engine/git-r0/recipe-sysroot -DPNG_ARM_NEON_OPT=2 -DUSE_OPENSSL=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_DISABLE_AVAILABILITY=1 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Igen -I../../third_party/libcxx/include -I../../third_party/libcxxabi/include -I../../third_party/libcxxabi/include -I../../third_party/libpng -I../../third_party/zlib -fno-strict-aliasing -fstack-protector --param=ssp-buffer-size=4 -march=armv6 -mfloat-abi=hard -fPIC -pipe -pthread -fcolor-diagnostics -fno-strict-aliasing -fstack-protector --param=ssp-buffer-size=4 -march=armv6 -mfloat-abi=hard -fPIC -pipe -pthread -fcolor-diagnostics -mfpu=vfp -Wall -Wextra -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -fvisibility=hidden --sysroot=/media/joel/SolidState/rpi/rpi0w/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/flutter-engine/git-r0/recipe-sysroot -Wstring-conversion -Wnewline-eof -O2 -fno-ident -fdata-sections -ffunction-sections -g0  -c ../../third_party/libpng/arm/filter_neon.S -o obj/third_party/libpng/arm/libpng.filter_neon.o
<instantiation>:18:9: error: unknown directive
        .func skia_png_read_filter_row_sub4_neon
        ^

Fix for armv6 (no-neon)

diff --git a/third_party/libpng/BUILD.gn b/third_party/libpng/BUILD.gn
index d67361c..4716b1e 100644
--- a/third_party/libpng/BUILD.gn
+++ b/third_party/libpng/BUILD.gn
@@ -48,7 +48,7 @@ source_set("libpng") {
       "arm/filter_neon_intrinsics.c",
     ]
 
-    defines += [ "PNG_ARM_NEON_OPT=2" ]
+    defines += [ "PNG_ARM_NEON_OPT=0" ]
   }
 
   deps = [

@jwinarske
Copy link
Author

This one is interesting. The toolchain switches from my custom specified one to the host compiler

[809/1673] /media/joel/SolidState/LLVM8.0/bin/clang++ -MD -MF obj/third_party/skia/src/ports/typeface_freetype.SkFontHost_FreeType_common.o.d --target=arm-linux-gnueabihf --sysroot /media/joel/SolidState/rpi/rpi0w/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/flutter-engine/git-r0/recipe-sysroot -DUSE_OPENSSL=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_DISABLE_AVAILABILITY=1 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_R32_SHIFT=16 -DSK_DISABLE_REDUCE_OPLIST_SPLITTING -DSK_ENABLE_DUMP_GPU -DSK_DISABLE_AAA -DSK_DISABLE_READBUFFER -DSK_DISABLE_EFFECT_DESERIALIZATION -DSK_SUPPORT_LEGACY_DIDCONCAT44 -DSK_DISABLE_LEGACY_SHADERCONTEXT -DSK_DISABLE_LOWP_RASTER_PIPELINE -DSK_FORCE_RASTER_PIPELINE_BLITTER -DSK_GL -DSK_GAMMA_APPLY_TO_A8 -DSKIA_IMPLEMENTATION=1 -I../.. -Igen -I../../third_party/libcxx/include -I../../third_party/libcxxabi/include -I../../third_party/libcxxabi/include -I../../third_party/skia -I../../third_party/freetype2/include -fno-strict-aliasing -fstack-protector --param=ssp-buffer-size=4 -march=armv6 -mfloat-abi=hard -fPIC -pipe -pthread -fcolor-diagnostics -mfpu=vfp -Wall -Wextra -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -fvisibility=hidden --sysroot=/media/joel/SolidState/rpi/rpi0w/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/flutter-engine/git-r0/recipe-sysroot -Wstring-conversion -Wnewline-eof -O2 -fno-ident -fdata-sections -ffunction-sections -g0 -Wno-unused-function -Wno-unused-variable -fvisibility-inlines-hidden -std=c++17 -fno-rtti -nostdinc++ -nostdinc++ -fno-exceptions -c ../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp -o obj/third_party/skia/src/ports/typeface_freetype.SkFontHost_FreeType_common.o
[810/1673] ../../buildtools/linux-x64/clang/bin/clang++ -MD -MF clang_x64/obj/third_party/dart/runtime/bin/gen_snapshot.snapshot_utils.o.d -DEXCLUDE_CFE_AND_KERNEL_PLATFORM -DUSE_OPENSSL=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_DISABLE_AVAILABILITY=1 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DNDEBUG -DDART_PRECOMPILER -DTARGET_ARCH_ARM -DTARGET_OS_LINUX -I../../third_party/dart/runtime -I../../third_party -I../.. -Iclang_x64/gen -I../../third_party/libcxx/include -I../../third_party/libcxxabi/include -I../../third_party/libcxxabi/include -I../../third_party/dart/runtime/include -I../../third_party/dart/runtime -I../../third_party/dart/runtime/include -fno-strict-aliasing -fstack-protector --param=ssp-buffer-size=4 -m64 -march=x86-64 -fPIC -pipe -pthread -fcolor-diagnostics -Wall -Wextra -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -fvisibility=hidden -Wstring-conversion -Wnewline-eof -O2 -fno-ident -fdata-sections -ffunction-sections -g0 -Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-private-field -Wnon-virtual-dtor -Wvla -Wno-conversion-null -Woverloaded-virtual -Wno-comments -g3 -ggdb3 -fno-rtti -fno-exceptions -Wimplicit-fallthrough -O3 -fvisibility-inlines-hidden -std=c++17 -fno-rtti -nostdinc++ -nostdinc++ -fno-exceptions   -c ../../third_party/dart/runtime/bin/snapshot_utils.cc -o clang_x64/obj/third_party/dart/runtime/bin/gen_snapshot.snapshot_utils.o

@jwinarske
Copy link
Author

@mit-mit will Dart AOT compilation ever be supported on armv6?

#22380
https://github.com/dart-lang/sdk/wiki/Building-Dart-SDK-for-Raspberry-Pi-1

@iapicca
Copy link
Contributor

iapicca commented Apr 24, 2020

HI @jwinarske
given this answer
in the issue you linked the armV&6 architecture isn't supported anymore,
the same issue is in fact a feature request to support said architecture

Please follow up on that issue,
I'm closing the current one as duplicate.
If you disagree please write in the comments
and I will reopen it.
Thank you

#22492
dart-lang/sdk#34874

@jwinarske
Copy link
Author

Dart SDK for linux-armv6l looks active. Something isn't adding up.

@iapicca
Copy link
Contributor

iapicca commented May 15, 2020

Hi @jwinarske
I'm not sure that dart support will automatically translated in flutter support,
I see you are following up on the open proposal for bringing armv6 support
I'm closing this issue for now
while the proposal is still open
Thank you

@iapicca iapicca closed this as completed May 15, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants