Commit 4b20192
committed
build: stop exporting V8's internals from the optimized runtime
set_target_properties takes key/value pairs, so the unquoted
PROPERTIES LINK_FLAGS -Wl,--allow-multiple-definition -Wl,--exclude-libs=ALL -Wl,--gc-sections
set LINK_FLAGS to only -Wl,--allow-multiple-definition and then read
-Wl,--exclude-libs=ALL as a property name whose value was -Wl,--gc-sections,
which CMake silently discarded. libNativeScript.so was therefore exporting
72,662 dynamic symbols on arm64-v8a, 12.1 MiB of them .dynstr for names V8
never meant to publish.
Quote the flag list so all three apply, and hide the internals with a linker
version script rather than --exclude-libs=ALL: the latter would also hide
V8's public API, which plugins link against. exported-symbols.map keeps the
JNI entry points and v8::/cppgc:: public API global and everything else
local.
arm64-v8a, stripped: 47,433,360 -> 26,773,104 bytes; 72,662 -> 1,748
exported symbols, of which 8 v8::internal:: template instantiations whose
demangled name begins with a v8::Maybe<T> return type.1 parent bab7ce3 commit 4b20192
2 files changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments