Created
August 28, 2017 06:30
-
-
Save doublec/c2e3c0ab05d622de4de9fa389b0f9d78 to your computer and use it in GitHub Desktop.
Static binaries in ATS using musl-libc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat hello.dats | |
implement main0() = print!("Hello World\n") | |
$ patscc -atsccomp "/usr/local/musl/bin/musl-gcc" -static -I$PATSHOME/ccomp/runtime -I$PATSHOME hello.dats | |
$ ./a.out | |
Hello World | |
$ ldd ./a.out | |
not a dynamic executable | |
$ strip ./a.out | |
$ ls -l ./a.out | |
-rwxr-xr-x 1 user user 18080 Aug 28 18:29 a.out | |
$ file ./a.out | |
./a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment