Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Use manifest to avoid shipping bare libstdc++-6.dll and libgcc_s_seh-1.dll in rust mingw bin dir #51

@vvuk

Description

@vvuk

The mingw build of rust ships with libstdc++-6.dll and libgcc_s_seh-1.dll in the bin path. This can conflict with a system (mingw/msys) installed version of those DLLs, and can cause weird errors -- for example, trying to build rust-bindgen against the system libclang.dll results in a bindgen.exe that doesn't start, because it tries to use rustc's libstdc++-6.dll, whereas libclang.dll needs a newer/different libstdc++.

A solution for this is to use manifest files and move these two DLLs to a private directory that's not in the path. In the rustc bin dir:

rustc.exe.manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="amd64"
    name="APPLICATION"
    type="win32"
/>
<description>Rust Compiler</description>
<dependency>
    <dependentAssembly>
       <assemblyIdentity
           type="win32"
           name="Rust.PrivateRuntime"
           version="1.0.0.0"
           processorArchitecture="amd64"/>
    </dependentAssembly>
</dependency>
</assembly>

Rust.PrivateRuntime.manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity type="win32"
      name="Rust.PrivateRuntime"
version="1.0.0.0"
processorArchitecture="amd64"/>
    <file name="rust-private\libstdc++-6.dll"/>
    <file name="rust-private\libgcc_s_seh-1.dll"/>
</assembly>

And then moving libstdc++-6.dll and libgcc_s_seh-1.dll to a new rustc/bin/rust-private/ directory.

(Note to manually test this out, you have to touch rustc.exe after creating rustc.exe.manifest, otherwise the manifest won't be read.)

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