toolchain: use pie/runpath by default

Bionic will reject non-PIC/PIE code now for all programs.  We need to
manually add the -fpie/-pie flags to the command line in our compiler
wrapper so we get PIE programs by default.  Ideally this would be in
the compiler itself, but the Android toolchain doesn't do that, and
upstream gcc support isn't available until gcc-6.

Bionic also only accepts DT_RUNPATH tags and ignores DT_RPATH tags,
so switch over to the newer tag format so ELFs can find their libs.

BUG=b:26861037
TEST=`python2.7 -c 'print("HI")'` works

Change-Id: I3d114119cd5c0920a152e9a7c136b1cf8c47a3d6
2 files changed