Skip to content

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

Closed

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)

Activity

  1. juj commented on Mar 31, 2016

    @juj
    CollaboratorAuthor

    Probably will need to pass the built-in auto-link src/library_x.js libraries in our ignore whitelist as well, which would be -lopenal, GLFW and GLEW libraries at least (not sure what the link directives for those are)

  2. kripken commented on Apr 1, 2016

    @kripken
    Member

    I'm ok with this change, if as in the other one, the error message explains how to return to the old more lenient behavior. Flag could parallel ERROR_ON_UNDEFINED_SYMBOLS, maybe ERROR_ON_MISSING_LIBRARIES.

  3. stale commented on Aug 30, 2019

    @stale

    This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions