<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Regression: clang-13 fatally fails when Fortran flags like -ffree-form are present"
   href="https://bugs.llvm.org/show_bug.cgi?id=51339">51339</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Regression: clang-13 fatally fails when Fortran flags like -ffree-form are present
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>protze@itc.rwth-aachen.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>clang-12 accepted and ignored Fortran flags like -ffree-form. clang-13 and
trunk fatally fail, when Fortran flags are applied.


The use case, where I see the current behavior as an issue is linking multiple
object files compiled from different languages.
Many build systems will pass CFLAGS as well as FFLAGS to the linker command in
such case. To automatically link the necessary language-specific runtime
libraries, I see using the compiler driver for linking as common practice:

  $(FC) -c fortran-code.F90 $(FFLAGS)
  $(CXX) -c cpp-code.cpp $(CFLAGS)
  $(CC) -c c-code.c $(CFLAGS)
  $(CXX) fortran-code.o cpp-code.o c-code.o $(FFLAGS) $(CFLAGS)
-l$(FORTRAN_RUNTIME)

To support such workflow, the compiler should not error out, at least when only
used for linking.

This works with `CC=gcc`, `CXX=g++`, `FC=gfortran`, and
`FORTRAN_RUNTIME=gfortran`.
This used to work with `CC=clang-12`, `CXX=clang-12++`, `FC=gfortran`, and
`FORTRAN_RUNTIME=gfortran`.

A possible fix is available in <a href="https://reviews.llvm.org/D99353">https://reviews.llvm.org/D99353</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>