Skip to content

The "mangled-names" feature removes intrinsics from compiler_builtins that aren't in compiler_rt #525

Closed
@danakj

Description

@danakj

We're trying to link Rust into a C++ target and we don't want to create ODR violations between compiler_rt and compiler_builtins.

To avoid this, we set the mangled-names feature on compiler_builtins, so that the intrinsics do not get demangled. This avoids all collisions!

However Rust's compiler_builtins provides some intrinsics that are not present in clang's compiler_rt, for 128-bit integers. Such as: __udivti3 and __umodti3 which are referenced by rust\library\std\src\sys\windows\thread_parking.rs:169.

An error showing this is here: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8780748803129506673/+/u/compile__with_patch_/stdout#L7628_7

The mangled-names feature claims that it is for using Rust with compiler_rt, which is good. But it still needs to provide intrinsics that a C++ compiler_rt does not have.

How do we use mangled-names but keep 128-bit integer intrinsics that Rust needs and C/C++ does not provide?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions