Stop extra buffering when stdout isn't a tty

Right now if you're running a program with its output piped to some location and
the program decides to go awry, when you kill the program via some signal none
of the program's last 4K of output will get printed to the screen. In theory the
solution to this would be to register a signal handler as part of the runtime
which then flushes the output stream.

I believe that the current behavior is far enough from what's expected that we
shouldn't be providing this sort of "super buffering" by default when stdout
isn't attached to a tty.
Allow --cfg on rustpkg test

Closes #10238
Remove #[deriving]s on impls

They seem to have been added by accident.
auto merge of #10270 : alexcrichton/rust/no-super-buffer, r=brson

Right now if you're running a program with its output piped to some location and
the program decides to go awry, when you kill the program via some signal none
of the program's last 4K of output will get printed to the screen. In theory the
solution to this would be to register a signal handler as part of the runtime
which then flushes the output stream.

I believe that the current behavior is far enough from what's expected that we
shouldn't be providing this sort of "super buffering" by default when stdout
isn't attached to a tty.
auto merge of #10282 : sfackler/rust/rustpkg-test-cfg, r=alexcrichton

Closes #10238
auto merge of #10285 : sfackler/rust/weird-derivings, r=huonw

They seem to have been added by accident.
Move implementation for threads to Rust

This binds to the appropriate pthreads_* and Windows specific functions
and calls them from Rust. This allows for removal of the C++ support
code for threads.

Fixes #10162
auto merge of #10290 : dbussink/rust/thread_in_rust, r=alexcrichton

This binds to the appropriate pthreads_* and Windows specific functions
and calls them from Rust. This allows for removal of the C++ support
code for threads.

This needs to be reviewed for the Windows parts, I've tested on OS X and Linux.

Fixes #10162
Use loader_path instead of executable_path for osx

According to apple's documentation of rpath semantics, @executable_path means
that the path is relative the the *process executable*, not necessarily the
library in question. On the other hand, @loader_path is the path that points to
the library which contains the @loader_path reference. All of our rpath usage is
based off the library or executable, not just the executable. This means that on
OSX we should be using @loader_path instead of @executable_path to achieve the
same semantics as linux's $ORIGIN.
Add make check support(arm-linux-androideabi debuginfo)
auto merge of #10261 : ksh8281/rust/makecheck_debuginfo_arm-linux-androideabi, r=brson

In order to pass make check on android target

credit to @ksh8281
auto merge of #10299 : alexcrichton/rust/osx-loader-path-fix, r=brson

According to apple's documentation of rpath semantics, `@executable_path` means
that the path is relative the the *process executable*, not necessarily the
library in question. On the other hand, `@loader_path` is the path that points to
the library which contains the `@loader_path` reference. All of our rpath usage is
based off the library or executable, not just the executable. This means that on
OSX we should be using `@loader_path` instead of `@executable_path` to achieve the
same semantics as linux's $ORIGIN.

The purpose of this is to unblock the current snapshot from landing. It appears that because we were propagating linker arguments we never saw this before. Now that we're no longer printing linker arguments, we're depending on the libraries to resolve their own references. In using `@executable_path` on OSX, libraries in different locations than the executable were not able to resolve their references (because their rpaths listed were all relative to the location of the library, not the executable).

I'm still a little unclear on how this ever passed locally on my own machine, but it's clear why this is failing on the bots at least.