Date: Sat, 20 Jan 2024 22:12:34 +0100 From: Juraj Lutter <otis@FreeBSD.org> To: Dimitry Andric <dim@FreeBSD.org> Cc: Gleb Popov <arrowd@freebsd.org>, Alan Somers <asomers@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org>, Warner Losh <imp@bsdimp.com>, Scott Long <scottl@freebsd.org>, meka@tilda.center Subject: Re: The Case for Rust (in the base system) Message-ID: <58D3A7DA-84D2-4C35-B9EB-5BD4BAA51706@FreeBSD.org> In-Reply-To: <01519AEB-2725-492F-BC17-A7A40166D437@FreeBSD.org> References: <CAOtMX2hAUiWdGPtpaCJLPZB%2Bj2yzNw5DSjUmkwTi%2B%2BmyemehCA@mail.gmail.com> <CALH631=v4aWhFNDjZcnmjPnzFyZGhg%2BPuRmShx8TFvF6hPbnJQ@mail.gmail.com> <01519AEB-2725-492F-BC17-A7A40166D437@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <dim@FreeBSD.org> wrote: >=20 > On 20 Jan 2024, at 18:13, Gleb Popov <arrowd@freebsd.org> wrote: >>=20 >> 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. >>=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 <html><head><meta http-equiv=3D"content-type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;"><br = id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote = type=3D"cite"><div>On 20 Jan 2024, at 18:34, Dimitry Andric = <dim@FreeBSD.org> wrote:</div><br = class=3D"Apple-interchange-newline"><div><div>On 20 Jan 2024, at 18:13, = Gleb Popov <arrowd@freebsd.org> wrote:<br><blockquote = type=3D"cite"><br>On Sat, Jan 20, 2024 at 7:51=E2=80=AFPM Alan Somers = <asomers@freebsd.org> wrote:<br><blockquote = type=3D"cite">To<br>summarize, the cost is that it would double our = build times.<br></blockquote><br>Would it? =46rom what I remember, a lot = of rust's build time comes from<br>building its own LLVM. Can we reuse = our base LLVM for Rust-in-base?<br></blockquote><br>It used to be the = case that the Rust port could not use an LLVM port,<br>but had to use = its own copy, but it seems that as = of<br>https://cgit.freebsd.org/ports/commit/?id=3D098de5bc2195 it is = possible<br>again.<br></div></div></blockquote><div><br></div>Speaking = of this:</div><div><br></div><div>I=E2=80=99ve now tried to build rust = with llvm15 on releng/13.2 and all I=E2=80=99ve got = was:</div><div><br></div><div><div>wn-freebsd/release/deps/cargo-daa18b6ff= b5dc5da" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" = "-nodefaultlibs" "-Wl,-z,origin" = "-Wl,-rpath</div><div>,$ORIGIN/../lib"</div><div> =3D note: ld: = error: relocation R_X86_64_32 cannot be used against local symbol; = recompile with -fPIC</div><div> = >>> defined in = /wrkdirs/usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1-too= ls/x86_64-unknown-freebsd/release/deps/liblibssh2_sy</div><div>s-a60af3093= adc87c9.rlib(agent.o)</div><div> = >>> 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</div><div>-unknown-freebsd/release/deps/liblibssh2_sys-a60af3093= adc87c9.rlib</div><div><br></div><div><br></div><div>Is this something = that can be fixed = easily?</div><div><br></div><div>Thanks</div><div><br></div></div><div> <meta charset=3D"UTF-8"><div dir=3D"auto" style=3D"caret-color: rgb(0, = 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: = none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;"><div>=E2=80=94</div><div>Juraj = Lutter</div><div>otis@FreeBSD.org</div></div> </div> <br></body></html>= --Apple-Mail=_0A83281E-76B6-4777-A91A-A8B83F976DAB--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?58D3A7DA-84D2-4C35-B9EB-5BD4BAA51706>