Using swiftc -static-executable


I wanted to try compiling swift using -static-executable I'm not sure if this is a bug or something on my computer not being setup right "Asahi Linux fedora".

I am trying to compiler a main.swift file with the following contents and get the following error amongst a lot of other errors.

Any ideas of what to try next?

let one = 1

swiftc main.swift -static-executable
error: link command failed with exit code 1 (use -v to see invocation)
clang-13: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
/usr/bin/ error: cannot find -lc
/usr/bin/ error: cannot find -lstdc++
/usr/bin/ error: cannot find -lm
/usr/lib/gcc/aarch64-redhat-linux/13/../../../../lib64/crt1.o:function _start: error: undefined reference to '__libc_start_main'
/usr/lib/gcc/aarch64-redhat-linux/13/../../../../lib64/crt1.o:function _start: error: undefined reference to 'abort'


1 Like