Skip to content

Passing a nonexistent -llibthatisnotthere should be (configurable to be) an error #4213

Closed
@juj

Description

@juj

A contributor on IRC noticed that emcc -lnonexistent ... only posts a warning, and not an error, and there is no current way to make it an error.

The location is here: https://github.com/kripken/emscripten/blob/master/emcc.py#L881

I feel like our default behavior should be to give a real error and a real exit code, and have some flag -missing-library-is-a-warning to demote the error to being just a warning, however this can cause breakages for people.

This is similar to #2714 (and #2713 which was already done earlier), the rationale of each of these items are about behaving consistently compared to other compiler toolchains. I think we should make this change and #2714 coordinated at the same time, to make people handle the resulting breakages in one go. Then have a good way to revert to just warning if people want to go with the old behavior.

@kripken: what's your thinking? I remember you gave me a green light on implementing #2714 a long time ago on IRC :) But I never quite found the good moment to do that which would have been decoupled from other big changes we have had. So we should find some moment to do this.

All of these entries (this bug + #2713 + #2714) originally arose from the fact that the lax/non-strict behavior was convenient to have when porting things, when one can ignore certain things while working on a build system to run through the Emscripten pipeline. Do we have any other non-rigorous behavior like these that we should account for while we are at this? I'd really like to make Emscripten behave strictly like other compilers with respect to these aspects (along with linker options or perhaps env. vars that allow falling to the lax behavior when it is convenient for a porter to do so)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions