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

Fabian Grünbichler fabian at gruenbichler.email
Fri Sep 8 09:36:48 BST 2023


> 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.

Thanks for the patch! the Windows part in d/rules looks wrong to me -
that is built with mingw, not wasi. I assume you are not interested in
that part, so maybe it would also be an option to guard it based on
target and just build it for the regular one (or regular+wasm, but not
windows/mingw)?



More information about the Pkg-rust-maintainers mailing list