BuildBootImage: Add secondstage image support

The AOSP bootimage format allows the use of a second stage image
however the BuildBootableImage function does not allows the "second"
optional argument. This patch adds the support of this argument.

Change-Id: I8ed9d9e56449945c2d42fc908269921c394f68c0
Signed-off-by: Benoit Fradin <benoit.fradin@intel.com>
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Merge "BuildBootImage: Add secondstage image support"
Update host linux toolchain to gcc 4.8

This patch ensures the build system uses the prebuilt gcc-4.8 toolchain
when building host Linux binaries, instead of the gcc-4.6 one.

Change-Id: I7b449650714ba4314a780827e0243f2af40ec82c
Merge "Update host linux toolchain to gcc 4.8"
Move from dalvik.vm.image-dex2oat-flags to dalvik.vm.dex2oat-filter [build]

This will allow us to conditionally change the compiler-filter based on other properties.

Bug: 15165413
Change-Id: Ie3f9292d35e9d4abf93271b7d22b72d185ee5ce2
Merge "Move from dalvik.vm.image-dex2oat-flags to dalvik.vm.dex2oat-filter [build]"
Make system use patchoat to relocate during runtime.

Change DexPreOpt to include patch information of all compiled files so
we can relocate at runtime.

Bug: 15358152

Change-Id: Ibe92d8b55a24bbf718b0416a21b76e5df7a2de26
Merge "Make system use patchoat to relocate during runtime."
Track bouncycastle upgrade to 1.51

The new API in 1.51 will allow null return values.

Change-Id: I583690bf0740b2d0962f02edea3896e18626e548
Merge "Track bouncycastle upgrade to 1.51"
Merge "Fix uses of -fPIC and -fPIE."
Fix uses of -fPIC and -fPIE.

We've been using -fPIC and -fPIE together in the global cflags all this
time. These options are incompatible. The only reason we haven't been
hit by this before is because of the forced -Bsymbolic in GCC. To fix
this, pass -fpic when compiling objects for shared libraries and -fpie
when compiling objects for executables. For static libraries, also use
-fpic. We have to do this because static libraries might be included in
either a shared library or an executable. Code compiled with -fpie
cannot be included in a shared library, but code compiled with -fpic
may be included in an executable.

We've also been using -fpic and -fPIC together. These are different
options, and only the latter will take effect.
http://stackoverflow.com/a/967010

The final thing this fixes is that we had -f(PIC|PIE) flags being passed
to link commands. These are compile time flags, and don't do anything at
link time.

Bug: 16823325
Change-Id: Ic76f47e63dc2c81b7e1a8058bae1b3dc8565d606
Inhibit implicit -Bsymolic in -shared.

Bug: 16853291

Change-Id: Id70488b077256a70137c4417f21be2c2d1d4341c
Merge "Inhibit implicit -Bsymolic in -shared."
Fix Windows SDK build.

Change-Id: Ia2a318957aa525f0e72b556a693a20f513146b64
Merge "Fix Windows SDK build."
Consistent use of USE_MINGW

Change-Id: I05e212e5a99639d0196006b9c2ec35072c54f399
Merge "Consistent use of USE_MINGW"