Passing arguments to LTOCodeGenerator

In LTOCodeGenerator.cpp there are some options related to optimization remarks.

On MacOS, I can pass in this option to enable them:


But on Linux using 2.29.1 binutils version of gold, I try this alternative:


But I get this error message:

LLVMgold: Unknown command line argument ‘–library=to-pass-remarks-output=remarks’. Try: 'LLVMgold -he\


LLVMgold: Did you mean ‘-no-warn=to-pass-remarks-output=remarks’?

If I try this


I get

LLVMgold: Unknown command line argument ‘lto-pass-remarks-output=remarks’. Try: ‘LLVMgold -help’

clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

Any suggestions are welcome,



I recently added support for opt remarks to the gold plugin, in r330252. The option names are:

(I used the same option names as used by lld, which unfortunately is different than the ones added to the old LTO API)