--errors=filename linker option
Redirects the diagnostics from the standard error stream to a specified file.
The specified file is created at the start of the link stage. If a file of the same name already exists, it is overwritten.
If filename is specified without path information, the file is created in the current directory.