Skip to content

build an empty project failed (undefined reference to `__onexitbegin') #49078

Closed
@bitbegin

Description

toolchain:

nightly-x86_64-pc-windows-msvc (default)
rustc 1.26.0-nightly (521d91c6b 2018-03-14)

build command: cargo run --target x86_64-pc-windows-gnu

error message:

.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-gnu\lib\crt2.o:crtexe.c:(.rdata$.refptr.__onexitbegin[.refptr.__onexitbegin]+0x0): undefined reference to `__onexitbegin'

.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-gnu\lib\crt2.o:crtexe.c:(.rdata$.refptr.__onexitend[.refptr.__onexitend]+0x0): undefined reference to `__onexitend'
          collect2.exe: error: ld returned 1 exit status

possible reason:

  1. rustc bug?

  2. rustlib bug?

  3. msys2 gcc issues?

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.O-windows-gnuToolchain: GNU, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions