<div id="geary-body" dir="auto"><div>Control: tags -1 + patch</div><div><br></div><div><br></div></div><div id="geary-quote" dir="auto"><br>On Tue, Aug 8 2023 at 06:22:28 PM -04:00:00, Andres Salomon <dilinger@queued.net> wrote:<br><blockquote type="cite"><div id="geary-body" dir="auto"><div>Package: src:rustc</div><div>Version: 1.66.0+dfsg1-1</div><div>Severity: wishlist</div><div><br></div><div>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.</div><div><br></div><div>Ubuntu apparently enabled it, and you can see their patch here:</div><div><a href="https://git.launchpad.net/~canonical-foundations/ubuntu/+source/rustc/commit/?id=2a926a400334303921a379328cf3fcbbfc247f90">https://git.launchpad.net/~canonical-foundations/ubuntu/+source/rustc/commit/?id=2a926a400334303921a379328cf3fcbbfc247f90</a></div><div><br></div><div>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.</div><div><br></div><div><br></div><div><br></div></div></blockquote><br><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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. </div><div><br></div><div><br></div></div>