History log of /ndk/build/tools/builder-funcs.sh
Revision Date Author Comments
7afe8fe61d7fbae272098d9261ea1efae7efd09c 14-Jun-2014 Albert J. Wong <ajwong@google.com> Clean up division between cflags and cxxflags.

This allows passing of std=c99 to only the build lines for .c files.

Change-Id: Iae9abc1320834a9a6d30ba46344ecfe6a38170db
8ded63c1b76fa7707d67eb3b6dd1d80b617df2ff 14-Jun-2014 Albert J. Wong <ajwong@google.com> Use nostdlib instead of nodefaultlib when building the C++ runtime.

Efectively reverts the following:
d48f2fe Replace -nostdlib with -nodefaultlibs when crtbegin/end...
49458ec Fix cxx-stl builds
67657b8 Fix shared library generation flags.

nodefaultlib would be preferable to nostdlib because the compiler
frontend will automatically handle selection of the correct
crtbegin/end objects. Unfortunately, clang and gcc current hardcode
Bsymbolic into the link line which causes ODR violations for
operator new/delete and typeinfo objects for standard classes
such as exceptions.

Change-Id: I07a4cf586b238540190c23e44e34161905bf5ba8
6fc4d79d3df6a1463cb5737c8079dd827c256e84 14-Jun-2014 Albert J. Wong <ajwong@google.com> Ensure libcompiler_rt is used for libc++abi.

Also rename the variables to be a little more precide.
libc++abi/gabi/libsuc++ are C++ runtime support libraries.
libc++/libstdc++/stlport is the c++ runtime.

Change-Id: Ib0b50976c4d7a9b6c968130c475a4e6f9bda95bc
34b3f0c1a953da194ca398dd3a4e2ed51febac67 06-Jun-2014 Andrew Hsieh <andrewhsieh@google.com> misc fixes

Change-Id: I2d8d27609f1113d31590b1fb8bea68056b086769
87e5a8725afdc616668dc156d323acea1ff85135 04-Jun-2014 Andrew Hsieh <andrewhsieh@google.com> Support mips64el multilib sysroot

