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

    <tr>
        <th>Summary</th>
        <td>
            Error: unsupported option '-fsanitize=safe-stack' in macOS
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          shaopeng-gh
      </td>
    </tr>
</table>

<pre>
    Hello!
per the document:
https://releases.llvm.org/12.0.0/tools/clang/docs/SafeStack.html
[Supported Platforms](https://releases.llvm.org/12.0.0/tools/clang/docs/SafeStack.html#supported-platforms)
SafeStack was tested on Linux, NetBSD, FreeBSD and macOS.

We are able to generate in Linux but in mac machine with a Intel CPU, the same command will generate error:
`clang: error: unsupported option '-fsanitize=safe-stack' for target 'x86_64-apple-darwin19.6.0'`
We also tried on another mac machine witch is Apple M1 CPU, the error is:
`clang: error: unsupported option '-fsanitize=safe-stack' for target 'aarch64-apple-darwin20.6.0'`

The command we have is a simple compile of one hello world c file:
`clang -Wall helloc.c -O2 -g -gdwarf-5 -o clang.macho.c.safe_stack -fsanitize=safe-stack`

I dig around the documentation have no luck finding how to resolve this error. 

more info about the machine:

```
$ sw_vers 
ProductName:      Mac OS X
ProductVersion:   10.15.7
BuildVersion:     19H1922
 
$ clang --version
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

```




</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VV1v2zYU_TXSy4UEibJs6UEPSdyhBdYmgNO1bwFNXVncKFEgKTvbr9-lJNtJuhbbsAH6IHnIw3vIw8u9rn-v3qNSOmBpkGyD5GZAA65FqLUYO-xdkN3MQOvcYH2N_USPQYXcoo2VOnaxNgdqS1mcxAkVnN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