Re: [dev] Ada not Rust

From: Greg Reagle <greagle_AT_fastmail.fm>
Date: Mon, 19 Apr 2021 16:54:23 -0400

On Mon, Apr 19, 2021, at 16:36, Mattias Andrée wrote:
> For me, libgnat is only dynamically linked if I run gnatbind
> with -shared, but if you -static it should be statically linked.

Thank you. [[ gnatmake hello.adb -bargs -static ]] does the trick, i.e. it
makes the executable larger (of course) by statically linking libgnat. I am
still an Ada beginner so I am not running the linker and binder etc. separately.

> I cannot find how to statically link the C runtime.

Yea, it still is dynamically linked to (depends on) several libraries:
$ ldd hello
        linux-vdso.so.1 (0x00007ffe57fde000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffbb8a93000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ffbb8a79000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffbb88b8000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ffbb8af5000)
Received on Mon Apr 19 2021 - 22:54:23 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 19 2021 - 23:00:09 CEST