Commit 37785fcc authored by Zixian Cai's avatar Zixian Cai

Fix library path if executables are dynamically linked

parent 6e9d93a2
Pipeline #1118 failed with stage
in 2 minutes and 3 seconds
......@@ -186,10 +186,28 @@ index b1e1f73..b07816b 100644
libraries = ['c_file'],
library_dirs = [str(so.dirpath())]
diff --git a/rpython/translator/platform/__init__.py b/rpython/translator/platform/__init__.py
index 051668b..d44ed79 100644
index 051668b..8c158b3 100644
--- a/rpython/translator/platform/__init__.py
+++ b/rpython/translator/platform/__init__.py
@@ -212,7 +212,10 @@ class Platform(object):
@@ -92,9 +92,15 @@ class Platform(object):
if os.name == 'posix' and compilation_info is not None:
library_path = ':'.join([str(i) for i in compilation_info.library_dirs])
if sys.platform == 'darwin':
- env['DYLD_LIBRARY_PATH'] = library_path
+ if env.get('DYLD_LIBRARY_PATH'):
+ env['DYLD_LIBRARY_PATH'] += library_path + ":"
+ else:
+ env['DYLD_LIBRARY_PATH'] = library_path
else:
- env['LD_LIBRARY_PATH'] = library_path
+ if env.get('LD_LIBRARY_PATH'):
+ env['LD_LIBRARY_PATH'] += library_path + ":"
+ else:
+ env['LD_LIBRARY_PATH'] = library_path
returncode, stdout, stderr = _run_subprocess(str(executable), args,
env)
@@ -212,7 +218,10 @@ class Platform(object):
def _finish_linking(self, ofiles, eci, outputfilename, standalone):
if outputfilename is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment