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

    <tr>
        <th>Summary</th>
        <td>
            Command line option `-mno-strict-align` valid for C input but not valid for object input?
        </td>
    </tr>

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

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

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

<pre>
    No problem with this:
```
$ clang-19 --target=riscv64-linux-gnu -march=rv64gcv -mno-strict-align test.c
```

But if you compile it and then try to pass the object file it becomes a problem:
```
$ clang-19 --target=riscv64-linux-gnu -march=rv64gcv -mno-strict-align test.o
clang-19: error: unsupported option '-mno-strict-align' for target 'riscv64-linux-gnu'
```

The same thing happens with `--target=aarch64-linux-gnu`.

And some build tools seem to like mixing `CFLAGS` in on top of `LDFLAGS` to make this a serious impediment.

Curiously, for `-munaligned-access` RISC-V seems to have this problem the other way around, where it's only accepted with object files; while aarch64 has no problem with that switch in either case.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VE2P4zYM_TXyhXBgy44dH3zIZJCiwKKHbtG7LDOWuvowJCrZ_PtCnsw20yl6XMDw15Meyccnihj14hBHtn9h-9dCJFI-jFHVk_dUTH6-j795WIOfDFq4aVJASkfWHFn1yqoj66rH9fbJW5BGuKWsByhLEmFBYs1r0FFeu7Y02qXv5eISlFYEqTJ07dpFXqG0zpeRgpZUCqMXB4SRdvK_42z3l0SgL3D3CaS3qzYImkC4GUihAwp3IA-riDH_AD_9hZLg8lg3ofQWI4j38n5eUf6N-J2UNUfAEHzIL8nFtK4-EM7gV9LeAeP9JyLGe7j4AG_Z5CWf0mG8_x_x_lAIUVjM_XQLKLGu6OJbi1lXPdUpclEfiLtq90x1dDNEbxGmpM0M5L2JEBFtlt_obwhWf89BWFedzl-Ov3xlXQXagXdAfgV_yciX1x8QebDi25Za7k_EoH2KoO2Ks7bo6EP4U9pgc2f8tGmS07fJbTrhXAopMcbM-_uvX0_ln1tqMQdR4voI8u7wzSekMMBN3EEEn9ycaW8KQ3YN430E78wdMuuam7Qp9uStyJoXuKnssodyoEQE9-kYCYJ40yRVlgL1FlWKiLtiHpt5aAZR4Fj3Nd_z_aFpCjXOVc-xnQZ56OvuIKf50LQXxOFw4Bzrvin0yCveVm3V87rp62ZXi2kaGiEuh7ndSxxYW6EV2uyMudqdD0uhY0w4Hvqh3RdGTGjiNgw4d3iDDWSc59kQxrynnNISWVsZHSn-w0KaDI4nb20-fkY7_GHe3Ix_m7er4CqMnrd2nUC7NRFMicB5ekIeqm4wa85FCmZUROs2f_iZ8fOiSaVpJ71l_JyzeTzKNfi8l_HzVkNk_LzV-HcAAAD__zh7mT4">