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
[-- Attachment #1 --] > 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 PM Alan Somers <asomers@freebsd.org> wrote: >>> To >>> summarize, the cost is that it would double our build times. >> >> Would it? From 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=098de5bc2195 it is possible > again. Speaking of this: I’ve now tried to build rust with llvm15 on releng/13.2 and all I’ve 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" = 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-tools/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-tools/x86_64 -unknown-freebsd/release/deps/liblibssh2_sys-a60af3093adc87c9.rlib Is this something that can be fixed easily? Thanks — Juraj Lutter otis@FreeBSD.org [-- Attachment #2 --] <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 20 Jan 2024, at 18:34, Dimitry Andric <dim@FreeBSD.org> wrote:</div><br class="Apple-interchange-newline"><div><div>On 20 Jan 2024, at 18:13, Gleb Popov <arrowd@freebsd.org> wrote:<br><blockquote type="cite"><br>On Sat, Jan 20, 2024 at 7:51 PM Alan Somers <asomers@freebsd.org> wrote:<br><blockquote type="cite">To<br>summarize, the cost is that it would double our build times.<br></blockquote><br>Would it? From 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=098de5bc2195 it is possible<br>again.<br></div></div></blockquote><div><br></div>Speaking of this:</div><div><br></div><div>I’ve now tried to build rust with llvm15 on releng/13.2 and all I’ve got was:</div><div><br></div><div><div>wn-freebsd/release/deps/cargo-daa18b6ffb5dc5da" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-Wl,-z,origin" "-Wl,-rpath</div><div>,$ORIGIN/../lib"</div><div> = 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-tools/x86_64-unknown-freebsd/release/deps/liblibssh2_sy</div><div>s-a60af3093adc87c9.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-tools/x86_64</div><div>-unknown-freebsd/release/deps/liblibssh2_sys-a60af3093adc87c9.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="UTF-8"><div dir="auto" style="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>—</div><div>Juraj Lutter</div><div>otis@FreeBSD.org</div></div> </div> <br></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?58D3A7DA-84D2-4C35-B9EB-5BD4BAA51706>
