[llvm-bugs] [Bug 51339] New: Regression: clang-13 fatally fails when Fortran flags like -ffree-form are present

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 4 04:44:32 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51339

            Bug ID: 51339
           Summary: Regression: clang-13 fatally fails when Fortran flags
                    like -ffree-form are present
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: protze at itc.rwth-aachen.de
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

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 https://reviews.llvm.org/D99353

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210804/57a9f931/attachment.html>


More information about the llvm-bugs mailing list