Skip to content

Linker error for cdylib with panic=abort (Undefined symbol "_rust_eh_personality_catch") #34472

Open
@SSheldon

Description

@SSheldon

If I attempt to compile a crate as a cdylib with panic=abort, I get the following error:

error: linking with `cc` failed: exit code: 1
note: Undefined symbols for architecture x86_64:
  "_rust_eh_personality_catch", referenced from:
     -exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm using rustc 1.11.0-nightly (ad7fe6521 2016-06-23) on OSX 10.11.5.

I can repro by compiling an empty lib.rs with rustc lib.rs --crate-type cdylib -C panic=abort or with a Cargo.toml like the following:

[package]
name = "foo"
version = "0.0.0"

[lib]
crate-type = ["cdylib"]

[profile.release]
panic = "abort"

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions