From nobody Thu Sep 5 00:11:13 2024 X-Original-To: freebsd-hackers@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 4WzftC34wDz5W3By for ; Thu, 05 Sep 2024 00:11:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wzft96m4mz4D9M for ; Thu, 5 Sep 2024 00:11:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 4850BES6031199; Thu, 5 Sep 2024 03:11:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 4850BES6031199 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 4850BDUh031198; Thu, 5 Sep 2024 03:11:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 5 Sep 2024 03:11:13 +0300 From: Konstantin Belousov To: Jacques Fourie Cc: Cy Schubert , Jan Knepper , Mark Delany , freebsd-hackers@freebsd.org Subject: Re: Rust: kernel vs user-space Message-ID: References: <0.2.0-final-1725440949.866-0xb4bb20@qmda.emu.st> <78BC157F-6E30-49C4-931D-9EB539BD0322@digitaldaemon.com> <20240904221522.63E0366@slippy.cwsent.com> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: - X-Spamd-Result: default: False [-1.46 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; NEURAL_HAM_SHORT(-0.97)[-0.966]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; ARC_NA(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; TAGGED_RCPT(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; HAS_XAW(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5] X-Rspamd-Queue-Id: 4Wzft96m4mz4D9M On Wed, Sep 04, 2024 at 04:43:31PM -0700, Jacques Fourie wrote: > On Wed, Sep 4, 2024 at 3:41 PM Konstantin Belousov > wrote: > > > On Wed, Sep 04, 2024 at 03:15:22PM -0700, Cy Schubert wrote: > > > In message <78BC157F-6E30-49C4-931D-9EB539BD0322@digitaldaemon.com>, > > Jan > > > Kneppe > > > r writes: > > > > D > > > > > > > > www.dlang.org > > > > > > The problem with D is data structure definitions need to also be > > mirrored > > > (duplicated) in D. For example, when 64-bit inodes were implemented D > > > failed to build and generate any code. The reason for this was > > > ufs/ufs/inode.h now defined 64-bit inodes while the D representation as > > > provided by the D language were still 32-bit. I had opened an issue with > > > upstream regarding this. To this day they still haven't figured out how > > to > > > implement 64-bit inodes on newer FreeBSD systems while maintaining > > 32-bit > > > inode backward compatibility on older FreeBSD systems (as FreeBSD > > > implemented this using ifunc). > > > > Rust is same. It still uses pre-ino64 bindings for both stdlib and libc. > > > > Looking at the Rust libc bindings I see the following: > https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs#L8 > https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs#L5 > > Seems to have changed to 64 bit for FreeBSD 12 and up? Rust libc seems to make some strange things to follow FreeBSD ABI evolution, which is not done e.g. for glibc. But anyway, the relevant place to look seems to be a comment and decision code at https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/build.rs#L44 By default they seems to use FreeBSD 11 ABI from freebsd11 module still. I do not know what is CARGO_FEATURE_RUSTC_DEP_OF_STD.