Skip to content

flang-new driver error "only one action is allowed" doesn't tell you what those actions are #79458

@DavidSpickett

Description

@DavidSpickett
$ flang-new -o /tmp/testir.ll /tmp/test.f90 -Xflang -emit-llvm -S
error: Only one action option is allowed

I think this happens because flang-new decides to emit an object, then the argument to fc1 adds an action to emit llvm as well. With clang this results in emitting llvm IR but flang is stricter.

Which is fine, but it would be nice to know what actions have been added or are going to be added, so we can work backwards to find the command line option that causes it. Roughly:

$ flang-new -o /tmp/testir.ll /tmp/test.f90 -Xflang -emit-llvm -S
error: Only one action option is allowed. Have "-emit-obj", tried to add "-emit-llvm".

And for the record, the way we should be using this option is:

$ flang-new -o /tmp/testir.ll /tmp/test.f90 -emit-llvm -S

Which is equivalent.

(Compiler Explorer is using the -Xclang -emit-llvm style, that's how I found ended up finding this)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions