Skip to content

linking with cc failed: multiple definition of `__muloti4' #70489

Closed as not planned

Description

@mimoo

Hello,

I'm running into a link failure with cc and I'm not sure how to investigate this. I'm also running out of ideas.

git clone https://github.com/google/oss-fuzz.git
python infra/helper.py shell libra
compile

This will compile with clang 10 on ubuntu xenial:

Step 8/10 : RUN clang -v
 ---> Running in ef911c30fa25
clang version 10.0.0 (https://github.com/llvm/llvm-project.git e84b7a5fe230e42b8e6fe451369874a773bf1867)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Removing intermediate container ef911c30fa25
 ---> 76978329e057
Step 9/10 : RUN cat /etc/os-release
 ---> Running in 1e87f0c344d7
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

I'm getting this error:

Step #4: error: linking with `cc` failed: exit code: 1

// ...

Step #4:   = note: /rust/rustup/toolchains/1.42.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-0b278345638bce90.rlib(compiler_builtins-0b278345638bce90.compiler_builtins.c31qu5fm-cgu.0.rcgu.o): In function `__muloti4':
Step #4:           /cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/compiler_builtins-0.1.25/src/macros.rs:253: multiple definition of `__muloti4'
Step #4:           /tmp/rustcjXWpoV/liblibrocksdb_sys-eab822076e906c87.rlib(int128_builtins.cpp.o):int128_builtins.cpp:(.text.__muloti4+0x0): first defined here
Step #4:           collect2: error: ld returned 1 exit status
Step #4:           
Step #4: 
Step #4: error: aborting due to previous error
Step #4: 
Step #4: error: could not compile `libra_fuzzer_fuzz`.
Step #4: 
Step #4: To learn more, run the command again with --verbose.
Step #4: ********************************************************************************
Step #4: Failed to build.
Step #4: To reproduce, run:
Step #4: python infra/helper.py build_image libra
Step #4: python infra/helper.py build_fuzzers --sanitizer address --engine libfuzzer --architecture x86_64 libra
Step #4: ********************************************************************************

Activity

  1. changed the title [-]cc link failure[/-] [+]cc link failure: multiple definition of `__muloti4'[/+] on Mar 28, 2020
  2. changed the title [-]cc link failure: multiple definition of `__muloti4'[/-] [+]linking with `cc` failed: multiple definition of `__muloti4'[/+] on Mar 28, 2020
  3. added
    A-linkageArea: linking into static, shared libraries and binaries
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Mar 28, 2020
  4. jonas-schievink commented on Mar 31, 2020

    @jonas-schievink
    Contributor

    Apparently this is a regression in 1.42.0?

  5. added
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.
    on Mar 31, 2020
  6. mimoo commented on Apr 1, 2020

    @mimoo
    Author

    Actually no sorry, not introduced by 1.42.0

  7. msmouse commented on Apr 1, 2020

    @msmouse

    libcompiler_builtins defines "__muloti4" which is also part of libc++ which is statically linked to liblibrocksdb_sys (from https://github.com/tikv/rust-rocksdb). I naively think compiler-builtins usually should not be included in buiids and it being linked here is the problem? @jonas-schievink

  8. removed
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.
    on Apr 1, 2020
  9. jonas-schievink commented on Apr 1, 2020

    @jonas-schievink
    Contributor

    Can't help you with that, I try to do as little FFI as possible

  10. added a commit that references this issue on Apr 7, 2020
  11. added a commit that references this issue on Apr 7, 2020
  12. Enselic commented on Oct 20, 2023

    @Enselic
    Member

    Triage: I get unauthorized: authentication required when trying to reproduce. We really need a simple way to reproduce this. Without that, not much can be done. Closing, but feel free to reopen when there is a minimal reproduce available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleT-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