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

    <tr>
        <th>Summary</th>
        <td>
            small mistake in -fmodule-file description breaks clang++-19 frontend with -fstack-protector
        </td>
    </tr>

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

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

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

<pre>
    I was experimenting CXX Modules with Clang 19 on Ubuntu, and it suddently broke when I passed wrong parameters on -fmodule-file, but strangely this only occurred when -fstack-protector was enabled... I have no idea why.
This is the clang version:
```
$ clang++-19 --version
Ubuntu clang version 19.1.1 (1ubuntu1~24.04.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
```

The files are:
```
// main.cc
import hello;
import std;

int main() {
  do_hello("world");
 return 0;
}
```

```
// hello.cppm
export module hello;
import std;

export inline void do_hello(std::string_view const &name)
{
 std::cout << "Hello " << name << "!\n";
}
```

First I compile both .pcm files:
```
clang++-19 -std=c++23 -stdlib=libc++ -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++23' -fPIC -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile -o std.pcm /usr/lib/llvm-19/share/libc++/v1/std.cppm
clang++-19 -std=c++23 -stdlib=libc++ -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++23' -fPIC -fmodule-file=std=std.pcm -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile -o hello.pcm hello.cppm std.pcm

clang++-19 -std=c++23 -stdlib=libc++ -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++23' -fPIC -fmodule-file=std=std.pcm -fmodule-file=hello=hello.pcm  -o hello_world std.pcm hello.pcm main.cc

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsVs1u4zYQfhr6MqAgUfKPDjo4do36UGyx3SDbk0GJI4kNRQokZceXPntByY6zToJeeusCQSDPz8eZ-WaG5M7JRiMWZP5A5tsZH3xrbCEbY7vKoGrNrDTiXOzhxB3gS49Wdqi91A1svn-H34wYFDo4Sd_CRnHdQJKD0fBYDtoPhG2AawHSgxuEQO3VGUprnhFOLWrYQ8-dQwEna3QDPbe8Q4_WBQhadyM6raXCgFQOHpy3XDeozuBbGczUGUxVDdYGlIBJa-d59Ux7azxW3tgpdM1LhSKKIthDy48I2oAUyOHUniMSr78FOOnAtwjVmMgRrZNGk3RN4jVZxJe_eE1YNpkQ9kDYA01yoPRqHa-n1H8EgSSPkigBwlbJMOqTv1kWxVnECMvD8dw26Em6hpfV4rDIaF9RJfXwQhs9jOFZ5AI6I1AFq944-ULi9V47z5VCsZU2yAnbDc4StlOyDP_VsaNJTtiulPo-jYCKEKrrgFv8KNEdYTvouNRRVZF4LbveWA8tKmVI-nCTOC-m30Gk_ehC2IqwHMgyyAGEOUx-QcxOxipB2Jj96AgW_WA1xBec5fZ9uB_ENkJGVd93JF7jyxjM1Db_EuXFVmolNcLRSPE2wtFyTdK181bq5nCUeILKaOeBsIXmHU60XZJ7Na_M4IGkG5JugDD2a4ALH1dZ8HyjJywh840OX59nvZPWedhDZbpeKoTS-Baivuom6t7Tdt-bY3TbapKwdBSE9ki3SpYXMdDHw-7L12_73Z-HP748ft388sEg0SeuFNAnPzYjdbxGfwb65FDVdFolQJ8GPTgUtBw8dejp61ADfdKG1haRaqNb5D015V9YeaB1ZZSxVEjeaOO8rBzQWhtqOulpHfxpb6QOIIQt7xMibAm0_n2_mU6w6NAe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