From nobody Wed Sep 22 04:27:09 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 780EB175DFAA for ; Wed, 22 Sep 2021 04:27:22 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HDld62l2Pz3kw7; Wed, 22 Sep 2021 04:27:22 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: by mail-pg1-x535.google.com with SMTP id m21so1289534pgu.13; Tue, 21 Sep 2021 21:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6KhDNoZhvWgKRGodDEZDSWroO+TzuNaxos83o57UhDQ=; b=aMizWq4Ypvw5pdsyMOpaANQtydimCPamFfZhq1iHKHeSHFjyoFf2GNICVFIVG5IR4d mYMS/M3X0zr9FM4R+SqDg2CPgU5XSyvbvKGLeaRb4Y+fr46AbPN3gFLFBnOw0yHhW5Tt u0B5ITJP/JFOUhQfeu6aHiZm/1Q+Qg0Z6QFA2YIhomm6oohLJOH0Y7Ei9tyUf7pkDMja aYLTts7JAPjmW7ral2RTtlgR+uD2Qk3bu7IUJIRFV+VxL27XUrD4K3uPJcFaRrCmU5sU tdG043BsNEF9lIWPEFWS/uvw0kIrQoFHr7/rFnxNeCfkvBVd99g/rHoJ7KNQHR8gZUGi xBew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6KhDNoZhvWgKRGodDEZDSWroO+TzuNaxos83o57UhDQ=; b=cQv61u+CN8i57gCSWPbUQvRq1JIxecKMVRlHAKBHoKMYtbJl8sxUu5psH3/wP3XG5S QFM3N8WkRm07BvwXyk9Z+1YmIM1BnWqCG4yund6Zp6va6zO7s1jcYMW7KHYqGlQZMhT+ RE0+zjvrvC+yZNUkHy5qqZ7jAAQTuBGbou2IiLVnuiFRdig+J9rRU5JFv7iOvWv6nyhn w7JcaeRCUVc5vf4tBTPlQyNw25i3zzL0XJP/HX9Qj+lPLzfHiRGzX1kS9XptYr7fC8W/ 0llrQq0oApdtMwm3oTZjKsDjmusQuVFcEgmaWwVegi3IyR2tkVGaf0uQMOHFaGZY0jTV BVkg== X-Gm-Message-State: AOAM533tmDfFh7uk6wYJhTfwBXX8KqNaxKG7Pj2Xfk1v3XlvmajcUtFt tiDT+RnTJgH+xXXEoIF5YaKkTy/uXVAERUD4+vVAVa2r X-Google-Smtp-Source: ABdhPJwyx914HUJWe4D4uKlQRKttaljTJq4oxTCLrha4t0NzdSvZY4Z/3xkP1ioM6pF+ON1rqx+RnN7/YhQVw8wXNOI= X-Received: by 2002:a63:1358:: with SMTP id 24mr30780669pgt.327.1632284841210; Tue, 21 Sep 2021 21:27:21 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Damjan Jovanovic Date: Wed, 22 Sep 2021 06:27:09 +0200 Message-ID: Subject: Re: Using modern APIs in Rust on FreeBSD To: Alan Somers Cc: FreeBSD CURRENT Content-Type: multipart/alternative; boundary="00000000000021f77405cc8dee08" X-Rspamd-Queue-Id: 4HDld62l2Pz3kw7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: Y --00000000000021f77405cc8dee08 Content-Type: text/plain; charset="UTF-8" On Wed, Sep 22, 2021 at 6:08 AM Alan Somers 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--