Skip to content

Incremental occasionally causes link failures (in particular when build process is interrupted) #81280

Open
@jyn514

Description

@jyn514

I tried this code: b717882

I expected to see this happen: It compiles successfully.

Instead, this happened:

  = note: /usr/bin/ld: /tmp/rustc7n3dgo/librustc_typeck-c1c702f6c0ed082b.rlib(rustc_typeck-c1c702f6c0ed082b.1f6gvdzw1xg6y56.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.e321930b0bae74a5b269c2d224f94109.135.llvm.15012941867981504210' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_typeck-c1c702f6c0ed082b.rlib(rustc_typeck-c1c702f6c0ed082b.2kv783dkfz4eig4n.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `_ZN4core3ops8function6FnOnce9call_once17hb43433e1ee944fe7E.llvm.14317370391725333118' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_typeck-c1c702f6c0ed082b.rlib(rustc_typeck-c1c702f6c0ed082b.3cqtg0ebrql2rd8.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.eae49e7385ecc193ec1fcf539c5141a9.100.llvm.5499732698529515802' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_middle-83b74242a7255742.rlib(rustc_middle-83b74242a7255742.29ntjh109p85p91e.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.712e2f39c61ddadde64034dfaf0f738c.199.llvm.18382006748427464360' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_middle-83b74242a7255742.rlib(rustc_middle-83b74242a7255742.38uvgcbj494cplao.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.712e2f39c61ddadde64034dfaf0f738c.199.llvm.18382006748427464360' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_middle-83b74242a7255742.rlib(rustc_middle-83b74242a7255742.3hr9th0q5c43xr2a.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.82495b045438102480b0340cffb3c8e7.100.llvm.17830998827333553218' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_middle-83b74242a7255742.rlib(rustc_middle-83b74242a7255742.44bsww8uk85mfq3a.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.712e2f39c61ddadde64034dfaf0f738c.199.llvm.18382006748427464360' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_middle-83b74242a7255742.rlib(rustc_middle-83b74242a7255742.4iywqxra088mgqr5.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.712e2f39c61ddadde64034dfaf0f738c.389.llvm.18382006748427464360' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_middle-83b74242a7255742.rlib(rustc_middle-83b74242a7255742.4s1s3wicvbdoxsru.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.f6101ecacd895ad87283c593f614ce01.72.llvm.3245620587429400994' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_middle-83b74242a7255742.rlib(rustc_middle-83b74242a7255742.5fsy1y6w5w7prvy9.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.712e2f39c61ddadde64034dfaf0f738c.199.llvm.18382006748427464360' can not be used when making a shared object
          /usr/bin/ld: /tmp/rustc7n3dgo/librustc_middle-83b74242a7255742.rlib(rustc_middle-83b74242a7255742.zjtxsb10gpjb46g.rcgu.o): relocation R_X86_64_PC32 against undefined hidden symbol `anon.82495b045438102480b0340cffb3c8e7.100.llvm.17830998827333553218' can not be used when making a shared object
          /usr/bin/ld: final link failed: nonrepresentable section on output
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Meta

rustc --version:

rustc 1.50.0-beta.1 (05b602367 2020-12-29)

cc @Aaron1011 , I think you were looking into something similar a while back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-incr-compArea: Incremental compilationA-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.T-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