toolchain: add wrapper logic

The way android builds things is via relative paths everywhere and with
the working directory of the top level checkout.  When we go to build
external packages though, they often need to be in a different working
directory which means all of the relative paths break.

Add a compiler wrapper to merge the existing android env vars and the
relative paths to create absolute paths we can leverage.

Further, android will pass flags to the system paths during compile and
link.  If those aren't used, then the build/link will fail in weird ways.
Unfortunately, some build systems might filter/sort flags, so add those
to the wrapper too rather than try and track down/fix every build system.

TEST=built packages and they worked in qemu

Change-Id: I93432c7ed23941cd44d799e7a8bdb83d745d1952
2 files changed
tree: 201228ebb47f0a9c65b3d87876c0757238872db9
  1. portage/
  2. toolchain/