Skip to content

[beta] rustc_const_math: undefined reference to `rust_eh_personality' #40251

Closed
@cuviper

Description

While testing 1.16.0-beta.3 builds on Fedora, I'm getting a link error for rust_eh_personality on i686 and armv7hl, but not on the rest of arches which are all 64-bit. I'm also seeing this only on Fedora 24/25 with LLVM-3.8, not on Fedora rawhide with LLVM-3.9.

   Compiling rustc_const_math v0.0.0 (file:///builddir/build/BUILD/rustc-beta-src/src/librustc_const_math)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m32" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1/lib/rustlib/i686-unknown-linux-gnu/lib" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps/rustc_const_math-3eb308102ead4d97.0.o" "-o" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps/librustc_const_math-3eb308102ead4d97.so" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps/rustc_const_math-3eb308102ead4d97.metadata.o" "-Wl,-O1" "-nodefaultlibs" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/release/deps" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1/lib/rustlib/i686-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps" "-l" "syntax-361284d4f5fb5940" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps" "-l" "rustc_data_structures-b6582de1b9706e19" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps" "-l" "rustc_errors-11fbf09a24007839" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps" "-l" "log-15b4e8336a0a4a4a" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1/lib/rustlib/i686-unknown-linux-gnu/lib" "-l" "term-1f8b28580ffa517e" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps" "-l" "syntax_pos-091c6cfef6161c2c" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps" "-l" "serialize-41fa6f76166d8a6e" "-L" "/builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1/lib/rustlib/i686-unknown-linux-gnu/lib" "-l" "std-675d08ed24b25a61" "/tmp/rustc.QQnGwqNawKRQ/libcompiler_builtins-55bf5e5eafc786cf.rlib" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-shared" "-Wl,-z,relro,-z,now"
  = note: /builddir/build/BUILD/rustc-beta-src/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps/rustc_const_math-3eb308102ead4d97.0.o:(.data.DW.ref.rust_eh_personality[DW.ref.rust_eh_personality]+0x0): undefined reference to `rust_eh_personality'
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `rustc_const_math`.

The problem seems exactly like that described in commit 92e6c53, part of #38482. On the F25 system, the stage1 libcompiler_builtins.rlib contains undefined references to rust_eh_personality, and the working rawhide system does not. I don't know how they identified where the reference is coming from, but since this seems dependent on the LLVM version, I guess there's still some missing optimization or analysis that needs to be cleaned up.

cc @est31 @nagisa

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions