<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55901>55901</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            compiler-rt CMake configure with `-DLLVM_USE_SANITIZER=Address` fails on macOS
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ekilmer
      </td>
    </tr>
</table>

<pre>
    On macOS 12.4 with latest Xcode 13.4.1, when I try configuring with CMake like the following, I get errors on `main` branch with latest commit (`3fa5876216bf35f65bef5d9563f73578b0269bc9`) and also on LLVM 14 tag(s):

```
$ cmake -DCMAKE_BUILD_TYPE=Debug \
     -DLLVM_ENABLE_PROJECTS=compiler-rt \
     -DLLVM_USE_SANITIZER=Address \
     -S llvm -B build

-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
[...]
-- Checking DARWIN_macosx_SYSROOT - '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk'
-- Checking DARWIN_iphonesimulator_SYSROOT - '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk'
-- Checking DARWIN_iphoneos_SYSROOT - '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk'
-- Checking DARWIN_watchsimulator_SYSROOT - '/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator8.5.sdk'
-- Checking DARWIN_watchos_SYSROOT - '/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS8.5.sdk'
-- Checking DARWIN_appletvsimulator_SYSROOT - '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator15.4.sdk'
-- Checking DARWIN_appletvos_SYSROOT - '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS15.4.sdk'
-- Performing Test COMPILER_RT_HAS_APP_EXTENSION
-- Performing Test COMPILER_RT_HAS_APP_EXTENSION - Failed
-- Got ld supported ARCHES: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
-- Toolchain supported arches: armv6;armv7;armv7s;arm64;arm64e;arm64_32;i386;x86_64;x86_64h;armv6m;armv7k;armv7m;armv7em
-- Finding valid architectures for osx...
-- Disabling i386 slice for DARWIN_osx_ARCHS
-- OSX supported arches: arm64;arm64e;x86_64;x86_64h
-- Finding valid architectures for iossim...
-- ios Simulator supported arches: arm64;arm64e;i386;x86_64
-- Finding valid architectures for ios...
-- ios supported arches: armv7;armv7s;arm64;arm64e;armv7k
-- Compiler-RT supported architectures: arm64;arm64e;x86_64;x86_64h;i386;armv7;armv7s;armv7k
CMake Error at /Users/ekilmer/src/llvm-project/compiler-rt/CMakeLists.txt:431 (message):
  -g is not supported by host compiler


-- Configuring incomplete, errors occurred!
See also "/Users/ekilmer/src/llvm-project/build/CMakeFiles/CMakeOutput.log".
See also "/Users/ekilmer/src/llvm-project/build/CMakeFiles/CMakeError.log".
```

Looking at `build/CMakeFiles/CMakeError.log`, I see the following error along with other similar errors for other ios targets:
```
Testing compiler for supporting ios-armv7em:
Change Dir: /Users/ekilmer/src/llvm-project/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_b206c/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_b206c.dir/build.make CMakeFiles/cmTC_b206c.dir/build
Building C object CMakeFiles/cmTC_b206c.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc   -fPIC -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wstring-conversion -Wmisleading-indentation -fno-omit-frame-pointer -O1 -fsanitize=address -fsanitize-address-use-after-scope  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk   -v -arch armv7em -stdlib=libc++ -miphoneos-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk -MD -MT CMakeFiles/cmTC_b206c.dir/src.c.o -MF CMakeFiles/cmTC_b206c.dir/src.c.o.d -o CMakeFiles/cmTC_b206c.dir/src.c.o -c /Users/ekilmer/src/llvm-project/build/CMakeFiles/src.c
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: armv7em-apple-unknown-macho
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: error: unsupported option '-fsanitize=address' for target 'armv7em-apple-unknown-macho'
make[1]: *** [CMakeFiles/cmTC_b206c.dir/src.c.o] Error 1
make: *** [cmTC_b206c/fast] Error 2
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9WV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