Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ on:
- deps/sqlite/**
- deps/uv/**
- deps/uvwasi/**
- deps/v8/third_party/highway/**
- deps/zlib/**
- deps/zstd/**
- doc/**
Expand Down Expand Up @@ -86,6 +87,7 @@ on:
- deps/sqlite/**
- deps/uv/**
- deps/uvwasi/**
- deps/v8/third_party/highway/**
- deps/zlib/**
- deps/zstd/**
- doc/**
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
$(RM) -r $(TARNAME)/deps/sqlite
$(RM) -r $(TARNAME)/deps/uv
$(RM) -r $(TARNAME)/deps/uvwasi
$(RM) -r $(TARNAME)/deps/v8/third_party/highway
$(RM) -r $(TARNAME)/deps/zlib
$(RM) -r $(TARNAME)/deps/zstd
else
Expand Down
23 changes: 23 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,28 @@
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',
Expand Down Expand Up @@ -2821,6 +2843,7 @@ def make_bin_override():
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')
Expand Down
1 change: 1 addition & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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',
Expand Down
3 changes: 3 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ let
];
buildInputs =
pkgs.lib.optional useSharedICU icu
++ 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
Expand All @@ -75,6 +76,7 @@ let
)
"--v8-${if withTemporal then "enable" else "disable"}-temporal-support"
]
++ pkgs.lib.optional (builtins.hasAttr "highway" sharedLibDeps) "--shared-highway"
++ pkgs.lib.optional (withTemporal && useSharedTemporal) "--shared-temporal_capi"
++ pkgs.lib.optional withPerfetto "--with-perfetto";
in
Expand Down Expand Up @@ -132,6 +134,7 @@ pkgs.mkShell {
builtins.attrNames (
if (useSeparateDerivationForV8 != false) then
builtins.removeAttrs sharedLibDeps [
"highway"
"simdutf"
"temporal_capi"
]
Expand Down
1 change: 1 addition & 0 deletions tools/nix/sharedLibDeps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
;
cares = pkgs.c-ares;
hdr-histogram = pkgs.hdrhistogram_c;
highway = pkgs.libhwy;
http-parser = pkgs.llhttp;
nghttp2 = pkgs.nghttp2.overrideAttrs {
version = "1.69.0";
Expand Down
16 changes: 10 additions & 6 deletions tools/nix/v8.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
}:

let
useSharedHighway = builtins.elem "--shared-highway" configureFlags;
src =
let
inherit (lib) fileset;
Expand Down Expand Up @@ -63,12 +64,15 @@ let
potentiallyAlreadyRemovedFiles =
# Files that are removed in the release tarball (see Makefile $(TARBALL) target)
[ (fileset.difference ../../deps/v8/test ../../deps/v8/test/torque) ]
++ (builtins.filter builtins.pathExists [
../../deps/v8/samples
../../deps/v8/tools/profviz
../../deps/v8/tools/run-tests.py
../../deps/v8/third_party/ittapi
]);
++ (builtins.filter builtins.pathExists (
[
../../deps/v8/samples
../../deps/v8/tools/profviz
../../deps/v8/tools/run-tests.py
../../deps/v8/third_party/ittapi
]
++ lib.optional useSharedHighway ../../deps/v8/third_party/highway
));
trackedFiles =
({
# This line is being modified by Makefile $(TARBALL) target, any change to it should be sync
Expand Down
64 changes: 33 additions & 31 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2444,10 +2444,35 @@
'target_name': 'highway',
'type': 'static_library',
'toolsets': ['host', 'target'],
'variables': {
'HIGHWAY_ROOT': '../../deps/v8/third_party/highway',
},
'all_dependent_settings': {
'conditions': [['node_shared_highway=="false"', {
'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',
],
Expand All @@ -2461,34 +2486,11 @@
['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',],
}],
],
'sources': [
'<!@pymod_do_main(GN-scraper "<(HIGHWAY_ROOT)/BUILD.gn" "source_set.\\"libhwy.*?sources = ")',
],
'sources': [
'<!@pymod_do_main(GN-scraper "<(HIGHWAY_ROOT)/BUILD.gn" "source_set.\\"libhwy.*?sources = ")',
],
}]],
}, # highway
{
'target_name': 'simdutf',
Expand Down
Loading