Check that rustc's output is writable before linking
If the final output file is not writable we end up failing with a cryptic linker error and a dump of the gcc command line. This could largely be avoided by doing some check before running the linker.
Maybe it's possible from the gcc error code to determine what the error was. That would potentially be less error prone than doing the check ahead of time.
Even if the final output file is not writable, the error message is working properly. When I make output file in /usr/bin, the error message is "Could not write output : error opening output file"
I am sure it's not still problem.
@sammykim is correct. Closing.