Skip to content

Building for m68k-unknown-linux-gnu fails with SIGILL with no LLVM backtrace #120129

Open
@glaubitz

Description

@glaubitz

After a longer hiatus since my build machine was unavailable, I have finally found the time to work on the m68k backend in the Rust compiler again.

I tried building a Rust compiler for m68k with ./configure --host=m68k-unknown-linux-gnu which fails with an error that I don't know how to debug since it doesn't show an LLVM backtrace:

Building stage1 library artifacts (x86_64-unknown-linux-gnu -> m68k-unknown-linux-gnu)
   Compiling compiler_builtins v0.1.105
   Compiling core v0.0.0 (/data/home/glaubitz/rust/library/core)
   Compiling libc v0.2.150
   Compiling memchr v2.5.0
   Compiling std v0.0.0 (/data/home/glaubitz/rust/library/std)
   Compiling rustc-std-workspace-core v1.99.0 (/data/home/glaubitz/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/data/home/glaubitz/rust/library/alloc)
   Compiling cfg-if v1.0.0
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.23
rustc exited with signal: 4 (SIGILL) (core dumped)
error: could not compile `core` (lib)

Caused by:
  process didn't exit successfully: `/data/home/glaubitz/rust/build/bootstrap/debug/rustc /data/home/glaubitz/rust/build/bootstrap/debug/rustc --crate-name core --edition=2021 library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=171 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -Zunstable-options --check-cfg 'cfg(feature, values("debug_refcell", "panic_immediate_abort"))' -C metadata=4656c87c5d5bad9b -C extra-filename=-4656c87c5d5bad9b --out-dir /data/home/glaubitz/rust/build/x86_64-unknown-linux-gnu/stage1-std/m68k-unknown-linux-gnu/release/deps --target m68k-unknown-linux-gnu -C linker=cc -L dependency=/data/home/glaubitz/rust/build/x86_64-unknown-linux-gnu/stage1-std/m68k-unknown-linux-gnu/release/deps -L dependency=/data/home/glaubitz/rust/build/x86_64-unknown-linux-gnu/stage1-std/release/deps -Csymbol-mangling-version=legacy -Zunstable-options '--check-cfg=cfg(feature,values(any()))' -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(stdarch_intel_sde)' '--check-cfg=cfg(no_fp_fmt_parse)' '--check-cfg=cfg(no_global_oom_handling)' '--check-cfg=cfg(no_rc)' '--check-cfg=cfg(no_sync)' '--check-cfg=cfg(backtrace_in_libstd)' '--check-cfg=cfg(target_env,values("libnx"))' '--check-cfg=cfg(target_arch,values("spirv","nvptx","xtensa"))' -Zmacro-backtrace -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Csplit-debuginfo=off -Cprefer-dynamic -Zinline-mir -Cembed-bitcode=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 254)
warning: build failed, waiting for other jobs to finish...
rustc exited with signal: 4 (SIGILL) (core dumped)
error: could not compile `compiler_builtins` (lib)

This is most likely a bug in the LLVM M68k backend, but since it's not showing an LLVM backtrace, I am not sure how to debug this.

Any hints?

CC @jrtc27 @mshockwave @0x59616e @antoyo

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-motorola68kTarget: Rust from the parallel universe where the Amiga won.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions