Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Sep 2021 06:27:09 +0200
From:      Damjan Jovanovic <damjan.jov@gmail.com>
To:        Alan Somers <asomers@freebsd.org>
Cc:        FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: Using modern APIs in Rust on FreeBSD
Message-ID:  <CAJm2B-kxZyR6O__LMKG4=Ro4_Lv3qCTsnzrWS4siG4cAdASS2g@mail.gmail.com>
In-Reply-To: <CAOtMX2jro84X1byF%2B6%2B%2BaWpAkAa5rCsLMEYhyqBoGx7Zh5WY7g@mail.gmail.com>
References:  <CAOtMX2jro84X1byF%2B6%2B%2BaWpAkAa5rCsLMEYhyqBoGx7Zh5WY7g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000021f77405cc8dee08
Content-Type: text/plain; charset="UTF-8"

On Wed, Sep 22, 2021 at 6:08 AM Alan Somers <asomers@freebsd.org> wrote:

> tldr; should the Rust ecosystem ditch FreeBSD 10 compat for new code?
>
> Rust uses FFI to talk to the OS's C library.  That makes cross-compiling a
> breeze.  Unfortunately, it also fossilizes the ABI.  FreeBSD's libc makes
> careful use of ELF symbol versioning.  That's how we were able to change
> ino_t to 64-bits while maintaining backwards-compatibility with old
> binaries, for example.  But the Rust toolchain isn't able to take
> advantage.  Right now, the toolchain uses a FreeBSD 10 ABI, and the libc
> crate (which virtually all crates depend on) uses a FreeBSD 11 ABI.
>

How exactly is the ABI fossilized? If Rust's FFI uses run-time dynamic
linking, it should be able to use dlvsym() to access the correct version of
libc symbols.

Damjan

--00000000000021f77405cc8dee08--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJm2B-kxZyR6O__LMKG4=Ro4_Lv3qCTsnzrWS4siG4cAdASS2g>