Skip to content

Only export API symbols for shared builds#1525

Open
dannote wants to merge 1 commit into
quickjs-ng:masterfrom
dannote:export-symbols-only-for-shared
Open

Only export API symbols for shared builds#1525
dannote wants to merge 1 commit into
quickjs-ng:masterfrom
dannote:export-symbols-only-for-shared

Conversation

@dannote
Copy link
Copy Markdown

@dannote dannote commented Jun 6, 2026

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

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.

2 participants