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

    <tr>
        <th>Summary</th>
        <td>
            Darwin: cross compiling with -mfpmath=sse generates error when builiding with an arm64 slice
        </td>
    </tr>

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

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

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

<pre>
    When cross-compiling a project (in this case graphite https://github.com/silnrsi/graphite) errors occur when trying to build as both -arch=arm64 -arch=x86_64 at one time.

The build uses ```-mfpmath=sse -msse2``` which are valid flags for the Intel compilation. Rather than simply being ignored by arm64 compilation phase, an error is generated:

```
error: unknown FP unit 'sse'
```

I believe this occurs because the arm compilation does not recognize the fpmath setting:

https://github.com/llvm/llvm-project/blob/7089c012ec08450b1d8050b6b1d85a00505aa51a/clang/lib/Basic/Targets.cpp#L802

To allow cross-compilation to proceed smoothly, would it not be best for that setting to be ignored, rather than generate an error?

Is there a better approach, other than separate builds and a post-build lipo phase?

Thanks to all.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlEGL6zYQxz-NchkSFNmO7YMP-7oEHvRQykKPZSxNbHVlyWjkTbefvshO8jalFArBiSPNaOb__2mQ2Q6eqBPVN1G97nBJY4jdO3m97PpgPrvfRvKgY2De6zDN1lk_AMIcwx-kEwjVWA9ptAwamWCIOI82EYwpzSyKF6HOQp0Hm8alP-gwCXVm63xkm_--7RaqBYoxRIag9RLhmk9N8TMflgL0i3UGkKEPaYQ9Rj2K4hXjdCofb382p99PJWCC4AmSnegg5KuQL9vzbaRbmoWJQZzk9tlPl3nClDMwE-wnZlKPVbiOVo-AkeADnTVwcTgwXEKENBJ894kcbLpgssEf4FdMI-VV9MB2mt0n9JTbsIMPkQz0n7AV_iUM5hGZhPoJ0G9CgGUYyFPERCbL-KWVR3Xb67pfFC-w-Hcfrh7Ov8Dibfam5py1_tew7fkdenKWPmjzcFWfoSeNC9PaI8bpqVQTiMGHBJF0GLz9a9u2qQhMKVk__KPi_4DBuY_71_4GlVDn3oVeqHMtm1bLoyItm7KS_dE0spL9Kf-oUMpKVojVEYU6a4d-yIlsDvyGbLVQ5zeMAyU-6HkWqvi5keqJiQDoXLg-8b11mUJGXBMZ4CmENLrPbM81LM6ATasAPUFPnG40YLo3vxJLd8NzWPwCxd3Vh9WiOD85wlnPSIDQU0oUAec5BtRjzhS-0EUzrolWrBnQm3wxA6f9Brqzc7iR9XzE24j-nXOZ6NxhZ7rCtEWLO-qOtTyVx6Ns2t3Y9VSZoi7kyfQXI4-mxbYusT4iVYUpm8vOdkqqUh5VIwtZlu2hvlxaI0_1pS3KCotGlJImtO6Q7T2EOOws80Jd3dZK7hz25HgdPUp5usK6KJTKkyh2KxL9MrAopbOc-EeWZJOj7hXj1fpM_uof_JhPV5vHxPPNvuvOtwu2jpgslDWPEPS3u8nOatot0XX_G921Cc7w5ib_DgAA__-1rcMM">