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.conf
and add:linux_enable="YES"
- then:
sudo service abi restart
- cd
/usr/ports/emulators/linux_base-c7
thenmake 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.
Boy, if you ever get this working, I'd be interested too. And beware,
dart2native
has been replaced in mostly name only withdart compile exe
.