Graal: Support building static final binary

Created on 2 May 2018  路  8Comments  路  Source: oracle/graal

I would like the binary output was static linked like with Go compiled programs. Is it possible?

feature native-image

Most helpful comment

I'm already working on that.

All 8 comments

We're currently experimenting with statically linking the binary. See for example: https://github.com/oracle/graal/issues/386#issuecomment-385974629.

I'm already working on that.

Great :).

Is this something that's intended to be optional? I could see situations where I'd prefer a statically linked binary, but others where I'd prefer to keep them dynamically linked.

@io7m the default will remain as it is (output dynamically linked binaries). I'm just adding --static to optionally allow building of statically linked executables.

Sounds good, thanks! Looking forward to this.

The new option is

--static              build statically linked executable (requires static libc and zlib)

To use it you must install static variants of libc and zlib first.
(On fedora you would use sudo dnf install glibc-static zlib-static)

Was this page helpful?
0 / 5 - 0 ratings