Skip to content

Commit d726a17

Browse files
committed
build: Remove building against a shared V8
This action is to encourage packagers to not build against a shared V8 library since even minor bumps of V8 can create issues. PR-URL: #1331 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent d72e50a commit d726a17

File tree

4 files changed

+16
-63
lines changed

4 files changed

+16
-63
lines changed

configure

-32
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,6 @@ parser.add_option('--shared-openssl-libpath',
148148
dest='shared_openssl_libpath',
149149
help='a directory to search for the shared OpenSSL DLLs')
150150

151-
parser.add_option('--shared-v8',
152-
action='store_true',
153-
dest='shared_v8',
154-
help='link to a shared V8 DLL instead of static linking')
155-
156-
parser.add_option('--shared-v8-includes',
157-
action='store',
158-
dest='shared_v8_includes',
159-
help='directory containing V8 header files')
160-
161-
parser.add_option('--shared-v8-libname',
162-
action='store',
163-
dest='shared_v8_libname',
164-
help='alternative lib name to link to (default: \'v8\')')
165-
166-
parser.add_option('--shared-v8-libpath',
167-
action='store',
168-
dest='shared_v8_libpath',
169-
help='a directory to search for the shared V8 DLL')
170-
171151
parser.add_option('--shared-zlib',
172152
action='store_true',
173153
dest='shared_zlib',
@@ -656,24 +636,12 @@ def configure_libuv(o):
656636

657637

658638
def configure_v8(o):
659-
o['variables']['node_shared_v8'] = b(options.shared_v8)
660639
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
661640
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
662641
o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds.
663642
o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables.
664643
o['variables']['v8_use_snapshot'] = b(options.with_snapshot)
665644

666-
# assume shared_v8 if one of these is set?
667-
if options.shared_v8_libpath:
668-
o['libraries'] += ['-L%s' % options.shared_v8_libpath]
669-
if options.shared_v8_libname:
670-
o['libraries'] += ['-l%s' % options.shared_v8_libname]
671-
elif options.shared_v8:
672-
o['libraries'] += ['-lv8', '-lv8_platform']
673-
if options.shared_v8_includes:
674-
o['include_dirs'] += [options.shared_v8_includes]
675-
676-
677645
def configure_openssl(o):
678646
o['variables']['node_use_openssl'] = b(not options.without_ssl)
679647
o['variables']['node_shared_openssl'] = b(options.shared_openssl)

doc/api/process.markdown

-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,6 @@ An example of the possible output looks like:
594594
node_shared_cares: 'false',
595595
node_shared_http_parser: 'false',
596596
node_shared_libuv: 'false',
597-
node_shared_v8: 'false',
598597
node_shared_zlib: 'false',
599598
node_use_dtrace: 'false',
600599
node_use_openssl: 'true',

node.gyp

+15-28
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
'node_use_etw%': 'false',
77
'node_use_perfctr%': 'false',
88
'node_has_winsdk%': 'false',
9-
'node_shared_v8%': 'false',
109
'node_shared_zlib%': 'false',
1110
'node_shared_http_parser%': 'false',
1211
'node_shared_libuv%': 'false',
@@ -81,14 +80,17 @@
8180

8281
'dependencies': [
8382
'node_js2c#host',
84-
'deps/cares/cares.gyp:cares'
83+
'deps/cares/cares.gyp:cares',
84+
'deps/v8/tools/gyp/v8.gyp:v8',
85+
'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
8586
],
8687

8788
'include_dirs': [
8889
'src',
8990
'tools/msvs/genfiles',
9091
'deps/uv/src/ares',
91-
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
92+
'<(SHARED_INTERMEDIATE_DIR)', # for node_natives.h
93+
'deps/v8' # include/v8_platform.h
9294
],
9395

9496
'sources': [
@@ -163,6 +165,8 @@
163165
'src/util-inl.h',
164166
'src/util.cc',
165167
'deps/http_parser/http_parser.h',
168+
'deps/v8/include/v8.h',
169+
'deps/v8/include/v8-debug.h',
166170
'<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
167171
# javascript files to make for an even more pleasant IDE experience
168172
'<@(library_files)',
@@ -306,19 +310,6 @@
306310
],
307311
},
308312
}],
309-
[ 'node_shared_v8=="false"', {
310-
'sources': [
311-
'deps/v8/include/v8.h',
312-
'deps/v8/include/v8-debug.h',
313-
],
314-
'dependencies': [
315-
'deps/v8/tools/gyp/v8.gyp:v8',
316-
'deps/v8/tools/gyp/v8.gyp:v8_libplatform',
317-
],
318-
# libplatform/libplatform.h includes include/v8platform.h
319-
'include_dirs': [ 'deps/v8' ],
320-
}],
321-
322313
[ 'node_shared_zlib=="false"', {
323314
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
324315
}],
@@ -381,17 +372,13 @@
381372
],
382373
}],
383374
[ 'OS=="freebsd" or OS=="linux"', {
384-
'ldflags': [ '-Wl,-z,noexecstack' ],
375+
'ldflags': [ '-Wl,-z,noexecstack',
376+
'-Wl,--whole-archive <(V8_BASE)',
377+
'-Wl,--no-whole-archive' ]
385378
}],
386379
[ 'OS=="sunos"', {
387380
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],
388381
}],
389-
[
390-
'OS in "linux freebsd" and node_shared_v8=="false"', {
391-
'ldflags': [
392-
'-Wl,--whole-archive <(V8_BASE) -Wl,--no-whole-archive',
393-
],
394-
}],
395382
],
396383
'msvs_settings': {
397384
'VCManifestTool': {
@@ -619,14 +606,14 @@
619606
{
620607
'target_name': 'cctest',
621608
'type': 'executable',
622-
'dependencies': [ 'deps/gtest/gtest.gyp:gtest' ],
623-
'conditions': [
624-
[ 'node_shared_v8=="false"', {
625-
'dependencies': [ 'deps/v8/tools/gyp/v8.gyp:v8' ],
626-
}],
609+
'dependencies': [
610+
'deps/gtest/gtest.gyp:gtest',
611+
'deps/v8/tools/gyp/v8.gyp:v8',
612+
'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
627613
],
628614
'include_dirs': [
629615
'src',
616+
'deps/v8/include'
630617
],
631618
'defines': [
632619
# gtest's ASSERT macros conflict with our own.

tools/install.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def files(action):
168168
], 'include/node/')
169169

170170
subdir_files('deps/cares/include', 'include/node/', action)
171+
subdir_files('deps/v8/include', 'include/node/', action)
171172

172173
if 'false' == variables.get('node_shared_libuv'):
173174
subdir_files('deps/uv/include', 'include/node/', action)
@@ -176,8 +177,6 @@ def files(action):
176177
subdir_files('deps/openssl/openssl/include/openssl', 'include/node/openssl/', action)
177178
action(['deps/openssl/config/opensslconf.h'], 'include/node/openssl/')
178179

179-
if 'false' == variables.get('node_shared_v8'):
180-
subdir_files('deps/v8/include', 'include/node/', action)
181180

182181
if 'false' == variables.get('node_shared_zlib'):
183182
action([

0 commit comments

Comments
 (0)