From b1c1650cc383ab29fb5523b84630d24d1a12dbcd Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 15 Nov 2017 10:48:01 +0100 Subject: [PATCH 1/2] 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 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 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. --- node.gyp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/node.gyp b/node.gyp index 63ace809396bd2..9849bd2ea3390d 100644 --- a/node.gyp +++ b/node.gyp @@ -872,7 +872,19 @@ [ 'node_use_dtrace=="true"', { 'libraries': [ '<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace.<(OBJ_SUFFIX)', - ] + ], + 'conditions': [ + ['OS!="mac" and OS!="linux"', { + 'libraries': [ + '<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_ustack.<(OBJ_SUFFIX)', + ] + }], + ['OS!="mac"', { + 'libraries': [ + '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o', + ] + }], + ], }], [ 'OS=="win"', { 'libraries': [ @@ -883,16 +895,6 @@ '<(OBJ_PATH)<(OBJ_SEPARATOR)backtrace_posix.<(OBJ_SUFFIX)', ], }], - [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', { - 'copies': [{ - 'destination': '<(OBJ_DIR)/cctest/src', - 'files': [ - '<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_ustack.<(OBJ_SUFFIX)', - '<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_provider.<(OBJ_SUFFIX)', - '<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace.<(OBJ_SUFFIX)', - ]}, - ], - }], [ 'node_shared_zlib=="false"', { 'dependencies': [ 'deps/zlib/zlib.gyp:zlib', From 5ad71940232a14f16f0360686e19fe6cadb8d604 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 15 Nov 2017 12:32:24 +0100 Subject: [PATCH 2/2] squash: add node_dtrace_provider condition linux The path to node_dtrace_provider.o is different or different operating systems. This commit attempt to fix this for Linux. --- node.gyp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node.gyp b/node.gyp index 9849bd2ea3390d..35404ef3ae54c2 100644 --- a/node.gyp +++ b/node.gyp @@ -876,10 +876,11 @@ 'conditions': [ ['OS!="mac" and OS!="linux"', { 'libraries': [ + '<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_provider.<(OBJ_SUFFIX)', '<(OBJ_PATH)<(OBJ_SEPARATOR)node_dtrace_ustack.<(OBJ_SUFFIX)', ] }], - ['OS!="mac"', { + ['OS=="linux"', { 'libraries': [ '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o', ]