[Pkg-rust-maintainers] Bug#1043311: rustc: please enable profiler builtin

Andres Salomon dilinger at queued.net
Wed Aug 9 05:35:53 BST 2023


Control: tags -1 + patch



On Tue, Aug 8 2023 at 06:22:28 PM -04:00:00, Andres Salomon 
<dilinger at queued.net> wrote:
> Package: src:rustc
> Version: 1.66.0+dfsg1-1
> Severity: wishlist
> 
> Chromium's new rust build requirements include the need for 
> /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins-*.rlib. 
> It would be really helpful to have this built into Debian's rust 
> packages.
> 
> Ubuntu apparently enabled it, and you can see their patch here:
> <https://git.launchpad.net/~canonical-foundations/ubuntu/+source/rustc/commit/?id=2a926a400334303921a379328cf3fcbbfc247f90>
> 
> However, that didn't work for me, at least not with the default of 
> BUILD_WINDOWS=true in rustc's current debian/rules. The build 
> involving --target $(WINDOWS_ARCH)-pc-windows-gnu  requires 
> libclang-rt-15-dev-wasm64 and some extra logic. I'm currently working 
> on an updated patch now.
> 
> 
> 


Alright, here's a patch that builds in sid.  I don't know exactly 
whether the stuff with wasi targets are okay building against 
libclang-rt-15-dev (amd64 package), or if it's supposed to be using the 
two dev-wasm packages, but I assumed the wasm packages. I'm also not 
sure if the versioned build-deps in the ubuntu patch are necessary, but 
I didn't include them.

This patch adds "cargo:rustc-link-search=/usr/lib/clang/15/lib/linux/" 
and "cargo:rustc-link-lib=static=clang_rt.profile-x86_64" (or whatever 
architecture it happens to be building on) to the profiler_builtins 
build flags when the target matches the host. In the case where the 
target is different from the host, it assumes a wasm build and sets 
"rustc-link-lib=static=clang_rt.builtins-wasm32" or 
"cargo:rustc-link-lib=static=clang_rt.builtins-wasm64" depending upon 
whether the target is 32 or 64 bits, respectively.

Along with sid, I'd also obviously love to see this in bookworm - but 
given that chromium in bullseye gets another 5 months of support, I'm 
still trying to figure out our options.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-rust-maintainers/attachments/20230809/e71f1271/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rustc.patch
Type: text/x-patch
Size: 5215 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-rust-maintainers/attachments/20230809/e71f1271/attachment.bin>


More information about the Pkg-rust-maintainers mailing list