Skip to content

Compilation failure on LLVM 19 with *-gnullvm #1167

@kleisauke

Description

@kleisauke

The logic at:

cc-rs/src/lib.rs

Lines 1930 to 1935 in dcd8ed3

if cmd.is_like_clang() && target.contains("windows") {
// Disambiguate mingw and msvc on Windows. Problem is that
// depending on the origin clang can default to a mismatchig
// run-time.
cmd.push_cc_arg(format!("--target={}", target).into());
}

(introduced in PR #825)

Breaks with LLVM 19 (rust-lang/rust#127513) when targeting *-pc-windows-gnullvm due to PR llvm/llvm-project#78655.

Details
The following warnings were emitted during compilation:

warning: compiler_builtins@0.1.109: clang: error: version 'llvm' in target triple 'x86_64-pc-windows-gnullvm' is invalid

error: failed to run custom build command for `compiler_builtins v0.1.109`

Caused by:
[...]

  --- stderr


  error occurred: Command "x86_64-w64-mingw32-clang" "-Oz" "--target=x86_64-pc-windows-gnullvm" "-ffunction-sections" "-fdata-sections" "-m64" "--target=x86_64-pc-windows-gnullvm" "-Os" "-g" "-gcodeview" "-fdata-sections" "-ffunction-sections" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/var/tmp/tmp-librsvg-x86_64-w64-mingw32/librsvg-2.58.92.build_/target/x86_64-pc-windows-gnullvm/release/build/compiler_builtins-f90e4ff268ddda14/out/978315636d0ac771-absvdi2.o" "-c" "/data/mxe/usr/x86_64-pc-linux-gnu/lib/rustlib/src/rust/src/llvm-project/compiler-rt/lib/builtins/absvdi2.c" with args x86_64-w64-mingw32-clang did not execute successfully (status code exit status: 1).

/cc @mati865 FYI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions