1

Replace the default Apple-LLVM with the LLVM 5.0 downloaded from llvm.org. and compiling, xcode thrown an error:

clang-5.0: error: cannot specify -o when generating multiple output files

Xcode8 is OK.

Thanks.

1 Answers1

2

This is not a Clang 5.0-only issue. I am having the same issue with a custom Clang 3.9. Xcode 9 has introduced a custom argument that a normal Clang does not support:

The -index-store-path argument does not exist in Clang 5.0 and it gets discarded without any error message. The problem is that its argument, a folder, is not discarded, and Clang considers it as a source file. This leads to the following errors:

  • cannot specify -o when generating multiple output files (this happens if a -o argument is passed)
  • error reading '<PATH>' (this can be observed when running the "normalized" version of the clang command, generated via the -### flag)

Source: Facebook/infer: Remove unsupported index-store-path argument from clang commands.


In my custom toolchain based on Clang/CMake/Xcode I use a wrapper around clang in which I just cut off this argument and the folder passed to it and everything works fine.

Community
  • 1
  • 1
Stanislav Pankevich
  • 11,044
  • 8
  • 69
  • 129