Skip to content

Build fails with LLVM20 #365

@lrvick

Description

@lrvick

Building with an x86_64-linux-musl host where clang/compiler-rt/libc++/libc++abi/libunwind are the system default toolchain.

First I had to remove flags clang does not understand:

find . -type f -exec sed 's/-fno-tree-sra//g' -i {} \;
find . -type f -exec sed 's/-fno-scev-cprop//g' -i {} \;

Then was able to get to 21.1% but then it fails with:

#79 215.2 output/libcompiler_builtins-0_1_101_H10c.rlib.c:12893:84: error: invalid input constraint '0' in asm
#79 215.2  12893 |         __asm__ __volatile__("div %2;\n " : "+r" (asm_rax), "+r" (asm_rdx) : "r" (var38), "0" (asm_rax), "1" (asm_rdx):);
#79 215.2        |                                                                                           ^
#79 215.2 output/libcompiler_builtins-0_1_101_H10c.rlib.c:12943:83: error: invalid input constraint '0' in asm
#79 215.2  12943 |         __asm__ __volatile__("div %2;\n " : "+r" (asm_rax), "+r" (asm_rdx) : "r" (var3), "0" (asm_rax), "1" (asm_rdx):);
#79 215.2        |                                                                                          ^
#79 215.2 output/libcompiler_builtins-0_1_101_H10c.rlib.c:12968:83: error: invalid input constraint '0' in asm
#79 215.2  12968 |         __asm__ __volatile__("div %2;\n " : "+r" (asm_rax), "+r" (asm_rdx) : "r" (var3), "0" (asm_rax), "1" (asm_rdx):);
#79 215.2        |                                                                                          ^
#79 215.2 output/libcompiler_builtins-0_1_101_H10c.rlib.c:14577:89: error: invalid input constraint '0' in asm
#79 215.2  14577 |         __asm__ __volatile__("rep movsb;\n " : "+r" (asm_rdi), "+r" (asm_rsi) : "r" (asm_ecx), "0" (asm_rdi), "1" (asm_rsi):);
#79 215.2        |                                                                                                ^
#79 215.2 output/libcompiler_builtins-0_1_101_H10c.rlib.c:14588:89: error: invalid input constraint '0' in asm
#79 215.2  14588 |         __asm__ __volatile__("rep movsq;\n " : "+r" (asm_rdi), "+r" (asm_rsi) : "r" (asm_rcx), "0" (asm_rdi), "1" (asm_rsi):);
#79 215.2        |                                                                                                ^
#79 215.2 output/libcompiler_builtins-0_1_101_H10c.rlib.c:14646:73: error: invalid input constraint '0' in asm
#79 215.2  14646 |         __asm__ __volatile__("rep stosb;\n " : "+r" (asm_rdi) : "r" (asm_ecx), "0" (asm_rdi), "r" (asm_rax):);
#79 215.2        |                                                                                ^
#79 215.2 output/libcompiler_builtins-0_1_101_H10c.rlib.c:14655:73: error: invalid input constraint '0' in asm
#79 215.2  14655 |         __asm__ __volatile__("rep stosq;\n " : "+r" (asm_rdi) : "r" (asm_rcx), "0" (asm_rdi), "r" (asm_rax):);
#79 215.2        |                                                                                ^
#79 215.2 7 errors generated.
#79 215.2 C Compiler failed to execute - error code 256
#79 215.2 Process exited with non-zero exit status 1
#79 215.2 FAILING COMMAND: /mrustc-06b87d1af49d2db3bd850fdee8888055dd540dd1/bin/mrustc rustc-1.74.0-src/vendor/compiler_builtins/src/lib.rs -o output/libcompiler_builtins-0_1_101_H10c.rlib -C emit-depfile=output/libcompiler_builtins-0_1_101_H10c.rlib.d --cfg debug_assertions -O -L output --cfg feature="compiler-builtins" --cfg feature="rustc-dep-of-std" --cfg feature="core" --cfg feature="dep:core" --crate-name compiler_builtins --crate-type rlib --crate-tag 0_1_101_H10c --cfg feature="unstable" --edition 2018 --extern core=output/librustc_std_workspace_core-1_99_0.rlib
#79 215.2 Env:  OUT_DIR=/mrustc-06b87d1af49d2db3bd850fdee8888055dd540dd1/output/build_compiler_builtins-0_1_101_H10c CARGO_MANIFEST_DIR=/mrustc-06b87d1af49d2db3bd850fdee8888055dd540dd1/rustc-1.74.0-src/vendor/compiler_builtins CARGO_PKG_NAME=compiler_builtins CARGO_PKG_VERSION=0.1.101 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=101

Looks similar to this issue that was solved for OpenBSD: #353

I tried to do similar but same error:

sed '16i#undef minor' -i tools/minicargo/manifest.h                                                                                               
sed '16i#undef major' -i tools/minicargo/manifest.h  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions