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

    <tr>
        <th>Summary</th>
        <td>
            [clang] `-fembed-bitcode` is incompatible with some compilation flags and their negations
        </td>
    </tr>

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

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

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

<pre>
    Hello there,

The commit https://github.com/llvm/llvm-project/commit/51313bc6d97d32b39c20c2b5c913e9b023967835 authored by @compnerd in 2018 introduced errors when using `-fembed-bitcode` with a set of flags.

I can understand why we should prevent using some of these flags with the embedded bitcode but 
I don't understand why in some cases we prevent a flag and **its negation**:

For instance:

```
# Error 
$ clang -fembed-bitcode -ffunction-sections

# Error 
$ clang -fembed-bitcode -fno-function-sections

# Ok
$ clang -fembed-bitcode 
```

Shouldn't we relax the conditions on the `-fno-` flags?

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUk8uK3DoQhp9G3hTdyJKvCy98zhxzssoieQFdyrYSWWokeTrz9sFyzwQGMiTQILpwfX9d_hIxmsUhDqT-h9RPhdjT6sMQ_CaMS6vfRCyk1y_D_2ith7RiQML-JXQkdPy6Iii_bSbBmtItEj4SNhE2LSatu7wqvxE2Wfv8-lxuwX9DlQibzjzCprrkJZeq0X2rOZO8V4wqJmvVlxx7SRnvm7bjNZyloQb5AqSiym83h0GDccBo2YFxKXi9K9SAIfgQ4b6igz0atwBp6GXGTaK-SJOU10gaCneTVhAQMYGfYbZiideztU-ghIPdaQwxCafhvr7AHSGufrcabgGf0aUHPPoND0BaMeKJOdFpRcii-ij71AW5J8gK2jvC2vRexbgTqETEeGi-iomMhuM7wkbCRpMiOFxEMgfpiBwbyPVPPoBxB1ThW5A09PGjI2Ec_jvGBPlPBcoKt8C7IcFlnnenDoFLxPzGB-tP852_fID4_P3D9PdF0_FLXsA5uDtCQCt-5Dkr77TJdPAuR_LOnb8cm85LIXwidCz0wHXPe1HgULZV33Da1W2xDpSXkut6nptqrttON5w2jDfY867rZd0WZmCU1bQpS9rxqmyvXdW2VcW4FgxpKzWpKG7C2Oth9qsPS2Fi3HEoK940dWGFRBvzqTGWGyaMHVcXhnwdcl8iqag1McVfiGSSzfd5ZtRPvzGziWDccRUiGWnxdODpJL_djM02ebjz8FBa0YQ3_8RiD3b46zPO_UXCpkeLzwP7GQAA___7PGQY">