From nobody Sat Jan 20 21:12:34 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 4THTj11yMqz57WCt for ; Sat, 20 Jan 2024 21:12:53 +0000 (UTC) (envelope-from otis@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4THTj11Q4Qz4t60; Sat, 20 Jan 2024 21:12:53 +0000 (UTC) (envelope-from otis@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705785173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Zu1iDCRbiiGe1s6qmwJm7m0W2awY1IMkUHB5JfRY6kM=; b=WR39r1Bqrj8KVS4zpTazfWlqqBaL9iTYLTfWZp2eCjcyxPxb8H+Oct5jFaZFREDQy8giJN 6VdcoMsDYsBQnIFUEKmXSaeCijAfBzpkiInkteJdfbCoY8TR6UB7qG73I+GQnpAHA7xWcr QKvc0idl/aFU7uXpBAG0o+5eQc3mtNxtvsAh1AtHI3TaE+iYuaWAGA4HqulJd3u/PqA2Ee WURSYHbRB7XTQF6JBZmSpkrlRkS4/D/4tPtZpl2TGdry6IQyz+gca+N7vXNFcvM+5TGz2c kC94d4uGspL39Qor0+IMYMT0bgFDbZugfpOULuyu9CHivcyQ6ZLoQJ9UqXlRlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705785173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Zu1iDCRbiiGe1s6qmwJm7m0W2awY1IMkUHB5JfRY6kM=; b=jkjfnDC2qzvHNe434VZs6svlXsua/V6a6yYzc1AoBjSlxDyteabqCS990oqCOBUZSzsWml bLliu7wla5aaGGkI+bfNVkfobcJP1zynNG4kUAPcOYy/klx9FEb6lHaj0/jrJ6Au3/xdjm B/TR9W9fEv8jmzzFRShk5mMPq9hIK7EQ6ijZ+V4QznZXPRapUxwW3U0Z4wBEg8ndfvNEvv dGrtg5bb+bCUTPFTC8zuvZ2EIS7wwHoUbv9pG//1r5t2127W81lFu6ZBo6vqbuRS5LwH3N yVVMgA8SnF4ykDFInd1UD3XVxwuM2CHAkeY8YRMYVN2lv237D2FAwCG2HuG/jA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705785173; a=rsa-sha256; cv=none; b=h4yo/6GFG9RS/TMmcdGLKALdL2n3kD7a+gSTqP8hPH0hVNXNI6PmjstZy7CiG11sElPB1b X4gT4u5SS4iy3OCZez/WmnZe/mz6o/SBA93yYL/gsFmJ8gOhHC/jJYmbLgyOVAA6SRlezq +3BVNoqUhZou5ePpE/A31sDSnvC8SmbXVEzXQHCPyh/0VU4o8CU3CLG+GW0NddL2bM2E6A jmf601qYe4aTfjugriQjnDAswj5yFFpFUqOvHV5uYx068dI1C9gplRolaw2D8IZYHJBw4p e7pLdWsiMAKGXpj92ng+w//ahhQ100UD6iH/H4c5oiZivrAlqxLXypUkkoJyuQ== Received: from ns2.wilbury.net (ns2.wilbury.net [IPv6:2a01:b200:0:1:f816:3eff:fecd:13e6]) (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-signature ECDSA (P-256) client-digest SHA256) (Client CN "svc.wilbury.net", Issuer "R3" (verified OK)) (Authenticated sender: otis) by smtp.freebsd.org (Postfix) with ESMTPSA id 4THTj05ktDz135Z; Sat, 20 Jan 2024 21:12:52 +0000 (UTC) (envelope-from otis@FreeBSD.org) Received: from smtpclient.apple (gw-upc.owhome.net [188.167.168.254]) (Authenticated sender: juraj@lutter.sk) by svc.wilbury.net (Postfix) with ESMTPSA id 4865F62213; Sat, 20 Jan 2024 22:12:45 +0100 (CET) From: Juraj Lutter Message-Id: <58D3A7DA-84D2-4C35-B9EB-5BD4BAA51706@FreeBSD.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_0A83281E-76B6-4777-A91A-A8B83F976DAB" 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 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: The Case for Rust (in the base system) Date: Sat, 20 Jan 2024 22:12:34 +0100 In-Reply-To: <01519AEB-2725-492F-BC17-A7A40166D437@FreeBSD.org> Cc: Gleb Popov , Alan Somers , FreeBSD Hackers , Warner Losh , Scott Long , meka@tilda.center To: Dimitry Andric References: <01519AEB-2725-492F-BC17-A7A40166D437@FreeBSD.org> X-Mailer: Apple Mail (2.3774.300.61.1.2) --Apple-Mail=_0A83281E-76B6-4777-A91A-A8B83F976DAB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 20 Jan 2024, at 18:34, Dimitry Andric wrote: >=20 > On 20 Jan 2024, at 18:13, Gleb Popov wrote: >>=20 >> On Sat, Jan 20, 2024 at 7:51=E2=80=AFPM Alan Somers = wrote: >>> To >>> summarize, the cost is that it would double our build times. >>=20 >> Would it? =46rom what I remember, a lot of rust's build time comes = from >> building its own LLVM. Can we reuse our base LLVM for Rust-in-base? >=20 > It used to be the case that the Rust port could not use an LLVM port, > but had to use its own copy, but it seems that as of > https://cgit.freebsd.org/ports/commit/?id=3D098de5bc2195 it is = possible > again. Speaking of this: I=E2=80=99ve now tried to build rust with llvm15 on releng/13.2 and all = I=E2=80=99ve got was: wn-freebsd/release/deps/cargo-daa18b6ffb5dc5da" "-Wl,--gc-sections" = "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-Wl,-z,origin" = "-Wl,-rpath ,$ORIGIN/../lib" =3D note: ld: error: relocation R_X86_64_32 cannot be used against = local symbol; recompile with -fPIC >>> defined in = /wrkdirs/usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1-too= ls/x86_64-unknown-freebsd/release/deps/liblibssh2_sy s-a60af3093adc87c9.rlib(agent.o) >>> referenced by agent.o:(libssh2_agent_init) in archive = /wrkdirs/usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1-too= ls/x86_64 -unknown-freebsd/release/deps/liblibssh2_sys-a60af3093adc87c9.rlib Is this something that can be fixed easily? Thanks =E2=80=94 Juraj Lutter otis@FreeBSD.org --Apple-Mail=_0A83281E-76B6-4777-A91A-A8B83F976DAB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 20 Jan 2024, at 18:34, Dimitry Andric = <dim@FreeBSD.org> wrote:

On 20 Jan 2024, at 18:13, = Gleb Popov <arrowd@freebsd.org> wrote:

On Sat, Jan 20, 2024 at 7:51=E2=80=AFPM Alan Somers = <asomers@freebsd.org> wrote:
To
summarize, the cost is that it would double our = build times.

Would it? =46rom what I remember, a lot = of rust's build time comes from
building its own LLVM. Can we reuse = our base LLVM for Rust-in-base?

It used to be the = case that the Rust port could not use an LLVM port,
but had to use = its own copy, but it seems that as = of
https://cgit.freebsd.org/ports/commit/?id=3D098de5bc2195 it is = possible
again.

Speaking = of this:

I=E2=80=99ve now tried to build rust = with llvm15 on releng/13.2 and all I=E2=80=99ve got = was:

wn-freebsd/release/deps/cargo-daa18b6ff= b5dc5da" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" = "-nodefaultlibs" "-Wl,-z,origin" = "-Wl,-rpath
,$ORIGIN/../lib"
  =3D note: ld: = error: relocation R_X86_64_32 cannot be used against local symbol; = recompile with -fPIC
          = >>> defined in = /wrkdirs/usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1-too= ls/x86_64-unknown-freebsd/release/deps/liblibssh2_sy
s-a60af3093= adc87c9.rlib(agent.o)
          = >>> referenced by agent.o:(libssh2_agent_init) in archive = /wrkdirs/usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1-too= ls/x86_64
-unknown-freebsd/release/deps/liblibssh2_sys-a60af3093= adc87c9.rlib


Is this something = that can be fixed = easily?

Thanks

=E2=80=94
Juraj = Lutter
otis@FreeBSD.org

= --Apple-Mail=_0A83281E-76B6-4777-A91A-A8B83F976DAB--