Skip to content

mingw: newer importlibs lead to runtime crashes with newer cargo-c #443

Closed
messense/implib-rs
#14
@lazka

Description

@lazka

(Initially reported here, creating an issue to summarize: #438 (comment))

The problematic project is https://github.com/ImageOptim/libimagequant, a small reproducer is provided here: https://github.com/lazka/cargo-c-crash

Using the generated importlib to link to libimagequant results in a crash if liq_version() is called (maybe libimagequant is at fault here and the cargo-c change is just exposing a bug? also an option -> other projects also fail the same way)

  • cargo-c 0.10.4 creates a working import lib
  • cargo-c 0.10.9 creates a broken import lib

Using cargo-c 0.10.9 and re-creating the importlib with dlltool (either from binutils or llvm) fixes the issue.

Here are the different import libs introspected with "llvm-objdump -x":

Activity

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

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions