flutter-tizen / engine

The Flutter engine
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
6 stars 19 forks source link

Reorganize the build configuration #271

Closed swift-kim closed 2 years ago

swift-kim commented 2 years ago
swift-kim commented 2 years ago

Address Sanitizer (--asan)

The toolchain is missing compiler-rt support.

../../third_party/abseil-cpp/absl/base/dynamic_annotations.h:451:10: fatal error: 'sanitizer/common_interface_defs.h' file not found
#include <sanitizer/common_interface_defs.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Even if I add the compiler-rt target to -DLLVM_ENABLE_PROJECTS in build-llvm.sh, it still doesn't work (linking fails).

/usr/bin/arm-linux-gnueabi-ld: cannot find /home/swift/Git/engine/src/tizen_tools/toolchains/lib/clang/14.0.1/lib/linux/libclang_rt.asan_static-arm.a: No such file or directory
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

There's only libclang_rt.asan_static-x86_64.a for x64 in the specified directory. I'm not sure how to configure compiler-rt for cross build.

Thread Sanitizer (--tsan)

The build fails (not supported).

clang-14: error: unsupported option '-fsanitize=thread' for target 'arm-unknown-linux-gnueabi'
ninja: build stopped: subcommand failed.

Memory Sanitizer (--msan)

The build fails (not supported).

fatal error: error in backend: unsupported architecture
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, ...
Stack dump:
...
clang-14: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Tizen clang version 14.0.1 (https://github.com/llvm/llvm-project.git c62053979489ccb002efe411c3af059addcb5d7d)
Target: arm-unknown-linux-gnueabi
Thread model: posix
InstalledDir: /home/swift/Git/engine/src/tizen_tools/toolchains/bin
clang-14: note: diagnostic msg:
...
swift-kim commented 2 years ago

Closing for now. More investigation is needed to support ASan builds.