Force use of compatibility compilers on Apple's command line tools

The cc and c++ compilers included in Apple's command line tools show some
unusual behaviour which causes the build to fail in several projects under
Xcode 4.3

This patch uses the gnu compatibility gcc and g++ compilers on OS X instead
to reduce problems.

Change-Id: I506c22dad3dcbd41df3c7672802a675d3655e262
Signed-off-by: Al Sutton <al@funkyandroid.com>
Kernel makefiles that the stat on the system is GNU stat. GNU stat uses the "-c" option to specify format.
Darwin stat uses the "-f" option to specify format. This discrepency will cause kernel build breaks.
On my system, I symlink stat to GNU stat. This causes the "get-file-size" define
to fail.
The fix for this is to detect "gstat", aka GNU stat, and use that appropriately.

Change-Id: I987c155b7dc3ff14ffe6da40edf834ca34b7df75
add unpackbootimg to otatools

Change-Id: I4e294c05eacc8bef8273247bcf1bf382291a3d31
Fix up the get-file-size function that was broken due to the prior commit that made it utilize gnu stat (gstat)

Change-Id: I24bba2bfcb509ad1ad76d2260eedd685ba45c393
java: Add framework2 to the default list of linked java libraries

... and to the default built package list

Change-Id: I6d69d54784393124583429e0e55921769138f6f5
kernel.mk: Also search PRODUCT_COPY_FILES for the kernel copy, as that is how AOSP does it now.

Change-Id: Id2d1cf079694d1996d4a85d8435c2e4562e5d444
kernel.mk: fix compiled kernel copy

Change-Id: Ifb2a3d4968e56eed236eaa2db9258cd0b8865fda
kernel.mk: workaround to fix kernel builds on darwin until the prebuilts/gcc is checked in by upstream.

Change-Id: I6321fb7f6814b207c821d974766d945351b3f546
Support for more specific toolchain versions

This adds support for more specific versions of a given prebuilt
toolchain. In addition to $(HOST_PREBUILT_TAG) (like darwin-ppc or
linux-x86) a new $(HOST_PREBUILT_EXTRA_TAG) is introduced containing (so
far) the number of address bits (32/64) for the build host or the same
value as $(HOST_PREBUILT_TAG) if this could not be determined.

Subsequently everything in the building process that needs to determine
the full path for a prebuilt tool should check with
$(HOST_PREBUILT_EXTRA_TAG) first and then fall back to
$(HOST_PREBUILT_TAG).

The advantage for the user is that she can place a 64-bit or a 32-bit
version of, say, gcc and binutils next to the default prebuilts without
messing around with the directory structure, repo manifest and having a
working fallback to the default binaries.

Long story short: To make Jelly Bean build on 32-bit hosts again,
something like
 <project
  name="yath/android_prebuilts_gcc_linux-x86-32_arm_arm-linux-androideabi-4.6"
  path="prebuilts/gcc/linux-x86-32/arm/arm-linux-androideabi-4.6" />
can be added to local_manifest.xml. make will pick the 32-bit versions
of gcc and binutils instead of trying to run the new 64-bit ones.

Change-Id: I89ed0f00eda1a0bebbc35f39af4bbf0e97f6fade
Use less heap space for dex on 32-bit build hosts

Run dex with -JXmx1024M instead of 2048M if running on a 32-bit host.
Surprisingly this appears to also work for framework and services; if
not, a little fine-tuning will be needed.

This does not change anything for non-32-bit hosts.

Change-Id: I1d87c3e394acc934af6f7770ea54ba265a1df838
kernel: allow to specify a custom toolchain for kernel build

TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.4.3

Also removed workaround for darwin (I6321fb7f6814b207c821d974766d945351b3f546)
since the binaries got merged

Change-Id: I12f3587ce7c85ee6d3741f0619a376b13a936a90
arm: Allow disabling PIE for dynamically linked executables

PIE can and does break some binaries that were built without it,
resulting in relocation-related issues (addressing memory
wrongly assumed to be at a fixed position).

Use this as a last resort measure for compatibility with pre-JB
binary blobs, and only if confirmed to fix a broken executable.
If you're not sure, do NOT enable this on a device.

Change-Id: I3b7001e682a6f7a845e62278fe2afa9ccf5552a4
Make the recovery ramdisk target depend on $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) rather than $(INSTALLED_BOOTIMAGE_TARGET). This fixes the circular dependency for when the kernel depends on the recovery ramdisk, which depends on the boot image, which depends on the kernel.

Change-Id: I658bedc329f2ea0170ac0012f80ca7d779b1c242
build: fix target header overlay

LOCAL_C_INCLUDES as defined by the makefile should be put AFTER
the overlay includes so the overlay always takes precedence.

Change-Id: I489b2aab6dbacd9122d834f85e07b63ed1271f07
kernel.mk: Fix darwin regression caused by 732db8b1.

Change-Id: I1d9c2e231eca695ff6292ce5e163580cfd3fbb86
definitions.mk: Don't use GCC '@' parameter

This parameter (which causes GCC to pull additional command line
parameters out of a file) is incompatible with ccache.

- With ccache 2.x, ccache will ignore this parameters, and potentially
compute invalid command line hashes since it is not reading the
parameter file

- With ccache 3.x, ccache will refuse to cache the files and error
with 'Unsupported compiler option'.

We still use the parameter file, but Make expands it instead.

Change-Id: I070c3877cbe2d058e1cf4754bac535e7f3498861
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
kernel.mk: set KERNEL_OUT properly

It was hardcoded to $(ANDROID_BUILD_TOP)/$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
which wouldn't exist if OUT_DIR_COMMON_BASE was set to use another dir
(e.g. ramdisk)

Fix it so that it now points to $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
if OUT_DIR is not out

Change-Id: I1bf767d86548e41270d9cbb8f0c00512708501c5
Fix Issue 5810: Build: Uighur language

Initial commits for Uighur language
Credits: Abduqadir Abliz

Change-Id: I0850cf8823e627c0102015b361315b4a5640eae9
build: add support for uncompressed kernels
build: kernel: remove hard coded darwin toolchain.

* Use latest kernel toolchain from $(ARM_EABI_TOOLCHAIN) variable.

Change-Id: I3b43408937dd5f193fcba19c034f868272de8963