mils64el-* toolchain has multib options, and their os-directory
-mabi=64 : lib64 (defualt)
-mabi=32 : lib (the original mips ABI)
-mabi=n32 : lib32 (the new 32-bit ABI, compatible with 64

We need this to build libatomic and libgomp, etc. Both are also
enabled in this CL

Change-Id: Ib11716493bd34aa3cb40ac51657b6efa6dfc941c
67657b80ab36bd624687ce1bb4980b4659ed5811 26-May-2014 David 'Digit' Turner <digit@google.com> Fix shared library generation flags.

When generating a shared library, it is important to use -shared instead
of -Wl,-shared to indicate the type of the final binary to the linker.

With -shared, the frontend (e.g. g++ or clang++) will pick the right
set of C runtime files automatically (i.e. crtbegin_so.o crtend_so.o).

With -Wl,-shared, wrappers like clang++3.4 will insist on using the
C runtime files for executables (i.e. crtbegin_dynamic.o crtend_android.o).

When building for MIPS targets, this can result in a link error that looks like:

.../ndk/toolchains/mipsel-linux-android-4.8/prebuilt/linux-x86/lib/gcc/mipsel-linux-android/4.8/../../../../mipsel-linux-android/bin/ld: .../ndk/platforms/android-9/arch-mips/usr/lib/../lib/crtbegin_dynamic.o: .preinit_array section is not allowed in DSO
.../ndk/toolchains/mipsel-linux-android-4.8/prebuilt/linux-x86/lib/gcc/mipsel-linux-android/4.8/../../../../mipsel-linux-android/bin/ld: .../ndk/platforms/android-9/arch-mips/usr/lib/../lib/crtend_android.o: .preinit_array section is not allowed in DSO
.../ndk/toolchains/mipsel-linux-android-4.8/prebuilt/linux-x86/lib/gcc/mipsel-linux-android/4.8/../../../../mipsel-linux-android/bin/ld: failed to set dynamic section sizes: Nonrepresentable section on output

This patch fixes the issue.

Change-Id: I9e7908c1b8c0e87bf4a818d6a38e6f67a750ea14
8f59f826cd36a610bdb466d12306b126f4d6cd30 26-May-2014 Andrew Hsieh <andrewhsieh@google.com> Use toolchains/prebuilt/$HOST_TAG/ to compile target prebuilts

Previously we always choose 32-bit $HOST_TAG32 toolchains to compile
target prebuilts, when most developers are on 64-bit host and only
download the 64-bit host NDK. On 64-bit host, this CL will try
64-bit host toolchains first before falling back to 32-bit host
toolchains

Change-Id: I4eb3f6ce2e56d0a4c79a1cb70a6a47562b8a1a0c
49458ec9b0661cff08aee71f8effc58f43b0a26d 20-May-2014 Pavel Chupin <pavel.v.chupin@intel.com> Fix cxx-stl builds

Fail introduced here: Ibb362325ff2aa663dc49ac7b715988c0dbbeb410
It doesn't fix mips builds because when building DSO under --sysroot it
is looking for crtbegin_dynamic.o instead of crtbegin_so.o

Change-Id: Ia1561cc08bb2a79abf18df4c432cb441e8de9251
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
d48f2fea248cd0b1b4350f688dea33ec64132c54 17-May-2014 Albert J. Wong <ajwong@chromium.org> Replace -nostdlib with -nodefaultlibs when crtbegin/end are needed.

Using -nodefaultlibs allows the compiler to still specify the startup files
removing the need for manually wrapping the link line with crtbegin and crtend.

Change-Id: Ibb362325ff2aa663dc49ac7b715988c0dbbeb410
ba4baa404998da4f77bf31353f935d96655c8693 28-Apr-2014 Andrew Hsieh <andrewhsieh@google.com> Build non-thumb version of STL gabi++/stlport/libc++

Previously only thumb version of gabi++/stlport/libc++ are built,
and place it at the sources/cxx-stl/*libs/<arch> directories,
instead of /thumb directory directly below. This CL build
both arm and thumb versions of library, and put thumb version in /thumb

Note that gnu-libstdc++ already contains /thumb, but ndk-build never uses it.
Now ndk-build system use non-thumb as before, unless LOCAL_ARM_MODE=arm

Also fixed is issue where make-standalone-toolchian.sh copies redundant
thumb/bits and thumb/hard/bits headers

Change-Id: I48e25d0f1b578929e8d5a32bb6c8d434c79c8a91
4d0352f01e1ab1811b83c00f37b1e4c2fc35717f 16-Apr-2014 Andrew Hsieh <andrewhsieh@google.com> Add gcc-4.9/binutils-2.24

Now gcc4.8 also compile with binutils-2.24 as well (from 2.23)

Change-Id: I249dd4414182d2b42c231ca9dbe1e2ec960b995e
9a311503035b598a1ddfb24ebbb368ba7e4cb924 12-Apr-2014 Andrew Hsieh <andrewhsieh@google.com> Auto-configure gcc version for target prebuilts

By default, use gcc4.6 to build 32-bit target prebuilts, and
use gcc4.8 to build 64-bit target prebuilts

Change-Id: I271d12422b154fcdcef74351b85f7580dbd45612
b4d9896f9557fbd4d554349729aadd0d1ce602bf 10-Apr-2014 Andrew Hsieh <andrewhsieh@google.com> Initial 64-bit supports

Change-Id: Ie3cb416b34d97a9c42f889f9c47a0a54434e5c3e
4dc739f6796d038ae4ed15fee7a8055fd7fa5db5 10-Apr-2014 WenHan Gu <Wenhan.gu@mediatek.com> Fix the useless script stub.

1. SYSROOT is defined twice, but the first one is useless.
2. PLATFORM should not be $2, since $2 is build dir.

This code stub is useless but harmless, however, it confuses us.

Change-Id: I1d9e55ca9d53ab2d3d83a6c937faf641b606f2e6
1fcb2ce4859b08e93bcdc07743798b8cdaf4033c 29-Jan-2014 Pavel Chupin <pavel.v.chupin@intel.com> Fix lib dirs paths for ndk build for LP64 archs

64-bit library dir is lib64.
Includes also trivial llvm target enabling change.

Change-Id: If3e56d40f048550fcb57f3d24d0fbc19ea451c23
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2fac82cbda64f6b7254db5b999e7ca8f6b51d90c 28-Feb-2014 Andrew Hsieh <andrewhsieh@google.com> Link with -latomic when building libc++ with clang

libc++ is currently built with clang because it uses many clang-specific
features. Link with -latomic for armeabi's libc++_shared.so which needs
__atomic_fetch_add_4. Bump "clang -gcc-toolchain" to use
DEFAULT_LLVM_GCC_VERSION (which is 4.8 now) because DEFAULT_GCC_VERSION
(4.6) doesn't have libatomic.

Change-Id: Id36005ad727dc3d7fbd8969a6317846a944edef1
748416e5a7654ce6cfce9f680cf4e7a9728bd6be 23-Jan-2014 Andrew Hsieh <andrewhsieh@google.com> Support APP_ABI=armeabi-v7a-hard

Add a new NDK-only ABI armeabi-v7a-hard in order to solve
-mfloat-abi=hard issue.

1. Note that this is NDK-only ABI. No known devices
support armeabi-v7a-hard, and they can't w/o breaking existing float-abi=softfp
code
2. APP_ABI=armeabi-v7a-hard still installs libraries in libs/armeabi-v7a.
As a result, armeabi-v7a-hard and armeabi-v7a can't co-exist ("make"
will ignore one of the "install"), unless when _NDK_TESTING_ALL_=yes for
internal testing (where lib is installed to libs/armeabi-v7a-hard)
3. Both GCC 4.6/4.8 and Clang3.3/3.4 has additional multilib
option "-mfloat-abi=hard" to look for libraries in /hard
sub-directory.
5be615df32ce970fcccda93cf577e9ce35b1d397 (gcc4.6,4.8)
7e8798057dc5f28b44b5608fd98fff1cba6909a2 (clang3.4)
deedd8557b7d82c6931b6942bd39a00127780835 (clang3.3)
4. APP_ABI=all still expand to armeabi,armeabi-v7a,x86,mips

Change-Id: I08c26bfa6580c80260185c2fef398848aebd197d
92f1ee6990752f26aebdbbfb5a87c474d3edd1e0 31-Dec-2013 Albert J. Wong <ajwong@google.com> Fix new.delete tests by correcting link methodology. Replace GABIXX_LIBCXX with LIBCXXABI.

Removed -Bsymbolic. Specified -O0 in testit_android because the optimizations
make some of the tests fail. Also replaced GABIXX_LIBCXX with LIBCXXABI
and gabi++ to reflect libc++abi, not libc++rt.

The linking of libc++_shared.so incorreclty specified -Bsymbolic
which, aside from causing issues with rtti and exception handlers,
also makes the default implementations of the array operator new,
and the single-object no-throw variant (both of which wrap the normal
single-object new) link directly to the single-object new rather than
jump through the PLT. This means that even if you override
single-object new, the default implementations of these other new
operators will NOT find the override. Bad bad bad.

Ideally, this should use -Bsymbolic-functions with
--dynamic-list-cpp-new and --dynamic-list-cpp-typeinfo so that the
linker can avoid a plt jump for most lookups, but somehow even with
the dynamic-list settings, the operator new/delete functions were
skipping the plt jump. Removed all of these options for now.

willchan, danakj, and thakis contributed to this patch.

BUG=36496

Change-Id: Iaaa25de365b6444e49ceaadaf9d0b1f442b9c85d
928d9a771ab9f16b9f38bcaa7bcc1d34c27a5d16 03-Dec-2013 Andrew Hsieh <andrewhsieh@google.com> Build static libs with Deterministic (option D) mode of ar tool

See https://code.google.com/p/android/issues/detail?id=60705 and
b2f39181c6998661cd1146d77baa892d60e3d6c3

Change-Id: Ibeac3fcfceb56ef6723a68297249e35b6f0821f0
aa47ceba9a440fe6a19fbbd6049b569af180b04c 27-Sep-2013 Andrew Hsieh <andrewhsieh@google.com> Fix libcompiler_rt to contain lib/atomic.o, depends on libc/libm, etc

1. lib/atomic.c provides essential functions like __atomic_exchange
used by intrinsic functions expanded by clang
2. Make libcompiler_rt*so depends on -lc and -lm otherwise whoever
binary links it may fail to launch due to missing __cxa_atexit, etc.
3. No need to add -minline-thumb1-jumptable for clang, because
a) first, clang doesn't generate thumb_jumptable helps this flag
tries to stop, and
b) clang doesn't understand this flag

Change-Id: I34e9d29492ab47e43c54e82865e4166e6cd117a5
6451cead30d5d2dc4957166b7ca1233a806f8bc0 26-Aug-2013 Lai Wei-Chih <Robert.Lai@mediatek.com> Determine library suffix by ABI.

Change-Id: I2ae5b6dcc949f0c47392b2afbe49984250ba9478
b06c2e9e535ee0a98625d8db367bb4ccb2cdb70b 05-Aug-2013 Andrew Hsieh <andrewhsieh@google.com> Add --gcc-version= to build-cxx-stl/compiler-rt/libportable

Previously default gcc is used to compile all sort of prebuilt
libraries except for gnu-libstdc++. Adding --gcc-version=
to optionally use specific gcc version.

Change-Id: Ibf5b6f149544239224f9665693354cb0dcbb9cb4
55000e080154d81369f265307eb197a0b0722f26 02-Aug-2013 Andrew Hsieh <andrewhsieh@google.com> Compile armeabi's gabi++/stlport/libc++ with -minline-thumb1-jumptable

GCC may generate thumb1 jumptable helper calls (eg. __gnu_thumb1_case_sqi
in libgcc.a) for switch/case.

The reason is for the following binaries (in armeabi only) to be
independent of libgcc.a which provide __gnu_thumb1_case_* helper
don't exist in compiler-rt. The library sizes increases very little.

libgabi++_static.a 176286 -> 176538 +0.1%
libstlport_static.a 1406346 -> 1413318 +0.5%
libc++_static.a 2426814 -> 2439074 +0.5%

Other ABI (armeabi-v7a, x86, and mips) aren't affected

Need https://android-review.googlesource.com/#/c/62903

Change-Id: Id7234769f5340c55cdb0b3433bc0a18eb066cfe3
041656818eb2625982d4b55d176468a4bd07fb32 07-Jun-2013 David 'Digit' Turner <digit@android.com> libc++: Use Android support library.

This improves libc++ in several ways:

- It adds a new static helper library under
sources/android/support/ to provide missing functionality
from Bionic, which are required to support wide chars
and UTF-8 encoded multi byte strings properly, as well
as locales and other stuff.

See README file in this directory for more details.

- It makes the ndk-build of libc++ use the support library.

- It provides a work-around for the Bionic limitation in its
<ctype.h> table named _ctype_, which doesn't include a bit
flag for blank characters (there is a _B flag which is only
used on SPACE (32), to implement isprint()).

See .../libcxx/support/android/locale_android.cpp

This removes the need to completely wrap <ctype.h>
in the support library itself.

+ Add two new unit tests to the NDK:

- test-android-support
- test-libc++

The first one builds and runs a small unit test suite
for the support library to verify it works properly.
This is completely independent from libc++.

The second one builds a minimalistic "Hello World"
program. Note that this uses a hack to avoid a runtime
crash (see sources/cxx-stl/llvm-libc++/test/test_1.cc)

TODO:
- Move the support library into its own independent
patch, when we're confident it works well enough.

Change-Id: I662f48a5ae602975a80b732f8738025f7e50a275
7c4534b55a734c189bc58ff8caf406430c2d2d44 07-Jun-2013 David 'Digit' Turner <digit@android.com> Build libc++ in build-target-prebuilts.sh

This patch ensures that build-target-prebuilts.sh always rebuilds
Libc++ as well, even though the library is _not_ packaged by default
by package-release.sh.

More precisely:

- Merge build-gabi++.sh and build-stlport.sh into a single new
script (build-cxx-stl.sh) which can also be used to build
libc++. As usual, the prebuilts are store under:

sources/cxx-stl/<runtime>/libs/<abi>/

This uses the --stl=<name> option to select the C++ runtime
to build.

I tested manually that the generated GAbi++ and STLport
prebuilts have exactly the same size than the ones generated
by the old scripts on Linux. And they don't break our tests.

- build-target-prebuilts.sh now unconditionally builds Libc++
prebuilt libraries as well.

- package-release.sh has a new option (--with-libc++) that can
be used to package / unpack libc++ as well. This is still not
part of the default. The packaging gets rid of the large
libc++ test suite (28 MB) in the final archive.

- Updated DEV-SCRIPTS-USAGE.TXT documentation.

BUG=36496

Change-Id: I591d46d468ebf055bb71241eeaed94cf72d9487f
3874f073abc9098ec95721d64824027fc4a3b462 21-May-2013 Lai Wei-Chih <Robert.Lai@mediatek.com> Build compiler-rt.

Need https://android-review.googlesource.com/#/c/54645/

Change-Id: If128de05f80f6f859dbd2327162b6360e727785b
b662e86e1550c29e870b82ab08c155cc6e1f34e8 16-May-2013 Lai Wei-Chih <Robert.Lai@mediatek.com> Generate shared libraries for plugin header.

Also add helper function 'arch_in_unknown_archs' to
determine whether given arch is unknown.

Change-Id: Ia51923bca6015aef38eadd69a0b58905518db863
73118fbf33f2a360fe65d268befa52377d8703d4 21-Mar-2013 Andrew Hsieh <andrewhsieh@google.com> Builder remove *.a before building a new one

This is noticed by building libportable.a when quite a few
functions were removed. Rebuilding them doesn't shrink
size because the old *obj are still in *.a, and "ar crs"
only replace the one already in *.a

Change-Id: Ifcb2935e20839fac0005e3232f6b0a70d727f6f0
632c4678596aa3416764a8d8ec3242ca378e8a29 13-Mar-2013 Lai Wei-Chih <Robert.Lai@mediatek.com> Support plugin in platforms.

Change-Id: I5480f8bf6883de3e685fb8293335f2200b49c834
6b4357c565834e8fd03b00bc5e30e4f0d6e6f4da 13-Mar-2013 Andrew Hsieh <andrewhsieh@google.com> Build/package libportable.a

Change-Id: If3e5941373ec42bcf4c99a49794f5b7406fd074e
0269f62fb52a4c3434296a37df00cdc180baac89 12-Mar-2013 Lai Wei-Chih <Robert.Lai@mediatek.com> Support rebuilding stlport/gabi++ libraries with clang.

Pass --llvm-version=<ver> to build_stlport.sh/build_gabi++.sh to enable.
Note that the default toolchain is still gcc.

Change-Id: Ibab76c443137b71aa215ce3a740ff77d2b760dcc
f5b24fbdf7b30bd70d91ca1243de66437de470ae 06-Mar-2013 Andrew Hsieh <andrewhsieh@google.com> Fix build-stlport.sh to use platforms/android-X/arch-<arch> as --sysroot

Actually, --sysroot is setup in builder-funcs.sh builder_begin_android(),
but build-stlport.sh calls builder_reset_cflags/cxxflags and forgets
about that. The results are

1. toolchains/*/*/*/sysroot is used instead. During regular rebuild of
host toolchain, "gen-platforms.sh --minimal" populates it with android-9
header/libraries so we are fine. No luck in NDK release package since
sysroot is removed.
2. stlport armeabi-v7a isn't built with -march=armv7-a -mthumb

The fixes:

1. Modify builder_reset_* to optionally take variable to hold the original
$_BUILD_* before reset
2. Modify build-stlport.sh to retrieve DEFAULT_CFLAGS and DEFAULT_CXXLAGS
3. Also add -march=armv7-a for arm linker when building for armeabi-v7a

See
https://code.google.com/p/android/issues/detail?id=52835

Change-Id: I0a52c71a3ceb2b4d1222fdddd0780aa094568689
da2e9559c981ee0a44de5a2ce3411b716764e49c 05-Dec-2012 Logan Chien <loganchien@google.com> Quote the local variables properly.

If we don't quote the local variables properly,
the bash interpreter will think that "-mthumb"
is a variable name in following example:

local _varval=--sysroot=... -mthumb

We should quote them properly:

local _varval="--sysroot=... -mthumb"

Change-Id: Ib36cd3d88106ea6aff45944c056bb07b50289605
5e5e5486e3a2465734d691cab9689bd394b8829e 08-Jun-2012 David 'Digit' Turner <digit@google.com> Use -funwind-tables when building target libraries

This patch adds the -funwind-tables flag when building our prebuilt
libraries in order to ensure that the generated code can easily be
unwound at runtime.

This prevents stack-traces from being incorrectly shortened, for
example when using the malloc leak checked, the STLport/GABI++
operator new implementation could not be unwound, and the stack
trace could not show where the code was really allocated/freed
in the original source code.

Change-Id: I424754c4d891416b34ba1f67099fbed62252286e
61c1722b71ed63f0a3098610459459a51ca041b8 17-May-2012 Chao-Ying Fu <fu@mips.com> Remove mipself.x, mipself.xsc, and MIPS linker commands, since binutils 2.21
has modified linker scripts.
Please check https://android-review.googlesource.com/#/c/34960/ .

Change-Id: I8b74bd76f2b80e1673d43ddb85740f35a037d4c1
8db29a81de9ca8d047884a038364f96530f88359 20-Apr-2012 David 'Digit' Turner <digit@google.com> Fix typo that prevent building mips target prebuilts.

Due to a typo, building mips prebuilts would fail if NDK
is not defined in your environment.

Change-Id: Id4eda46e256bf375915aeef3ec1009c9c6ae6443
248296a021718020905a736f9b3c7bc24a830139 20-Apr-2012 David 'Digit' Turner <digit@google.com> Fix typo that prevent building mips target prebuilts.

Due to a typo, building mips prebuilts would fail if NDK
is not defined in your environment.

Change-Id: Id4eda46e256bf375915aeef3ec1009c9c6ae6443
49472609babc8e7b998d9314d4040f234a2a3cb2 05-Apr-2012 Chao-Ying Fu <fu@mips.com> Change toolchain name from mips-linux-android to mipsel-linux-android,
because the target triplet requires el for MIPS little-endian targets.

Change-Id: I1ff6b888c2d7e2517ce00979dfa3719616d13d71
097812d190ebd3539c82c9c2b24161ae5e75cbb8 30-Mar-2012 Chao-Ying Fu <fu@mips.com> [MIPS] Support to ndk scripts to build MIPS NDK

Change-Id: I36e85a57d409d3f56c37737713bbeb9953b24eaa
96de6d98a79d3cd031b09f35e6659b1dd5645278 07-Mar-2012 David 'Digit' Turner <digit@google.com> Fix armeabi-v7a prebuilt binaries (GNU libstdc++ + STLport)

Due to a typo in build-gnu-libstdc++.sh and build-funcs.sh,
the armeabi-v7a prebuilt binaries were built assuming a
VFPv3-D32 capable CPU (i.e. 32 FPU double registers,
while the ABI only mandates VFPv3-D16).

This resulted in crashes when running programs linked to it on
Tegra devices and other non-NEON capable ones.

Fixes http://code.google.com/p/android/issues/detail?id=26199

+ new unit test that checks that all our armeabi-v7a prebuilt binaries
are of the correct type.

Change-Id: I567e202921881f76d1e70bed930182ea7d517b4e
3da8f16cb524b943d2a0896ec7e14b2eaf98c8be 15-Dec-2011 David 'Digit' Turner <digit@google.com> Fix the armeabi-v7a gnu libstdc++ library

This patch ensures that the content of
sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a
really contains armeabi-v7a binaries, instead of
armeabi ones.

http://code.google.com/p/android/issues/detail?id=22141

Change-Id: I729d6504641f9c481901bc6ad017add56be9dbf5
ec2b8ddacdadf4c04325dfd0a4135566ec29a8ef 27-Oct-2011 David 'Digit' Turner <digit@google.com> Fix the use of $@ in all shell scripts

This patch allows all our development scripts, as well as ndk-gdb
to work well when parameters containing spaces are used.

The $@ shell variable is very special because it will expand
differently if inside a quoted string. What this means is that,
while $@ normally corresponds to the list of all parameters to
a function or script, we have:

$@ -> expands to a single string
"$@" -> expands to a series of strings

This is important when using them as parameters to other commands
for example consider:

# Simple function to dump all parameters, one per line.
dump () {
for ITEM; do
echo "$ITEM"
done
}

dump1 () { # this will always print a single line
dump $@
}

dump2 () { # this will print one line per item
dump "$@"
}

dump1 aaa bbb ccc # prints "aaa bbb ccc" on a single line
dump2 aaa bbb ccc # prints three lines: "aaa", "bbb" and "ccc"

Generally speaking, one should always use "$@" except in very rare cases
(e.g. when called from an eval command).

Change-Id: I87ec2a7b078cbe463f0ec0257ecad8fd38835b2e
ad1afc5e66ab40201947a3178eba975515b0d73c 14-Oct-2011 David 'Digit' Turner <digit@google.com> Add win32 native build support

This patch is adds support to "native" (i.e. Cygwin-less) Windows
NDK build through the new 'ndk-build.cmd' Windows shell script.

Just call it from the cmd.exe command-line, when in your project
path. The script takes the same arguments than 'ndk-build'.

+ Adds the source of a new tiny Windows-specific command-line
"echo" program. The reason for this is that the 'echo' that
comes with cmd.exe is too weird and will not work properly
when invoked from make (e.g. it can't deal with double-quoted
strings properly: it will print the double-quotes in the
output).

+ build/tools/build-host-toolbox.sh: new script to rebuild the
'echo' program on Windows. The idea is that the 'toolbox' may
contain other command-line programs like "cp" or "mkdir" in
the future, to avoid relying on the not-so-robust cmd.exe
versions of these commands (del, md, xcopy), if necessary.

+ Make build-host-prebuilts.sh call build-host-toolbox.sh
when generating Windows binaries, and package-release.sh
unpack the corresponding archive when generating the
Windows packages.

+ build-funcs.sh can now be used to build host binaries too.

+ docs/CHANGES.html: document new native win32 build support.

Change-Id: I4d30f6c6532ae84deb95e7e5f595af76b97d9257
1c663b4a2961e4c9bde69eb740327083bbc92ed8 14-Oct-2011 David 'Digit' Turner <digit@google.com> build-target-prebuilts.sh: new script

This patch adds a new script that can be used to rebuild
all target prebuilts at once. This assumes that you have run
build-host-toolchain.sh previously (and thus have all cross
toolchains installed in your NDK directory).

+ Add check_toolchain_src_dir in prebuilt-common.sh and modify
other scripts to use it.

+ Add missing --sysroot compiled flags in builder-funcs.sh

Change-Id: I75ee8d6dffb9fba3155b71a291b1f9240e02f76f
b0d90531b30c42891feaa4860e21ed43af63c93a 10-Oct-2011 David 'Digit' Turner <digit@google.com> build/tools/dev-defaults.sh: new script

This patch moves the definitions of all defaults to dev-defaults.
This should make it easier in the future to upgrade the toolchains
or target binaries.

Change-Id: I140b51c5b5116d37d16e628120f8f58974252de4
c8f9439673c9d115c94fb4f6d1f1954ef02f0e11 29-Sep-2011 David 'Digit' Turner <digit@google.com> Make STLPort support RTTI through GAbi++

This patch modifies our build of stlport to include the GAbi++
runtime in order to support RTTI.

Change-Id: I8ff1853ad886e217f3d0d8a9366fc5075c63cc34
c38f5f527a59f1d849371d662f8882d325edc3bf 14-Sep-2011 David 'Digit' Turner <digit@google.com> GAbi++: new C++ runtime with RTTI support

This patch adds a new C++ runtime that can be used by modules
by setting APP_STL to either 'gabi++_static' or 'gabi++_shared'
in their Application.mk

GAbi++ is an alternative to the GNU libsupc++ that provides
RTTI support (with exceptions added in the future).

The goal is to use it to support RTTI (and later exceptions)
with our version of STLport, or even a different non-GNU STL.

+ new build-gabi++.sh script to rebuild the prebuilt libraries
from sources.

+ support in rebuild-all-prebuilt.sh

+ support in package-release.sh

+ Unit test to check that RTTI actually works, both in the
static and shared library case.

Change-Id: I7e73a31a4d24b5baa36fef357b69064c192ddc56
13f38e961546e562e1cf595b57c428e67f1401b5 21-Sep-2011 David 'Digit' Turner <digit@google.com> builder-funcs.sh: new shell functions

This patch introduces build/tools/builder-funcs.sh which contains
several functions that can be used to build source files into
static or shared libraries either directly or with the help of
an auto-generated Makefile (in order to allow for parallel builds).

Most of the functions come originally from build-stlport.sh which
has been modified to use the new stuff in builder-funcs.sh

Other NDK scripts will use this in the future to rebuild other
prebuilt binaries.

+ Support for NDK_CCACHE to speed up rebuilds. E.g. build-stlport.sh
now takes 0.9s on my machine (used to be 26s before that).

Change-Id: I8ef97e62987f6aac6713821455d9a1ddcbbde796