Skip to content

Can't compile with --disable-optimize because compiler_builtins links agains memcpy without PIC #43411

Closed
@TimNN

Description

@TimNN

When attempting to build rustc without optimzations, linking of std fails because:

  = note: /usr/local/bin/ld: /tmp/rustc.6VSDxArmnzqR/libcompiler_builtins-614d629936883e62.rlib(compiler_builtins-614d629936883e62.6.o): relocation R_X86_64_PC32 against symbol `memcpy@@GLIBC_2.14' can not be used when making a shared object; recompile with -fPIC
          /usr/local/bin/ld: final link failed: Bad value
          collect2: error: ld returned 1 exit status

full log

I guess this can be fixed by either compiling compiler_builtins as PIC or by making it not depend on memcpy. Which would be the correct fix? Intuitively I would say that compiler_builtins should not have any dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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