Major fixes after D54476 (use Diff1 as base for comparison to see only recent changes):
- In standalone builds target directory for debugserver must be LLDB's bin, not LLVM's bin
- Default identity for code signing must not force-override LLVM_CODESIGNING_IDENTITY globally
We have a lot of cases, make them explicit:
- ID used for code signing (debugserver and in tests):
- LLDB_CODESIGN_IDENTITY if set explicitly, or otherwise
- LLVM_CODESIGNING_IDENTITY if set explicitly, or otherwise
- lldb_codesign as the default
- On Darwin we have a debugserver target that:
- we build and sign if:
- LLDB_NO_DEBUGSERVER=OFF (default) && LLDB_USE_SYSTEM_DEBUGSERVER=OFF (default) && code signing ID == lldb_codesign
- we copy from the system if:
- LLDB_USE_SYSTEM_DEBUGSERVER=ON and found on system (explicit case)
- code signing ID != lldb_codesign and found on system (fallback case)
- will not be available if
- LLDB_NO_DEBUGSERVER=ON
- code signing ID != lldb_codesign and not found on system
- we build and sign if:
- On other systems, the debugserver target is not defined, which is equivalent to [3A]
Common configurations on Darwin:
- [1A] cmake -GNinja ../llvm builds debugserver from source and signs with lldb_codesign, no code signing for other binaries (prints status: lldb debugserver: /path/to/bin/debugserver)
- [1A] cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_CODESIGN_IDENTITY=lldb_codesign ../llvm builds debugserver from source and signs with lldb_codesign, ad-hoc code signing for other binaries (prints status: lldb debugserver: /path/to/bin/debugserver)
- [2A] cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_USE_SYSTEM_DEBUGSERVER=ON ../llvm copies debugserver from system, ad-hoc code signing for other binaries (prints status: Copy system debugserver from: /path/to/system/debugserver)
- [2B] cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- ../llvm same, but prints additional warning: Cannot code sign debugserver with identity '-'. Will fall back to system's debugserver.
- [3A] cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_NO_DEBUGSERVER=ON ../llvm debugserver not available (prints status: lldb debugserver will not be available)