To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit d78ce170 authored by John Zhang's avatar John Zhang
Browse files

environment variable refactoring; add -fPIC on to flags

parent ffb49130
...@@ -106,10 +106,8 @@ class RPython(Language): ...@@ -106,10 +106,8 @@ class RPython(Language):
env = task.env env = task.env
if lc['backend'] == 'mu': if lc['backend'] == 'mu':
suplibdir = str(task.output_dir) suplibdir = str(task.output_dir)
if sys.platform == 'darwin': libpath_var = 'DYLD_LIBRARY_PATH' if sys.platform == 'darwin' else 'LD_LIBRARY_PATH'
env['DYLD_LIBRARY_PATH'] = suplibdir env[libpath_var] = "%s:%s" % (suplibdir, env[libpath_var])
else:
env['LD_LIBRARY_PATH'] = suplibdir
if lc['impl'] == 'holstein': if lc['impl'] == 'holstein':
mu_holstein_dir = Path(env['MU_HOLSTEIN']) mu_holstein_dir = Path(env['MU_HOLSTEIN'])
......
...@@ -69,11 +69,12 @@ class TaskSet: ...@@ -69,11 +69,12 @@ class TaskSet:
# compiled callback shared library # compiled callback shared library
if sys.platform == 'darwin': if sys.platform == 'darwin':
self.env['DYLD_LIBRARY_PATH'] = str(self.output_dir) libpath_var = 'DYLD_LIBRARY_PATH'
libext = '.dylib' libext = '.dylib'
else: else:
self.env['LD_LIBRARY_PATH'] = str(self.output_dir) libpath_var = 'LD_LIBRARY_PATH'
libext = '.so' libext = '.so'
self.env[libpath_var] = '%s:%s' % (self.output_dir, self.env.get(libpath_var, ""))
self.callback['dylib'] = self.output_dir / ('libcb_%(name)s' % self.callback + libext) self.callback['dylib'] = self.output_dir / ('libcb_%(name)s' % self.callback + libext)
@staticmethod @staticmethod
...@@ -212,7 +213,7 @@ class TaskSet: ...@@ -212,7 +213,7 @@ class TaskSet:
cc = self.env.get('CC', 'clang') cc = self.env.get('CC', 'clang')
cmd.append(cc) cmd.append(cc)
cmd.append('--shared') cmd.extend(['-shared', '-fPIC'])
# include_dirs # include_dirs
for d in self.callback['include_dirs']: for d in self.callback['include_dirs']:
......
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