I would like to write a program using Scala Native but it has to run on a linux host (centos 6.5) with a very old glibc. So I would like to deploy that program as a statically linked executable, e.g. as golang does.
How do I build a statically linked executable with scala-native? Is it possible? If yes, how do I do it? If no, why not?
The sbt option nativeLinkingOptions takes a Seq[String] of extra arguments which are passed verbatim to clang during linking.
Adding the following to the project build settings works for me in a quick test:
nativeLinkingOptions += "-static"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With