Skip to content

Unable to use profile-generate when cross-compiling for x86_64-pc-windows-gnu on Linux. #140013

Open
@Esper89

Description

@Esper89

When using either of the x86_64-unknown-linux-gnu toolchains (from rustup) with the x86_64-pc-windows-gnu target added, cross-compiling for x86_64-pc-windows-gnu with profile-generate enabled fails:

$ rustc --target x86_64-pc-windows-gnu -C profile-generate=pgo main.rs
error[E0463]: can't find crate for `profiler_builtins`
  |
  = note: the compiler may have been built without the profiler runtime

If the compiler used is built with the following in bootstrap.toml:

[build]
profiler = true
target = ["x86_64-pc-windows-gnu"]

Then the build succeeds, but (after running the instrumented binary in wine) the generated profile data is malformed, and attempting to merge it with llvm-profdata fails:

$ llvm-profdata merge -o pgo/merged.profdata pgo
warning: pgo/default_13971159156524030339_0.profraw: malformed instrumentation profile data: symbol name is empty
error: no profile can be merged

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-crossArea: Cross compilationC-bugCategory: This is a bug.O-windows-gnuToolchain: GNU, Operating system: WindowsT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions