Skip to content

Commit 3f29a11

Browse files
committed
build: add --shared-abseil-cpp configure flag
1 parent f0341c3 commit 3f29a11

File tree

8 files changed

+105
-21
lines changed

8 files changed

+105
-21
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
12521252
$(RM) -r $(TARNAME)/deps/sqlite
12531253
$(RM) -r $(TARNAME)/deps/uv
12541254
$(RM) -r $(TARNAME)/deps/uvwasi
1255+
$(RM) -r $(TARNAME)/deps/v8/third_party/abseil-cpp
12551256
$(RM) -r $(TARNAME)/deps/zlib
12561257
$(RM) -r $(TARNAME)/deps/zstd
12571258
else

configure.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,28 @@
598598
dest='shared_simdutf_libpath',
599599
help='a directory to search for the shared simdutf DLL')
600600

601+
shared_optgroup.add_argument('--shared-abseil-cpp',
602+
action='store_true',
603+
dest='shared_abseil',
604+
default=None,
605+
help='link to a shared abseil DLL instead of static linking')
606+
607+
shared_optgroup.add_argument('--shared-abseil-cpp-includes',
608+
action='store',
609+
dest='shared_abseil_includes',
610+
help='directory containing abseil header files')
611+
612+
shared_optgroup.add_argument('--shared-abseil-cpp-libname',
613+
action='store',
614+
dest='shared_abseil_libname',
615+
default='absl_base,absl_strings,absl_synchronization,absl_time,absl_int128,absl_raw_hash_set,absl_hash,absl_city,absl_debugging_internal,absl_demangle_internal,absl_stacktrace,absl_symbolize,absl_malloc_internal,absl_raw_logging_internal,absl_throw_delegate,absl_time_zone,absl_civil_time,absl_spinlock_wait,absl_graphcycles_internal,absl_kernel_timeout_internal,absl_strings_internal,absl_str_format_internal',
616+
help='alternative lib name to link to [default: %(default)s]')
617+
618+
shared_optgroup.add_argument('--shared-abseil-cpp-libpath',
619+
action='store',
620+
dest='shared_abseil_libpath',
621+
help='a directory to search for the shared abseil DLL')
622+
601623
shared_optgroup.add_argument('--shared-ada',
602624
action='store_true',
603625
dest='shared_ada',
@@ -2622,6 +2644,7 @@ def make_bin_override():
26222644
configure_library('zlib', output)
26232645
configure_library('http_parser', output, pkgname='libllhttp')
26242646
configure_library('libuv', output)
2647+
configure_library('abseil', output, pkgname='absl')
26252648
configure_library('ada', output)
26262649
configure_library('simdjson', output)
26272650
configure_library('simdutf', output)

node.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
'node_lib_target_name%': 'libnode',
1313
'node_module_version%': '',
1414
'node_no_browser_globals%': 'false',
15+
'node_shared_abseil%': 'false',
1516
'node_shared_brotli%': 'false',
1617
'node_shared_cares%': 'false',
1718
'node_shared_gtest%': 'false',

tools/nix/sharedLibDeps.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
zlib
2020
zstd
2121
;
22+
abseil-cpp = pkgs.abseil-cpp.overrideAttrs {
23+
src = pkgs.fetchgit {
24+
url = "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git";
25+
rev = "3fb321d9764442ceaf2e17b6e68ab6b6836bc78a";
26+
hash = "sha256-KpjXpyWp9x0cSmyh3uwn0fwKreHA0Cb8c0rD+RHYB80=";
27+
};
28+
};
2229
cares = pkgs.c-ares;
2330
hdr-histogram = pkgs.hdrhistogram_c;
2431
http-parser = pkgs.llhttp;

tools/v8_gypfiles/abseil.gyp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
'includes': ['toolchain.gypi'],
3+
'variables': {
4+
'node_shared_abseil%': 'false',
5+
},
36
'targets': [
47
{
58
'target_name': 'abseil',
6-
'type': 'static_library',
9+
'type': '<(library)',
710
'toolsets': ['host', 'target'],
811
'variables': {
912
'ABSEIL_ROOT': '../../deps/v8/third_party/abseil-cpp',
@@ -19,7 +22,9 @@
1922
'include_dirs': [
2023
'<(ABSEIL_ROOT)',
2124
],
22-
'sources': [
25+
'conditions': [
26+
['node_shared_abseil=="false"', {
27+
'sources': [
2328
'<(ABSEIL_ROOT)/absl/algorithm/algorithm.h',
2429
'<(ABSEIL_ROOT)/absl/algorithm/container.h',
2530
'<(ABSEIL_ROOT)/absl/base/attributes.h',
@@ -367,7 +372,9 @@
367372
'<(ABSEIL_ROOT)/absl/types/span.h',
368373
'<(ABSEIL_ROOT)/absl/types/variant.h',
369374
'<(ABSEIL_ROOT)/absl/utility/utility.h',
370-
]
375+
]
376+
}], # node_shared_abseil=="false"
377+
],
371378
}, # abseil
372379
]
373380
}

tools/v8_gypfiles/d8.gyp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
'target_name': 'd8',
1717
'type': 'executable',
1818
'dependencies': [
19-
'abseil.gyp:abseil',
2019
'v8.gyp:v8',
2120
'v8.gyp:v8_libbase',
2221
'v8.gyp:v8_libplatform',
@@ -33,6 +32,9 @@
3332
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_executable.\\"d8\\".*?sources = ")',
3433
],
3534
'conditions': [
35+
['node_shared_abseil=="false"', {
36+
'dependencies': ['abseil.gyp:abseil'],
37+
}],
3638
[ 'want_separate_host_toolset==1', {
3739
'toolsets': [ 'target', ],
3840
'dependencies': [

tools/v8_gypfiles/v8.gyp

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,15 @@
286286
'v8_initializers',
287287
'v8_maybe_icu',
288288
'fp16',
289-
'abseil.gyp:abseil',
290289
],
291290
'sources': [
292291
'<(V8_ROOT)/src/init/setup-isolate-full.cc',
293292
],
293+
'conditions': [
294+
['node_shared_abseil=="false"', {
295+
'dependencies': ['abseil.gyp:abseil'],
296+
}],
297+
],
294298
}, # v8_init
295299
{
296300
# This target is used to work around a GCC issue that causes the
@@ -303,7 +307,6 @@
303307
'generate_bytecode_builtins_list',
304308
'run_torque',
305309
'fp16',
306-
'abseil.gyp:abseil',
307310
],
308311
'cflags!': ['-O3'],
309312
'cflags': ['-O1'],
@@ -314,6 +317,9 @@
314317
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.cc',
315318
],
316319
'conditions': [
320+
['node_shared_abseil=="false"', {
321+
'dependencies': ['abseil.gyp:abseil'],
322+
}],
317323
['v8_enable_i18n_support==1', {
318324
'dependencies': [
319325
'<(icu_gyp_path):icui18n',
@@ -337,7 +343,6 @@
337343
'v8_shared_internal_headers',
338344
'v8_pch',
339345
'fp16',
340-
'abseil.gyp:abseil',
341346
],
342347
'include_dirs': [
343348
'<(SHARED_INTERMEDIATE_DIR)',
@@ -347,6 +352,9 @@
347352
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?sources = ")',
348353
],
349354
'conditions': [
355+
['node_shared_abseil=="false"', {
356+
'dependencies': ['abseil.gyp:abseil'],
357+
}],
350358
['v8_enable_webassembly==1', {
351359
'dependencies': [
352360
'v8_initializers_slow',
@@ -534,7 +542,6 @@
534542
'v8_compiler_for_mksnapshot',
535543
'v8_initializers',
536544
'v8_libplatform',
537-
'abseil.gyp:abseil',
538545
'fp16',
539546
]
540547
}, {
@@ -548,10 +555,12 @@
548555
'v8_compiler_for_mksnapshot',
549556
'v8_initializers',
550557
'v8_libplatform',
551-
'abseil.gyp:abseil',
552558
'fp16',
553559
]
554560
}],
561+
['node_shared_abseil=="false"', {
562+
'dependencies': ['abseil.gyp:abseil'],
563+
}],
555564
['OS=="win" and clang==1', {
556565
'actions': [
557566
{
@@ -664,7 +673,6 @@
664673
'run_torque',
665674
'v8_libbase',
666675
'fp16',
667-
'abseil.gyp:abseil',
668676
],
669677
'direct_dependent_settings': {
670678
'sources': [
@@ -896,6 +904,11 @@
896904
}],
897905
],
898906
},
907+
'conditions': [
908+
['node_shared_abseil=="false"', {
909+
'dependencies': ['abseil.gyp:abseil'],
910+
}],
911+
],
899912
}, # v8_internal_headers
900913
{
901914
'target_name': 'v8_compiler_sources',
@@ -998,9 +1011,11 @@
9981011
'v8_shared_internal_headers',
9991012
'v8_pch',
10001013
'fp16',
1001-
'abseil.gyp:abseil',
10021014
],
10031015
'conditions': [
1016+
['node_shared_abseil=="false"', {
1017+
'dependencies': ['abseil.gyp:abseil'],
1018+
}],
10041019
['v8_enable_maglev==0', {
10051020
'sources': [
10061021
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?!v8_enable_maglev.*?sources \\+= ")',
@@ -1116,7 +1131,6 @@
11161131
'fp16',
11171132
'highway',
11181133
'simdutf',
1119-
'abseil.gyp:abseil',
11201134
],
11211135
'includes': ['inspector.gypi'],
11221136
'direct_dependent_settings': {
@@ -1133,6 +1147,9 @@
11331147
'<@(inspector_all_sources)',
11341148
],
11351149
'conditions': [
1150+
['node_shared_abseil=="false"', {
1151+
'dependencies': ['abseil.gyp:abseil'],
1152+
}],
11361153
['v8_enable_snapshot_compression==1', {
11371154
'sources': [
11381155
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_snapshot_compression.*?sources \\+= ")',
@@ -1411,13 +1428,17 @@
14111428
'dependencies': [
14121429
'v8_shared_internal_headers',
14131430
'v8_libbase',
1414-
'abseil.gyp:abseil',
14151431
],
14161432
'defines!': [
14171433
'_HAS_EXCEPTIONS=0',
14181434
'BUILDING_V8_SHARED=1',
14191435
'BUILDING_V8_PLATFORM_SHARED=1',
14201436
],
1437+
'conditions': [
1438+
['node_shared_abseil=="false"', {
1439+
'dependencies': ['abseil.gyp:abseil'],
1440+
}],
1441+
],
14211442
'cflags_cc!': ['-fno-exceptions'],
14221443
'cflags_cc': ['-fexceptions'],
14231444
'xcode_settings': {
@@ -1467,10 +1488,12 @@
14671488

14681489
'dependencies': [
14691490
'v8_headers',
1470-
'abseil.gyp:abseil',
14711491
],
14721492

14731493
'conditions': [
1494+
['node_shared_abseil=="false"', {
1495+
'dependencies': ['abseil.gyp:abseil'],
1496+
}],
14741497
['is_component_build', {
14751498
'defines': ["BUILDING_V8_BASE_SHARED"],
14761499
}],
@@ -1716,12 +1739,14 @@
17161739
'toolsets': ['host', 'target'],
17171740
'dependencies': [
17181741
'v8_libbase',
1719-
'abseil.gyp:abseil',
17201742
],
17211743
'sources': [
17221744
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_libplatform.*?sources = ")',
17231745
],
17241746
'conditions': [
1747+
['node_shared_abseil=="false"', {
1748+
'dependencies': ['abseil.gyp:abseil'],
1749+
}],
17251750
['component=="shared_library"', {
17261751
'direct_dependent_settings': {
17271752
'defines': ['USING_V8_PLATFORM_SHARED'],
@@ -1789,7 +1814,6 @@
17891814
],
17901815
'dependencies': [
17911816
'v8_libbase',
1792-
'abseil.gyp:abseil',
17931817
# "build/win:default_exe_manifest",
17941818
],
17951819
'sources': [
@@ -1800,6 +1824,11 @@
18001824
"<(V8_ROOT)/src/interpreter/bytecodes.cc",
18011825
"<(V8_ROOT)/src/interpreter/bytecodes.h",
18021826
],
1827+
'conditions': [
1828+
['node_shared_abseil=="false"', {
1829+
'dependencies': ['abseil.gyp:abseil'],
1830+
}],
1831+
],
18031832
}, # bytecode_builtins_list_generator
18041833
{
18051834
'target_name': 'mksnapshot',
@@ -1813,7 +1842,6 @@
18131842
'v8_maybe_icu',
18141843
'v8_pch',
18151844
'fp16',
1816-
'abseil.gyp:abseil',
18171845
# "build/win:default_exe_manifest",
18181846
],
18191847
'sources': [
@@ -1838,6 +1866,9 @@
18381866
},
18391867
},
18401868
'conditions': [
1869+
['node_shared_abseil=="false"', {
1870+
'dependencies': ['abseil.gyp:abseil'],
1871+
}],
18411872
['want_separate_host_toolset', {
18421873
'toolsets': ['host'],
18431874
}],
@@ -1852,10 +1883,12 @@
18521883
'type': 'executable',
18531884
'dependencies': [
18541885
'torque_base',
1855-
'abseil.gyp:abseil',
18561886
# "build/win:default_exe_manifest",
18571887
],
18581888
'conditions': [
1889+
['node_shared_abseil=="false"', {
1890+
'dependencies': ['abseil.gyp:abseil'],
1891+
}],
18591892
['want_separate_host_toolset', {
18601893
'toolsets': ['host'],
18611894
}],
@@ -1930,9 +1963,11 @@
19301963
'v8_libbase',
19311964
# "build/win:default_exe_manifest",
19321965
'v8_maybe_icu',
1933-
'abseil.gyp:abseil',
19341966
],
19351967
'conditions': [
1968+
['node_shared_abseil=="false"', {
1969+
'dependencies': ['abseil.gyp:abseil'],
1970+
}],
19361971
['want_separate_host_toolset', {
19371972
'toolsets': ['host'],
19381973
}],

0 commit comments

Comments
 (0)