Skip to content

Prefer libx.a over libx.so when dynamic linking is off? #23591

Closed
@hoodmane

Description

@hoodmane

When using Emscripten 4.0.0 and 4.0.1, I'm getting errors like attempted static link of dynamic object ./libx.so. I haven't diagnosed what changed in Emscripten that causes this, this is a feature request not a report of a regression. The following reproduces the problem:

$ ar -cq libx.a
$ touch a.c
$ emcc a.c -L. -lx
$ echo $?
0
$ touch x.c
$ emcc -sSIDE_MODULE x.c -o libx.so
$ emcc a.c -L. -lx
wasm-ld: error: attempted static link of dynamic object ./libx.so

I would like it if instead of complaining that it can't use libx.so it would find libx.a and link with that.

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