Skip to content

LLVM doesn't build on the first try when cross compilling to windows-gnu host #64218

Closed
@mati865

Description

@mati865

Running ./x.py build --host x86_64-pc-windows-gnu --target x86_64-pc-windows-gnu from Linux will fail on building LLVM for Windows (so it's 2nd LLVM build) because somehow LLVM_ON_UNIX is defined:

/home/mateusz/Projects/rust/rust/src/llvm-project/llvm/include/llvm/Support/FileSystem.h:164:3: error: ‘uid_t’ does not name a type; did you mean ‘pid_t’?
  164 |   uid_t fs_st_uid = 0;
      |   ^~~~~
      |   pid_t

Magic happens when running the same command second time without cleaning build dir or changing anything. It will finish LLVM build and install the files.

Rust build will fail on librustc_codegen_llvm because of missing shell32 but this could be unrelated (although CMake should link it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-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