Skip to content

Commit c661dad

Browse files
committed
build: fix cctest target --with-dtrace
Currently the cctest target will fail on linux when configured --with-dtrace: /node-v9.2.0/out/Release/obj.target/node/src/node_dtrace.o: In function `node::DTRACE_NET_SERVER_CONNECTION( v8::FunctionCallbackInfo<v8::Value> const&)': node_dtrace.cc:(.text+0x103): undefined reference to `node_net__server__connection_semaphore' /node-v9.2.0/out/Release/obj.target/node/src/node_dtrace.o: In function `node::DTRACE_NET_STREAM_END( v8::FunctionCallbackInfo<v8::Value> const&)': ... This is because node_dtrace_provider.o is not linked by the cctest target. This commit tries to fix and simplify the conditions in cctest target so that node_dtrace.o is included for all operating systems that support dtrace, include node_dtrace_ustack.o for all operating systems except mac and linux, and include node_dtrace_provider.o for all operating systems except mac. PR-URL: #17039 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 617e3e9 commit c661dad

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

node.gyp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,20 @@
885885
[ 'node_use_dtrace=="true"', {
886886
'libraries': [
887887
'<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace.<(OBJ_SUFFIX)',
888-
]
888+
],
889+
'conditions': [
890+
['OS!="mac" and OS!="linux"', {
891+
'libraries': [
892+
'<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_provider.<(OBJ_SUFFIX)',
893+
'<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_ustack.<(OBJ_SUFFIX)',
894+
]
895+
}],
896+
['OS=="linux"', {
897+
'libraries': [
898+
'<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o',
899+
]
900+
}],
901+
],
889902
}],
890903
[ 'OS=="win"', {
891904
'libraries': [
@@ -896,16 +909,6 @@
896909
'<(OBJ_PATH)<(OBJ_SEPARATOR)backtrace_posix.<(OBJ_SUFFIX)',
897910
],
898911
}],
899-
[ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
900-
'copies': [{
901-
'destination': '<(OBJ_DIR)/cctest/src',
902-
'files': [
903-
'<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_ustack.<(OBJ_SUFFIX)',
904-
'<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_provider.<(OBJ_SUFFIX)',
905-
'<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace.<(OBJ_SUFFIX)',
906-
]},
907-
],
908-
}],
909912
[ 'node_shared_zlib=="false"', {
910913
'dependencies': [
911914
'deps/zlib/zlib.gyp:zlib',

0 commit comments

Comments
 (0)