On Tue, Sep 28, 2021 at 01:42:44PM +0200, Florian Weimer wrote:
* Kevin Kofler via devel:
> Florian Weimer wrote:
>
>> * Kevin Kofler via devel:
>>
>>> (And for the record, I also think that Go and Rust should not work
>>> that way either! It is possible to build shared libraries of Go code,
>>> at least one Go toolchain supports it.)
>>
>> There is no stable Go ABI. Even minor updates change ABI because type
>> sizes and struct offsets change and are inlined across shared object
>> boundaries. You have to rebuild all reverse dependencies to avoid ABI
>> mismatches. Go's compatibility guarantees only apply at the source
>> level and do not preclude the addition of new struct fields, for
>> example.
>
> The same goes for OCaml and yet we still manage to ship almost
> everything in OCaml dynamically linked.
We rebuild everything on every OCaml release, and ...
Interesting. Could you provide an example of such a dynamically
linked
binary?
C libraries of OCaml binaries are dynamically linked, eg:
$ ldd /usr/bin/virt-v2v
linux-vdso.so.1 (0x00007ffce93ab000)
libvirt.so.0 => /lib64/libvirt.so.0 (0x00007f5a759c7000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f5a75930000)
libguestfs.so.0 => /lib64/libguestfs.so.0 (0x00007f5a757cc000)
libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f5a75643000)
[etc]
OCaml library code can in principle be dynamically linked, eg:
$ rpm -ql ocaml-extlib | grep cmxs
/usr/lib64/ocaml/extlib/extLib.cmxs
$ file /usr/lib64/ocaml/extlib/extLib.cmxs
/usr/lib64/ocaml/extlib/extLib.cmxs: ELF 64-bit LSB shared object, x86-64, version 1
(SYSV), dynamically linked, BuildID[sha1]=5647dd0137ce0a5302c8040301b26a109d771948, with
debug_info, not stripped
but upstream doesn't make it possible to ship OCaml binaries this way,
(they would still require rebuilding on every library update) and so
we only ship the DLLs not fully dynamically linked OCaml binaries
(except for the C code).
This is kind of OK because OCaml code doesn't suffer the slings and
arrows of outrageous pointers.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top