Set external linkage on Rust functions defined with foreign ABIs.
Make all functions, not just foreign ABI ones, link with external linkage if they are publically visible.
Link statics with external linkage if they are publically visible
Rename tests for external linkage and add a compile-fail test to ensure things that shouldn't have external linkage don't get it
auto merge of #9945 : pcmattman/rust/master, r=thestinger

This fixes an issue where `extern "C"` functions would have internal linkage, making them invisible to anything that might be linked against the resulting object. In my use case, a Rust function is being called from assembly, and because the Rust symbol did not have the right linkage, I ran into linker errors.

I'm not sure where to put tests for this particular change as there don't seem to be any as it stands for `extern "C"` functions. A `make check` passes, so this does not seem to have broken anything that is already covered. Also, a test would need to inspect the symbol linkage in the binary output (or bitcode?) in order to figure out if this is working as expected. I'm not sure how best to do that in a portable way.