Skip to content

Hide internal symbols in amalgamated build #940

Closed

Description

@bnoordhuis

Internal APIs from cutils.c and other utility functions should be made static in the amalgamated source to prevent name clashes with the project it is linked to.

Suggested solutions:

  1. use the preprocessor with a JS_INTERNAL storage class for such symbols that would expand to nothing in the regular case and to static in the amalgamated source

  2. add the static keyword on all symbols not explicitly tagged as JS_EXTERN when amalgamating sources

Originally posted by @chqrlie in #936 (comment) with light editing by yours truly

Activity

  1. bnoordhuis commented on Sep 5, 2026

    @bnoordhuis
    ContributorAuthor

    This was fixed by #1344. It's a little regrettable code from cutils.h gets duplicated into multiple .c files now but that only affects non-amalgamated builds.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions