summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorgenotrance <dev@genotrance.com>2020-07-21 12:14:36 -0500
committerGitHub <noreply@github.com>2020-07-21 19:14:36 +0200
commit450a3e3179096c09cb473956386940a212f9a1d2 (patch)
tree632859f459886628c126053d82d74be8a00aefc5 /lib/system
parent64d629c617b5bbc700349afbc16607e2ed9f8eeb (diff)
downloadNim-450a3e3179096c09cb473956386940a212f9a1d2.tar.gz
Fix #2408 - add -d:globalSymbols (#14904)
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/dyncalls.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim
index fe4797c5f..a15d9267f 100644
--- a/lib/system/dyncalls.nim
+++ b/lib/system/dyncalls.nim
@@ -91,7 +91,10 @@ when defined(posix):
     dlclose(lib)
 
   proc nimLoadLibrary(path: string): LibHandle =
-    result = dlopen(path, RTLD_NOW)
+    let flags =
+      when defined(globalSymbols): RTLD_NOW or RTLD_GLOBAL
+      else: RTLD_NOW
+    result = dlopen(path, flags)
     when defined(nimDebugDlOpen):
       let error = dlerror()
       if error != nil: