Skip to content

Commit fb6007e

Browse files
committed
fix(ios): export the public V8 API from the prebuilt archives
The matrix build sets v8_monolithic=false, which stopped triggering the gni/v8.gni swap from Chromium's default -fvisibility=hidden to default visibility. Every symbol in the shipped archives became private-external, so NativeScript.framework exports no v8:: symbols and plugins that link the public V8 API through it (e.g. @nativescript/canvas) fail the app link with undefined v8::* symbols on runtime 9.x. v8_expose_public_symbols=true defines BUILDING_V8_SHARED, giving the V8_EXPORT surface (~2.7k symbols incl. cppgc and the v8::internal helpers referenced by inline header code) default visibility while keeping internals hidden and dead-strippable: ~+0.5 MB per slice versus ~+3.4 MB for restoring global default visibility. Android is unaffected: it builds with v8_monolithic=true, which still triggers the visibility swap.
1 parent 9041230 commit fb6007e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

scripts/matrix/build-ios.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ MODULES=(
7171
# where JIT is permitted, and is deliberately not lite -- keeping the two arg
7272
# sets distinct preserves what each currently ships.
7373
#
74+
# v8_expose_public_symbols marks the V8_EXPORT API default-visibility. Plugins
75+
# (e.g. @nativescript/canvas) compile against the vendored V8 headers and
76+
# resolve v8:: symbols against NativeScript.framework at the app link, and
77+
# ld64 cannot export a symbol these objects hide: Chromium compiles with
78+
# -fvisibility=hidden by default, and the gni/v8.gni swap to default
79+
# visibility only fires for backtrace or monolithic builds, neither of which
80+
# applies here.
81+
#
7482
# cppgc_enable_caged_heap=false is load-bearing and not implied by anything
7583
# else here. It defaults to true on arm64 ("Enable heap reservation of size
7684
# 4GB") independently of v8_enable_pointer_compression, and enabling it forces
@@ -92,6 +100,7 @@ GN_ARGS="
92100
v8_control_flow_integrity=false
93101
v8_monolithic=false
94102
v8_static_library=true
103+
v8_expose_public_symbols=true
95104
v8_use_external_startup_data=false
96105
v8_enable_sandbox=false
97106
v8_enable_debugging_features=false

0 commit comments

Comments
 (0)