Index: libcxx/utils/libcxx/test/config.py =================================================================== --- libcxx/utils/libcxx/test/config.py +++ libcxx/utils/libcxx/test/config.py @@ -370,7 +370,9 @@ if self.target_info.is_windows() and self.link_shared: self.add_path(self.cxx.compile_env, self.cxx_library_root) if self.cxx_runtime_root: - if not self.target_info.is_windows(): + if self.target_info.is_zos(): + self.add_path(self.exec_env, self.cxx_runtime_root, is_libpath=True) + elif not self.target_info.is_windows(): self.cxx.link_flags += ['-Wl,-rpath,' + self.cxx_runtime_root] elif self.target_info.is_windows() and self.link_shared: @@ -384,7 +386,9 @@ if self.abi_library_root: self.cxx.link_flags += ['-L' + self.abi_library_root] if self.abi_runtime_root: - if not self.target_info.is_windows(): + if self.target_info.is_zos(): + self.add_path(self.exec_env, self.abi_runtime_root, is_libpath=True) + elif not self.target_info.is_windows(): self.cxx.link_flags += ['-Wl,-rpath,' + self.abi_runtime_root] else: self.add_path(self.exec_env, self.abi_runtime_root) @@ -481,5 +485,5 @@ def configure_env(self): self.config.environment = dict(os.environ) - def add_path(self, dest_env, new_path): - self.target_info.add_path(dest_env, new_path) + def add_path(self, dest_env, new_path, is_libpath=False): + self.target_info.add_path(dest_env, new_path, is_libpath) Index: libcxx/utils/libcxx/test/target_info.py =================================================================== --- libcxx/utils/libcxx/test/target_info.py +++ libcxx/utils/libcxx/test/target_info.py @@ -35,15 +35,16 @@ def add_cxx_link_flags(self, flags): pass def allow_cxxabi_link(self): return True - def add_path(self, dest_env, new_path): + def add_path(self, dest_env, new_path, is_libpath=False): + env_var = 'LIBPATH' if is_libpath else 'PATH' if not new_path: return - if 'PATH' not in dest_env: - dest_env['PATH'] = new_path + if env_var not in dest_env: + dest_env[env_var] = new_path else: split_char = ';' if self.is_windows() else ':' - dest_env['PATH'] = '%s%s%s' % (new_path, split_char, - dest_env['PATH']) + dest_env[env_var] = '%s%s%s' % (new_path, split_char, + dest_env[env_var]) class DarwinLocalTI(DefaultTargetInfo):