I used a FreeBSD 11 VM runing on GCE
- compile with dart2native, eg I used DSG from a zip of exe's built here: https://github.com/maks/dsg/actions/runs/198892581
sudo brandelf -t linux exe-filename- edit
/etc/rc.confand add:linux_enable="YES" - then:
sudo service abi restart - cd
/usr/ports/emulators/linux_base-c7thenmake install - go back to where you have your dart2native linux exe and run it
For some reason the dart2native exe runs the Dart VM but doesn't run the aot snapshot thats embedded in it. eg. I see:
$ ./dsg
Usage: dart [<vm-flags>] <dart-script-file> [<script-arguments>]
Executes the Dart script <dart-script-file> with the given list of <script-arguments>.
Common VM flags:
--enable-asserts
...
I'm not sure why that's happening but I ran out of time to investigate further, but it does seem to demonstrate to me that the Linux DartVM thats generated for dart2nativeseems to be able to run on FreeBSD 11 with its Linux x64 compat layer.
@saper yes it is a linux binary and yes it does run, per above BUT: what it actually is is the Dart VM linux binary "bundled" with the AOT snapshot of your app's Dart code and a little bit of glue that runs that aot snapshot using the Dart VM. SO whats happening above is that for some reason that bit of glue code that is responsible for running the aot snapshot with the vm is not working, so I just see the error message from the dartvm, hence what I said about showing the Dart VM is able to run using the linux compat layer.
Of course there still maybe something about the aot snapshot that makes it incompatible with the freebsd linux compat layer, but I suspect thats not the case and there's just something about the compat layer that is tripping up that loader code.