[compiler-rt] [compiler-rt] Don't explicitly ad-hoc code sign dylibs if using Apple's new linker (PR #88323)

Chris Apple via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 16:13:44 PDT 2024


cjappl wrote:

Just a heads up @bdash , this causes a bug on my system where I can't run `check-asan` (or any of the other sanitizer checks), because it complains about the dylibs being unsigned.

Reverting the change in this PR fixes the issue.


Showing the bug:
```
> ninja check-asan
[1/2] Running the AddressSanitizer tests
...
dyld[50801]: Library not loaded: @rpath/libclang_rt.asan_osx_dynamic.dylib
  Referenced from: <10CB825E-7352-3AE1-9B7C-95BE6D9891A1> /Users/topher/code/radsan_cjappl/build/projects/compiler-rt/lib/asan/tests/ARM64DarwinConfig/Asan-arm64-inline-Test
  Reason: tried: '/Users/topher/code/radsan_cjappl/build/./lib/../lib/clang/19/lib/darwin/libclang_rt.asan_osx_dynamic.dylib' (code signature in <683ECD6C-FC26-3C6D-89D4-ADA8558EDFB
0> '/Users/topher/code/radsan_cjappl/build/lib/clang/19/lib/darwin/libclang_rt.asan_osx_dynamic.dylib' not valid for use in process: Trying to load an unsigned library), '/System/Vo
lumes/Preboot/Cryptexes/OS/Users/topher/code/radsan_cjappl/build/./lib/../lib/clang/19/lib/darwin/libclang_rt.asan_osx_dynamic.dylib' (no such file), '/Users/topher/code/radsan_cjap
pl/build/projects/compiler-rt/lib/asan/tests/ARM64DarwinConfig/libclang_rt.asan_osx_dynamic.dylib' (no such file), '/Users/topher/code/radsan_cjappl/build/./lib/../lib/clang/19/lib/
darwin/libclang_rt.asan_osx_dynamic.dylib' (code signature in <683ECD6C-FC26-3C6D-89D4-ADA8558EDFB0> '/Users/topher/code/radsan_cjappl/build/lib/clang/19/lib/darwin/libclang_rt.asan
_osx_dynamic.dylib' not valid for use in process: Trying to load an unsigned library), '/System/Volumes/Preboot/Cryptexes/OS/Users/topher/code/radsan_cjappl/build/./lib/../lib/clang
/19/lib/darwin/libclang_rt.asan_osx_dynamic.dylib' (no such file), '/Users/topher/code/radsan_cjappl/build/projects/compiler-rt/lib/asan/tests/ARM64DarwinConfig/libclang_rt.asan_osx
_dynamic.dylib' (no such file)
```

Replicating the important line:
```
'/Users/topher/code/radsan_cjappl/build/lib/clang/19/lib/darwin/libclang_rt.asan
_osx_dynamic.dylib' not valid for use in process: Trying to load an unsigned library)
```

This file exists, but is unsigned.


Let me know what diagnostic information I can get for you, happy to help track it down :) 

Some things to possibly help get things started, logging from cmake:

```
-- CMAKE_LINKER=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
-- LD_V_OUTPUT=@(#)PROGRAM:ld PROJECT:ld-1053.12
```

Other info:
```
> clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```

Let me know what else you need.

https://github.com/llvm/llvm-project/pull/88323


More information about the llvm-commits mailing list