[libc++] Do not set the runtime library path with DYLD_LIBRARY_PATH
authorLouis Dionne <ldionne@apple.com>
Fri, 15 May 2020 17:54:23 +0000 (13:54 -0400)
committerLouis Dionne <ldionne@apple.com>
Fri, 15 May 2020 18:09:40 +0000 (14:09 -0400)
We already set it using -rpath when linking test executables, and using
DYLD_LIBRARY_PATH causes problems when running other commands that
shouldn't run against the just-built libc++ (e.g. `ls` in a ShTest).

rdar://63241847

libcxx/utils/libcxx/test/config.py
libcxx/utils/libcxx/test/target_info.py

index 6456620..a20206c 100644 (file)
@@ -883,7 +883,6 @@ class Configuration(object):
             self.cxx.compile_flags += ['-D_LIBCPP_DISABLE_AVAILABILITY']
 
     def configure_env(self):
-        self.target_info.configure_env(self.exec_env)
         self.config.environment = dict(os.environ)
 
     def add_path(self, dest_env, new_path):
index 503954d..9b6697b 100644 (file)
@@ -37,7 +37,6 @@ class DefaultTargetInfo(object):
 
     def add_cxx_compile_flags(self, flags): pass
     def add_cxx_link_flags(self, flags): pass
-    def configure_env(self, env): pass
     def allow_cxxabi_link(self): return True
     def use_lit_shell_default(self): return False
 
@@ -157,18 +156,6 @@ class DarwinLocalTI(DefaultTargetInfo):
     def add_cxx_link_flags(self, flags):
         flags += ['-lSystem']
 
-    def configure_env(self, env):
-        library_paths = []
-        # Configure the library path for libc++
-        if self.full_config.cxx_runtime_root:
-            library_paths += [self.full_config.cxx_runtime_root]
-
-        # Configure the abi library path
-        if self.full_config.abi_library_root:
-            library_paths += [self.full_config.abi_library_root]
-        if library_paths:
-            env['DYLD_LIBRARY_PATH'] = ':'.join(library_paths)
-
     def allow_cxxabi_link(self):
         # Don't link libc++abi explicitly on OS X because the symbols
         # should be available in libc++ directly.