[all-commits] [llvm/llvm-project] 84a0a3: [flang][driver] Make the -J option less restrictiv...

Paul Osmialowski via All-commits all-commits at lists.llvm.org
Fri Sep 27 08:01:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 84a0a3d3b30360b3cf1db3f1c27ff3175bf0aaf2
      https://github.com/llvm/llvm-project/commit/84a0a3d3b30360b3cf1db3f1c27ff3175bf0aaf2
  Author: Paul Osmialowski <pawel.osmialowski at arm.com>
  Date:   2024-09-27 (Fri, 27 Sep 2024)

  Changed paths:
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/test/Driver/use-module-error.f90

  Log Message:
  -----------
  [flang][driver] Make the -J option less restrictive so we would not have to struggle with autoconf (#110010)

There are autoconf-configured projects for which the generated Makefile
is invoking flang with more than one -J option, each one specifying the
same directory. Although only one module directory should be specified
(by either -J or -module-dir), it should not really matter how many
times this same directory has been specified.

Apparently, other compilers understand it that way, hence autoconf's
configure script may generate a Makefile with the repetitive -J's.

For example, when trying to build the ABINIT [1] project (which can be
configured by either CMake or the configure script) when configured by
autoconf, it fails to build as such:

```
make[3]: Entering directory 'src/98_main'
mpifort -DHAVE_CONFIG_H -I. -I../../../src/98_main -I../..  -I../../src/incs -I../../../src/incs -Ifallbacks/exports/include  -Jbuild/mods  -Jbuild/mods -c -o abinit-abinit.o `test -f 'abinit.F90' || echo '../../../src/98_main/'`abinit.F90
error: Only one '-module-dir/-J' option allowed
make[3]: *** [Makefile:3961: abinit-abinit.o] Error 1
```

This patch solves the problem.

[1] https://github.com/abinit/abinit.git



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list