Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: gyp node_base #23439

Closed
wants to merge 9 commits into from
Closed
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
5 changes: 4 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
'openssl_no_asm%': 0,
'openssl_fips%': '',

# Default to -O0 for debug builds.
'v8_optimized_debug%': 1,

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.9',
Expand Down Expand Up @@ -239,7 +242,7 @@
}, {
'msvs_settings': {
'VCCLCompilerTool': {
'WholeProgramOptimization': 'false'
'WholeProgramOptimization': 'false' # /GL-
},
'VCLinkerTool': {
'LinkIncremental': 2 # enable incremental linking
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,8 @@
],
}],
], # conditions
# Temporary refs: https://github.com/nodejs/node/pull/23801
'defines!': ['ENABLE_HANDLE_ZAPPING',],
}, # Release
}, # configurations
'msvs_disabled_warnings': [
Expand Down
166 changes: 166 additions & 0 deletions dtrace.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
'conditions': [
[ 'node_use_dtrace=="true"', {
'defines': [ 'HAVE_DTRACE=1' ],
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
#
# DTrace is supported on linux, solaris, mac, and bsd. There are
# three object files associated with DTrace support, but they're
# not all used all the time:
#
# node_dtrace.o all configurations
# node_dtrace_ustack.o not supported on mac and linux
# node_dtrace_provider.o All except OS X. "dtrace -G" is not
# used on OS X.
#
# Note that node_dtrace_provider.cc and node_dtrace_ustack.cc do not
# actually exist. They're listed here to trick GYP into linking the
# corresponding object files into the final "node" executable. These
# object files are generated by "dtrace -G" using custom actions
# below, and the GYP-generated Makefiles will properly build them when
# needed.
#
'sources': [ 'src/node_dtrace.cc' ],
'conditions': [
[ 'OS=="linux"', {
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/node_dtrace_header/node_dtrace_provider.o'
],
}],
[ 'OS!="mac" and OS!="linux"', {
'sources': [
'src/node_dtrace_ustack.cc',
'src/node_dtrace_provider.cc',
],
}],
],
}],
[ 'node_use_dtrace=="true" and OS!="linux"', {
'actions': [
{
'action_name': 'node_dtrace_header',
'inputs': [ 'src/node_provider.d' ],
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_header/node_provider.h' ],
'action': [ 'dtrace', '-h', '-xnolibs', '-s', '<@(_inputs)',
'-o', '<@(_outputs)' ]
}
]
} ],
[ 'node_use_dtrace=="true" and OS=="linux"', {
'actions': [
{
'action_name': 'node_dtrace_header',
'inputs': [ 'src/node_provider.d' ],
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_header/node_provider.h' ],
'action': [ 'dtrace', '-h', '-s', '<@(_inputs)', '-o', '<@(_outputs)' ]
},
],
}],
[ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
'actions': [
{
'action_name': 'node_dtrace_provider_o',
'inputs': [
'<(obj_dir)/node_base/src/node_dtrace.o',
],
'outputs': [
'<(obj_dir)/node_base/src/node_dtrace_provider.o'
],
'action': [
'dtrace',
'-G', '-xnolibs',
'-s', 'src/node_provider.d',
'<@(_inputs)',
'-o', '<@(_outputs)',
]
}
]
}],
[ 'node_use_dtrace=="true" and OS=="linux"', {
'actions': [
{
'action_name': 'node_dtrace_provider_o',
'inputs': [ 'src/node_provider.d' ],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_dtrace_header/node_dtrace_provider.o'
],
'action': [
'dtrace', '-C', '-G', '-s', '<@(_inputs)', '-o', '<@(_outputs)'
],
},
],
}],
[ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
'actions': [
{
'action_name': 'node_dtrace_ustack_constants',
'inputs': [
'<(v8_base)'
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_dtrace_header/v8constants.h'
],
'action': [
'tools/genv8constants.py',
'<@(_outputs)',
'<@(_inputs)'
]
},
{
'action_name': 'node_dtrace_ustack',
'inputs': [
'src/v8ustack.d',
'<(SHARED_INTERMEDIATE_DIR)/node_dtrace_header/v8constants.h'
],
'outputs': [
'<(obj_dir)/<(node_lib_target_name)/src/node_dtrace_ustack.o'
],
'conditions': [
[ 'target_arch=="ia32" or target_arch=="arm"', {
'action': [
'dtrace',
'-32',
'-I<(SHARED_INTERMEDIATE_DIR)/node_dtrace_header',
'-Isrc',
'-C', '-G',
'-s', 'src/v8ustack.d',
'-o', '<@(_outputs)',
],
}],
[ 'target_arch=="x64"', {
'action': [
'dtrace',
'-64',
'-I<(SHARED_INTERMEDIATE_DIR)/node_dtrace_header',
'-Isrc',
'-C', '-G',
'-s', 'src/v8ustack.d',
'-o', '<@(_outputs)',
],
}],
],
},
],
}],
[ 'node_use_dtrace=="true"', {
'actions': [
{
'action_name': 'specialize_node_d',
'inputs': [
'src/node.d'
],
'outputs': [
'<(PRODUCT_DIR)/node.d',
],
'action': [
'tools/specialize_node_d.py',
'<@(_outputs)',
'<@(_inputs)',
'<@(OS)',
'<@(target_arch)',
],
},
],
}],
]
}
Loading