<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/117010>117010</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] -mcpu=help does not work with flang
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mathomp4
</td>
</tr>
</table>
<pre>
Just an odd thing, but on both my Homebrew flang-new (version 19.1.3 on macOS) and on a built-from-git flang on Linux (flang version 20.0.0git (git@github.com:GEOS-ESM/build-llvm-flang.git 697744d14fec6505d07f95249388ac2452ee5151)), if you run `flang -help` you'll see:
```
-mcpu=<value> For a list of available CPUs for the target use '-mcpu=help'
```
However, this does not seem to work on either. On flang 19:
```
❯ flang-new -mcpu=help
ld: library 'c++' not found
flang-new: error: linker command failed with exit code 1 (use -v to see invocation)
```
and on flang 20:
```
> flang -mcpu=help
flang-20: error: no input files
```
So, just in case it needs a file, flang 19:
```
❯ flang-new -c -mcpu=help test.F90
flang-new: error: unsupported argument 'help' to option '-mcpu='
```
and flang 20:
```
> flang -c -mcpu=help test.F90
flang-20: error: unsupported option '-mcpu=' for target 'x86_64-unknown-linux-gnu'
```
Note that `clang -mcpu=help` works on both:
```
❯ clang -mcpu=help |& head
Homebrew clang version 19.1.3
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Users/mathomp4/.homebrew/brew/Cellar/llvm/19.1.3/bin
Configuration file: /Users/mathomp4/.homebrew/brew/etc/clang/arm64-apple-darwin23.cfg
Available CPUs for this target:
a64fx
ampere1
ampere1a
```
and:
```
> clang -mcpu=help |& head
clang version 20.0.0git (git@github.com:GEOS-ESM/build-llvm-flang.git 697744d14fec6505d07f95249388ac2452ee5151)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /ford1/share/gmao_SIteam/llvm-flang/2024-10-22/bin
Available CPUs for this target:
alderlake
amdfam10
arrowlake
arrowlake-s
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVl1znDoS_TWaly4oIRg-HubBGZtNtnY3W-XkOSVQA4qFRElixv73twQ4Yzu2b5KXO0UxJdRqne5zuiXunOw14oHsP5D99Y7PfjD2MHI_mHHKdo0RD4d_z84D12CEAD9I3RN2hGb2YDQ0xg8wPsBHM2Jj8Qyd4rqPNJ6BsPKE1kmjIaniJE6D_cjbz7eEVcC1CGMOzSyVjzprxqiXfl0fZv4j9XwfnKxfHl0xGtOYBkvCyl56koXBMDdxa0aSXv3r5vNtdHP7X8Lq4FlESp3GaPERh1V5VRRZJpKswzbf072gRVftWValZclblu0Z4j7ZJ4RVy3ME2cGDmcHOGkhOVzTRgGoiOQ0zhBVKgUMk6RWh14RekZxuzzIEiMZ2mkl6TdLjiasZSXoDl19tLHBQ0nkwHfATl4o3CuH4_68OOmPBDwie2x49zA6BsOLR4QKDFa9uu74_mjOe0IZA_CAdCIMOtPEB8AjewNnYu5BvlH5AG8NnvXGQVG8FRG4Yqa7JVf2E7WeIFislSHoFSjaW24cAuiXsw_IUC4DOzFqspj_chBVorbHrUn2HFlozjkEtHZcKBZylHwDvpYfWCIQk6CBkJTqFaBwiSH0yLffS6MDgawFs4lvjZPTNONObzebn6FbIy9oLYm1A6mn20EmF7h1Wbk0g5HsoLKmh5Q5BetCIwgFfVof5P-KhfQYWPDof1xV9L9GzdvM0GetRALf9PKIO5VVs6gp5NVPI51PpvSW7hapfT-wvwH2R5KdoX4W11sxaL4QV92X-Lc-iWd9pc9aRCn0l6vX8ft38z3gEP3Afir79WQQ5XSrHPTbBv-foZydAiiNhOQzIxWO1bm20fdb01v65mnxZAguJ4HbMs4hPk8JIcHuWmqVxHm8bfxkscgGjEaiC9WScvF-nPmnnuVIoruWSUcLqrw6tI6x-7PyE1fGwgQmtdP07olLcElaHpkpYveFidSP16vpodCf72S7ltwr5dzZA3xJWL8ETVr8aYNv161ZXrzVK6TbmL3xs74rnWXd_GY0TWk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