diff options
| author | Andrew Haberlandt <ahaberlandt@apple.com> | 2026-01-12 16:44:41 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 00:44:41 +0000 |
| commit | 12ecbfb59b865ab98d1cecd78282e640420617c7 (patch) | |
| tree | 2509be33b6c22213c531a0498f8c3bd1aa8a8cfa | |
| parent | 998e0aed7b132a60a63176ba056df522c296a68a (diff) | |
| download | llvm-12ecbfb59b865ab98d1cecd78282e640420617c7.tar.gz llvm-12ecbfb59b865ab98d1cecd78282e640420617c7.tar.bz2 llvm-12ecbfb59b865ab98d1cecd78282e640420617c7.zip | |
[Darwin] [compiler-rt] Normalize DYLD_LIBRARY_PATH to workaround LD bug (#175685)
There is an issue in certain versions of LD which causes the wrong
libLTO to be used if the DYLD_LIBRARY_PATH is not normalized.
Will fix these failures:
```
AddressSanitizer-x86_64-darwin.TestCases/Darwin.odr-lto.cpp
AddressSanitizer-x86_64h-darwin.TestCases/Darwin.odr-lto.cpp
```
https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-cmake-RA-incremental/13428/
rdar://168024431
| -rw-r--r-- | compiler-rt/test/lit.common.cfg.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index d8e11051181d..407537e53fd8 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -90,6 +90,12 @@ def push_dynamic_library_lookup_path(config, new_path): new_ld_library_path = os.path.pathsep.join( (new_path, config.environment.get(dynamic_library_lookup_var, "")) ) + + if platform.system() == "Darwin": + # Workaround an issue in LD which does not use the correct libLTO + # if the DYLD_LIBRARY_PATH is not normalized. + new_ld_library_path = os.path.normpath(new_ld_library_path) + config.environment[dynamic_library_lookup_var] = new_ld_library_path if platform.system() == "FreeBSD": |
