Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDK] Adds dart2native arguments for gen_snapshot & AOT runtime
Example: # sdk (x64) $ ./tools/build.py -a x64 -m product create_sdk $ DART2NATIVE_X64=out/ProductX64/dart-sdk/bin/dart2native ninja -C out/ProductX64 create_sdk [...] The build took XXX seconds # gen_snapshot (simarm) $ ./tools/build.py -a simarm -m product copy_gen_snapshot ninja -C out/ProductSIMARM copy_gen_snapshot [...] The build took XXX seconds $ GEN_SNAPSHOT_SIMARM=out/ProductSIMARM/dart-sdk/bin/utils/gen_snapshot $ file $GEN_SNAPSHOT_SIMARM [...]/gen_snapshot: ELF 32-bit LSB executable, Intel 80386, [...] # dartaotruntime (arm) $ ./tools/build.py -a arm -m product copy_dartaotruntime ninja -C out/ProductXARM copy_dartaotruntime [...] The build took XXX seconds $ DARTAOTRUNTIME_XARM=out/ProductXARM/dart-sdk/bin/dartaotruntime $ file $DARTAOTRUNTIME_XARM [...]/dartaotruntime: ELF 32-bit LSB shared object, ARM, [...] # test $ cat cpu.dart import 'dart:io'; void main() { final lines = File('/proc/cpuinfo').readAsLinesSync(); final model = lines.firstWhere((line) => line.startsWith('model name')); print(model.split(':').last.trim()); } # x64 $ $DART2NATIVE_X64 cpu.dart -o cpu_x64 Generated: [...]/cpu_x64 $ file cpu_x64 cpu_x64: ELF 64-bit LSB shared object, x86-64, [...] $ ./cpu_x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz # arm $ $DART2NATIVE_X64 cpu.dart --gen-snapshot $GEN_SNAPSHOT_SIMARM --aot-runtime $DARTAOTRUNTIME_XARM -o cpu_arm Generated: [...]/cpu_arm $ file cpu_arm cpu_arm: ELF 32-bit LSB shared object, ARM, [...] # -> rpi pi@raspberrypi:~ $ ./cpu_arm ARMv7 Processor rev 3 (v7l)
- Loading branch information