build: add --shared-highway configure flag

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65686
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
This commit is contained in:
Antoine du Hamel committed 2026-09-15 10:49:32 +02:00
1 parent c99af0942b
commit 120929a1b3
9 files changed
+100 -59

No files matched your search

+2
View File
@@ -34,6 +34,7 @@ on:
- deps/uv/**
- deps/uvwasi/**
- deps/v8/third_party/abseil-cpp/**
- deps/v8/third_party/highway/**
- deps/zlib/**
- deps/zstd/**
- doc/**
@@ -88,6 +89,7 @@ on:
- deps/uv/**
- deps/uvwasi/**
- deps/v8/third_party/abseil-cpp/**
- deps/v8/third_party/highway/**
- deps/zlib/**
- deps/zstd/**
- doc/**
+1
View File
@@ -1324,6 +1324,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
$(RM) -r $(TARNAME)/deps/uv
$(RM) -r $(TARNAME)/deps/uvwasi
$(RM) -r $(TARNAME)/deps/v8/third_party/abseil-cpp
$(RM) -r $(TARNAME)/deps/v8/third_party/highway
$(RM) -r $(TARNAME)/deps/zlib
$(RM) -r $(TARNAME)/deps/zstd
else
+23
View File
@@ -348,6 +348,28 @@ shared_optgroup.add_argument('--shared-hdr-histogram-libpath',
dest='shared_hdr_histogram_libpath',
help='a directory to search for the shared HdrHistogram DLL')
shared_optgroup.add_argument('--shared-highway',
action='store_true',
dest='shared_highway',
default=None,
help='link to a shared Highway (hwy) DLL instead of static linking')
shared_optgroup.add_argument('--shared-highway-includes',
action='store',
dest='shared_highway_includes',
help='directory containing Highway header files')
shared_optgroup.add_argument('--shared-highway-libname',
action='store',
dest='shared_highway_libname',
default='hwy',
help='alternative lib name to link to [default: %(default)s]')
shared_optgroup.add_argument('--shared-highway-libpath',
action='store',
dest='shared_highway_libpath',
help='a directory to search for the shared Highway DLL')
shared_optgroup.add_argument('--shared-http-parser',
action='store_true',
dest='shared_http_parser',
@@ -2908,6 +2930,7 @@ configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc'])
configure_library('cares', output, pkgname='libcares')
configure_library('gtest', output)
configure_library('hdr_histogram', output)
configure_library('highway', output, pkgname='libhwy')
configure_library('merve', output)
configure_library('nbytes', output)
configure_library('nghttp2', output, pkgname='libnghttp2')
+1
View File
@@ -20,6 +20,7 @@
'node_shared_cares%': 'false',
'node_shared_gtest%': 'false',
'node_shared_hdr_histogram%': 'false',
'node_shared_highway%': 'false',
'node_shared_http_parser%': 'false',
'node_shared_libuv%': 'false',
'node_shared_lief%': 'false',
+3
View File
@@ -64,6 +64,7 @@ let
buildInputs =
pkgs.lib.optional useSharedICU icu
++ pkgs.lib.optional (builtins.hasAttr "abseil" sharedLibDeps) sharedLibDeps.abseil
++ pkgs.lib.optional (builtins.hasAttr "highway" sharedLibDeps) sharedLibDeps.highway
++ pkgs.lib.optional (withTemporal && useSharedTemporal) sharedLibDeps.temporal_capi;
# Put here only the configure flags that affect the V8 build
@@ -77,6 +78,7 @@ let
"--v8-${if withTemporal then "enable" else "disable"}-temporal-support"
]
++ pkgs.lib.optional (builtins.hasAttr "abseil" sharedLibDeps) "--shared-abseil"
++ pkgs.lib.optional (builtins.hasAttr "highway" sharedLibDeps) "--shared-highway"
++ pkgs.lib.optional (withTemporal && useSharedTemporal) "--shared-temporal_capi"
++ pkgs.lib.optional withPerfetto "--with-perfetto";
in
@@ -135,6 +137,7 @@ pkgs.mkShell {
if (useSeparateDerivationForV8 != false) then
builtins.removeAttrs sharedLibDeps [
"abseil"
"highway"
"simdutf"
"temporal_capi"
]
+1
View File
@@ -24,6 +24,7 @@
abseil = pkgs.abseil-cpp;
cares = pkgs.c-ares;
hdr-histogram = pkgs.hdrhistogram_c;
highway = pkgs.libhwy;
http-parser = pkgs.llhttp;
nghttp2 = pkgs.nghttp2.overrideAttrs {
version = "1.69.0";
+3
View File
@@ -24,6 +24,7 @@
let
useSharedAbseil = builtins.elem "--shared-abseil" configureFlags;
useSharedHighway = builtins.elem "--shared-highway" configureFlags;
src =
let
inherit (lib) fileset;
@@ -45,6 +46,7 @@ let
../../tools/v8_gypfiles/v8.gyp
]
++ lib.optional (!useSharedAbseil) ../../tools/v8_gypfiles/abseil.gyp
++ lib.optional (!useSharedHighway) ../../tools/v8_gypfiles/highway.gyp
++ lib.optionals (builtins.elem "--with-perfetto" configureFlags) [
../../deps/perfetto
]
@@ -72,6 +74,7 @@ let
../../deps/v8/third_party/ittapi
]
++ lib.optional useSharedAbseil ../../deps/v8/third_party/abseil-cpp
++ lib.optional useSharedHighway ../../deps/v8/third_party/highway
));
trackedFiles =
({
+58
View File
@@ -0,0 +1,58 @@
{
'includes': ['toolchain.gypi'],
'targets': [
{
'target_name': 'highway',
'type': 'static_library',
'toolsets': ['host', 'target'],
'variables': {
'HIGHWAY_ROOT': '../../deps/v8/third_party/highway',
},
'all_dependent_settings': {
'include_dirs': [
'<(HIGHWAY_ROOT)/src',
],
'conditions': [
['v8_target_arch=="ia32"', {
'defines': ['HWY_BROKEN_TARGETS=(HWY_AVX2|HWY_AVX3)',],
}],
['v8_target_arch=="arm64"', {
'defines': ['HWY_BROKEN_TARGETS=HWY_ALL_SVE',],
}],
['v8_target_arch=="ppc64" or v8_target_arch=="s390x"', {
'defines': ['TOOLCHAIN_MISS_ASM_HWCAP_H',],
}],
['v8_target_arch=="s390x"', {
'defines': ['HWY_BROKEN_EMU128=0',],
}],
['OS in "aix os400"', {
'defines': ['HWY_BROKEN_EMU128=0',],
}],
['v8_target_arch=="arm" and arm_version==7', {
'defines': ['HWY_BROKEN_EMU128=0',],
}],
],
},
'include_dirs': [
'<(HIGHWAY_ROOT)/src',
],
'conditions': [
['v8_target_arch=="ia32"', {
'defines': ['HWY_BROKEN_TARGETS=(HWY_AVX2|HWY_AVX3)',],
}],
['v8_target_arch=="arm64"', {
'defines': ['HWY_BROKEN_TARGETS=HWY_ALL_SVE',],
}],
['v8_target_arch=="ppc64" or v8_target_arch=="s390x"', {
'defines': ['TOOLCHAIN_MISS_ASM_HWCAP_H',],
}],
['v8_target_arch=="riscv64"', {
'defines': ['HWY_BROKEN_TARGETS=HWY_RVV',],
}],
],
'sources': [
'<!@pymod_do_main(GN-scraper "<(HIGHWAY_ROOT)/BUILD.gn" "source_set.\\"libhwy.*?sources = ")',
],
}, # highway
],
}
+8 -59
View File
@@ -641,7 +641,14 @@
'run_torque',
'v8_libbase',
'fp16',
'highway',
],
'conditions': [
['node_shared_abseil=="false"', {
'dependencies': ['abseil.gyp:abseil'],
}],
['node_shared_highway=="false"', {
'dependencies': ['highway.gyp:highway'],
}]
],
'direct_dependent_settings': {
'sources': [
@@ -886,11 +893,6 @@
}],
],
},
'conditions': [
['node_shared_abseil=="false"', {
'dependencies': ['abseil.gyp:abseil'],
}],
],
}, # v8_internal_headers
{
'target_name': 'v8_compiler_sources',
@@ -2467,59 +2469,6 @@
],
},
}, # fp16
{
'target_name': 'highway',
'type': 'static_library',
'toolsets': ['host', 'target'],
'variables': {
'HIGHWAY_ROOT': '../../deps/v8/third_party/highway',
},
'all_dependent_settings': {
'include_dirs': [
'<(HIGHWAY_ROOT)/src',
],
'conditions': [
['v8_target_arch=="ia32"', {
'defines': ['HWY_BROKEN_TARGETS=(HWY_AVX2|HWY_AVX3)',],
}],
['v8_target_arch=="arm64"', {
'defines': ['HWY_BROKEN_TARGETS=HWY_ALL_SVE',],
}],
['v8_target_arch=="ppc64" or v8_target_arch=="s390x"', {
'defines': ['TOOLCHAIN_MISS_ASM_HWCAP_H',],
}],
['v8_target_arch=="s390x"', {
'defines': ['HWY_BROKEN_EMU128=0',],
}],
['OS in "aix os400"', {
'defines': ['HWY_BROKEN_EMU128=0',],
}],
['v8_target_arch=="arm" and arm_version==7', {
'defines': ['HWY_BROKEN_EMU128=0',],
}],
],
},
'include_dirs': [
'<(HIGHWAY_ROOT)/src',
],
'conditions': [
['v8_target_arch=="ia32"', {
'defines': ['HWY_BROKEN_TARGETS=(HWY_AVX2|HWY_AVX3)',],
}],
['v8_target_arch=="arm64"', {
'defines': ['HWY_BROKEN_TARGETS=HWY_ALL_SVE',],
}],
['v8_target_arch=="ppc64" or v8_target_arch=="s390x"', {
'defines': ['TOOLCHAIN_MISS_ASM_HWCAP_H',],
}],
['v8_target_arch=="riscv64"', {
'defines': ['HWY_BROKEN_TARGETS=HWY_RVV',],
}],
],
'sources': [
'<!@pymod_do_main(GN-scraper "<(HIGHWAY_ROOT)/BUILD.gn" "source_set.\\"libhwy.*?sources = ")',
],
}, # highway
{
'target_name': 'simdutf',
'type': 'static_library',