8
0
Files
nodejs-electron/v8-hide-private-symbols.patch

22 lines
721 B
Diff
Raw Normal View History

Do not export v8 symbols that are used only in unit tests but not exposed in headers.
This reduces the size of the electron binary by 2MB.
--- src/v8/src/base/macros.h.old 2023-09-29 08:54:55.701965801 +0200
+++ src/v8/src/base/macros.h 2023-10-03 11:54:02.305086047 +0200
@@ -399,11 +399,15 @@ bool is_inbounds(float_t v) {
// Setup for Linux shared library export.
#if V8_HAS_ATTRIBUTE_VISIBILITY
+#if defined(HIDE_PRIVATE_SYMBOLS)
+#define V8_EXPORT_PRIVATE __attribute__((visibility("hidden")))
+#else
#ifdef BUILDING_V8_SHARED
#define V8_EXPORT_PRIVATE __attribute__((visibility("default")))
#else
#define V8_EXPORT_PRIVATE
#endif
+#endif // HIDE_PRIVATE_SYMBOLS
#else
#define V8_EXPORT_PRIVATE
#endif