From ceca1399bc730cef617a887df9e0850979be4358 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 18 Aug 2018 17:36:35 -0700 Subject: [PATCH 1/2] Load lldb symbols at runtime We can lazily load lldb symbols at runtime. This avoids needing to link lldb directly and therefore avoids portability problems resulting from rpath being specific to one system. --- binding.gyp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/binding.gyp b/binding.gyp index 3165af76..7732e796 100644 --- a/binding.gyp +++ b/binding.gyp @@ -25,33 +25,8 @@ # Necessary for node v4.x "xcode_settings": { "OTHER_CPLUSPLUSFLAGS" : [ "-std=c++11", "-stdlib=libc++" ], - "OTHER_LDFLAGS": [ "-stdlib=libc++" ], + "OTHER_LDFLAGS": [ "-stdlib=libc++","-Wl,-undefined,dynamic_lookup" ], }, - - "conditions": [ - [ "lldb_lib_dir == ''", { - "variables": { - "mac_shared_frameworks": "/Applications/Xcode.app/Contents/SharedFrameworks", - }, - "xcode_settings": { - "OTHER_LDFLAGS": [ - "-F<(mac_shared_frameworks)", - "-Wl,-rpath,<(mac_shared_frameworks)", - "-framework LLDB", - ], - }, - }, - # lldb_lib_dir != "" - { - "xcode_settings": { - "OTHER_LDFLAGS": [ - "-Wl,-rpath,<(lldb_lib_dir)", - "-L<(lldb_lib_dir)", - "-l<(lldb_lib)", - ], - }, - }], - ], }], [ "OS == 'win'", { "sources": [ From c08b3ac2404e1a090107ee5c83f500e3ede4bdda Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 3 Dec 2018 09:06:14 -0800 Subject: [PATCH 2/2] maintain direct LLDB linking for addon --- binding.gyp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/binding.gyp b/binding.gyp index 7732e796..b837d63b 100644 --- a/binding.gyp +++ b/binding.gyp @@ -89,6 +89,32 @@ "cflags!": [ "-fno-exceptions" ], "cflags_cc!": [ "-fno-exceptions" ], "conditions": [ + [ "OS == 'mac'", { + "conditions": [ + [ "lldb_lib_dir == ''", { + "variables": { + "mac_shared_frameworks": "/Applications/Xcode.app/Contents/SharedFrameworks", + }, + "xcode_settings": { + "OTHER_LDFLAGS": [ + "-F<(mac_shared_frameworks)", + "-Wl,-rpath,<(mac_shared_frameworks)", + "-framework LLDB", + ], + }, + }, + # lldb_lib_dir != "" + { + "xcode_settings": { + "OTHER_LDFLAGS": [ + "-Wl,-rpath,<(lldb_lib_dir)", + "-L<(lldb_lib_dir)", + "-l<(lldb_lib)", + ], + }, + }], + ] + }], [ "OS=='linux' or OS=='freebsd'", { "conditions": [ # If we could not locate the lib dir, then we will have to search