Skip to content

Only export API symbols for shared builds#1525

Merged
bnoordhuis merged 1 commit into
quickjs-ng:masterfrom
dannote:export-symbols-only-for-shared
Jun 10, 2026
Merged

Only export API symbols for shared builds#1525
bnoordhuis merged 1 commit into
quickjs-ng:masterfrom
dannote:export-symbols-only-for-shared

Conversation

@dannote

@dannote dannote commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Related to #940.

Public API symbols currently get default visibility on GNU-like compilers whenever QUICKJS_NG_CC_GNULIKE is defined. For static/vendored builds, that can bypass an embedder’s -fvisibility=hidden setup and export QuickJS symbols from the embedding shared object.

Gate default visibility on the build modes that actually need exported symbols:

  • JS_EXTERN: BUILDING_QJS_SHARED
  • JS_MODULE_EXTERN: QUICKJS_NG_MODULE_BUILD

Windows import/export handling is unchanged.

Tested:

make -j2 build/qjs

@bnoordhuis bnoordhuis merged commit 66adc82 into quickjs-ng:master Jun 10, 2026
124 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants