History log of /build/core/combo/TARGET_linux-arm.mk
Revision Date Author Comments
04cf31597021af3cd045dd9c50d94a87d0394023 05-Aug-2014 Dan Albert <danalbert@google.com> Inhibit implicit -Bsymolic in -shared.

Bug: 16853291

Change-Id: Id70488b077256a70137c4417f21be2c2d1d4341c
(cherry picked from commit b6bb71b85d506dcc4763290d72c4168afd541f7d)
908ab54fda172baa9a646259fafd8af35290f0a6 06-Aug-2014 Dan Albert <danalbert@google.com> 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
(cherry picked from commit 4803ce2696950f8c27c83de4fe46ae196f35af16)
5f5c48f0f1b6bef252410575d9225507e5608c0b 31-Jul-2014 Dehao Chen <dehao@google.com> Update the FDO support:

* Explicitly check BUILD_FDO_INSTRUMENT and BUILD_FDO_OPTIMIZE with true
* Remove unnecessary target_libgcov
* Update the profile collection path on device so that most app can have write access

Change-Id: I5c1915a12ea37b2cb3c76a27e7104e47ad636928
25671e15cc1b199ca693f95864ab93a63909a526 23-Jul-2014 Dehao Chen <dehao@google.com> Refactor FDO support code to ensure arm64 can also be built with FDO.

Change-Id: I752c9f411b0a046a15c72b4837efc1fb0503b470
e68ec719039406bfcc6cd8b1cab4890afbeb66a8 02-Jul-2014 Ying Wang <wangying@google.com> [DO NOT MERGE] Workaround to fix klp-modular-dev-plus-aosp build.

Change-Id: I8042b045f20b870de84ea7c4c060c3cbe1cdfe69
50031de36ee77128b00e1ea77bcbb5a48628cfa3 13-Jun-2014 Dan Albert <danalbert@google.com> Remove -Bsymbolic from builds.

This is causing issues when tools like asan try to wrap calls like
malloc. See the referenced bug for more details.

Bug: 15432753
Change-Id: I15e8eab5b773afd02dc14c78500cf8246a617718
0c87f3d733f289978dd2fa6fd4df324a52f0a4f4 29-May-2014 Andrew Hsieh <andrewhsieh@google.com> Add -latomic to all target builds

Projects using stdatomic.h needs libatomic.a in case compiler can't
expand all __atomic* intrinsics. eg, __atomic_is_lock_free in
armeabi/mips.

Adding libatomic.a globally makes more sense than adding
"LOCAL_LDLIB += -latomic " in each project including <stdatomic.h>.
Projects don't need atomic operations won't get redundant DT_NEEDED
entry because libatomic.a is not a shared library.

Change-Id: I81dbf524544c848e667e18ab5eeabff75b5063ef
0f9276d4ba6707ebc42be2aab1d9aae3dce14c80 30-May-2014 Tim Murray <timmurray@google.com> Add -shared to clang LDFLAGS.

TOT clang doesn't do the right thing with regards to -pie without this.

Change-Id: Ic14cfb25d96359eb18899c09ebaf1d311e937d01
4c952d72b7aca4801e0ee4070cf54e3de57b98b5 29-May-2014 Andrew Hsieh <andrewhsieh@google.com> Add -latomic to all target builds

Projects using stdatomic.h needs libatomic.a in case compiler can't
expand all __atomic* intrinsics. eg, __atomic_is_lock_free in
armeabi/mips.

Adding libatomic.a globally makes more sense than adding
"LOCAL_LDLIB += -latomic " in each project including <stdatomic.h>.
Projects don't need atomic operations won't get redundant DT_NEEDED
entry because libatomic.a is not a shared library.

Change-Id: I81dbf524544c848e667e18ab5eeabff75b5063ef
d90de32951835818a12b5fbb29871722ec1a7b1d 24-May-2014 Ying Wang <wangying@google.com> Exclude libstdc++ and libgcc if libc++ is requested.

Bug: 15174002
Change-Id: I24fe428c3520f76cd61f0660b59ba18a1f2d2dad
48f239c94faca140427afc9aa06cf356b1b6b0de 09-May-2014 Andrew Hsieh <andrewhsieh@google.com> Disable canonical prefixes of system headers

GCC know a few pre-defined paths (relative to its location) to
search for headers, libraries, program, etc. By default GCC prefixes
its own path(argv[0]) and calls realpath() which result in absolute
path with all symlink, . and .. removed.

It's usually good to have canonicalised paths, but absolute paths
in *.d file can cause unnecessary relinking when stale entries
in ccache cache hit

Add -no-canonical-prefixes (gcc>=4.6) and
-fno-canonical-system-headers (gcc>4.6) to disable realpath() on
prefixed paths

Change-Id: I58d739e61fb013015fb05a9c98b2132b307f915a
de36cd72e8e5a154c1fedf63e1ea83af9d5288aa 07-May-2014 Ying Wang <wangying@google.com> Apply LOCAL_LDLIBS to target build rules too.

Use LOCAL_LDLIBS to link against prebuilt libraries (such as NDK
libraries).
Previously LOCAL_LDLIBS only applies to host modules and the behaviour
confuses users.

Change-Id: I515546d7b59ef54e8ef09050eb58ec63534c9291
4de6fa4069407607813dfdd1993114c79194d337 11-Apr-2014 Ben Cheng <bccheng@google.com> Decouple platform compiler and NDK library versioning.

TARGET_GCC_VERSION: select compiler from prebuilts/gcc/...
TARGET_NDK_GCC_VERSION: select libraries from prebuilts/ndk/...

Change-Id: I4422a42cdc97aa92b40798014cba82c3c123bbd2
ce1c596e1507295f3037e9fa7bf163fb2ab95a11 29-Mar-2014 Ying Wang <wangying@google.com> Remove the unnecessary indirection of TARGET_STRIP_COMMAND

Now all archs use the same strip command which can be put just in
transform-to-stripped.

Change-Id: Ief79697d47ea142fc9e63e63a7e2dace9e839165
a6e2f9322c47ac02546aa436341fa42afd0000c5 18-Mar-2014 Christopher Ferris <cferris@google.com> Add a method to leave the symbol table in a library.

When LOCAL_STRIP_MODULE := keep_symbols is set, then the normal strip rules
will be modified so that only the .debug_* sections are removed. The original
symbol table is left alone.

This allows the compilation of certain libraries so that libbacktrace library
can provide meaningful names to functions.

Bug: 12958251
Change-Id: I82bdc304a463012e29086325ccb51163464cb4a9
9fb3526648a08d8d8c1e6325aeb3c6500bcd44c2 22-Feb-2014 Ying Wang <wangying@google.com> Make -rpath-link work with multilib.

Change-Id: If69ea6ed6cdbb657ed4005f8217d653e29626783
2f8dcdd96114274d9c689caebd546d01176e3c6b 28-Jan-2014 Elliott Hughes <enh@google.com> Remove libthread_db from the default include path.

This should never have been on the default include path.

The NDK statically links its own libthread_db, so I'm removing
bionic's unused copy from devices.

Bug: 11882807
Change-Id: I49a67fe0902cc4bc178360f6c993959774d74e3a
c3256c770df02135496503612a4ffdfa526af7e7 22-Jan-2014 Colin Cross <ccross@android.com> build: use arm kernel headers for arm 2nd arch builds

Compiling for arm requires using the arm kernel headers and not
the aarch64 kernel headers. Add $(combo_2nd_arch_prefix) to get
asm-$(TARGET_2ND_ARCH) when arm is the 2nd arch.

Change-Id: I15270d0ef35e48c034bf4d0d5e35b76f67b2a8e1
6ef6519170742bf3d56e17d04194e9cb0ecdead7 16-Jan-2014 Ying Wang <wangying@google.com> Set up rules to build static libraries for TARGET_2ND_ARCH

The rules for the 2nd arch are set up in the second inclusion
of static_library_internal.mk.
libfoo of the 2nd arch will be built into
$(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)/libfoo_intermediates/libfoo.a.

Bug: 11654773
Change-Id: I1d92733968fc442e9225b4df5bd1b551a81d89f7
1d274d26869bfe6881d503b2d24f87cc40cf2727 27-Dec-2013 Ying Wang <wangying@google.com> Load compiler environment for a second arch.

This is the first step to build 32-bit libraries in a 64-bit product.
It will work like this:
1) In the product's BoardConfig.mk, define:
TARGET_2ND_ARCH, TARGET_2ND_ARCH_VARIANT, TARGET_2ND_CPU_VARIANT.
The build system uses those variables to set up an additional compiler
environment for the second arch.

2) When parsing Android.mks, the build system sets up rules to build a
module for both the 1st arch and the 2nd arch, unless it's explicitly
asked to skip so.
Android.mk will be adapted if there is additional rule of generating
source files.
The build system will accept arch-specific LOCAL_ variables, such as
LOCAL_CFLAGS_arm, LOCAL_CFLAGS_armv7-a-neon, LOCAL_CFLAGS_cortex-a15,
LOCAL_CFLAGS_aarch64 etc. Modules use such variables to set up build for
various archs at the same time.

3) Install binary of the 2nd arch by adding "<module_name>:32" to
PRODUCT_PACKAGES. All 2nd-arch libraries linked in by "<module_name>:32"
will be installed automatically.

Bug: 11654773
Change-Id: I2df63cd5463a07bf5358bee2a109f8fb9590fe30

Conflicts:
core/combo/TARGET_linux-arm.mk
3814cbfd333ebec7b75f6df5838b85fec50c432c 22-Jan-2014 Colin Cross <ccross@android.com> build: use arm kernel headers for arm 2nd arch builds

Compiling for arm requires using the arm kernel headers and not
the aarch64 kernel headers. Add $(combo_2nd_arch_prefix) to get
asm-$(TARGET_2ND_ARCH) when arm is the 2nd arch.

Change-Id: I15270d0ef35e48c034bf4d0d5e35b76f67b2a8e1
61d499b965e3314308b9510f6b6d4c8919bb0b3a 16-Jan-2014 Ying Wang <wangying@google.com> Set up rules to build static libraries for TARGET_2ND_ARCH

The rules for the 2nd arch are set up in the second inclusion
of static_library_internal.mk.
libfoo of the 2nd arch will be built into
$(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)/libfoo_intermediates/libfoo.a.

Bug: 11654773
Change-Id: I1d92733968fc442e9225b4df5bd1b551a81d89f7
e1d44c3b4acef1319c34514e8d4ee78127b895ef 27-Dec-2013 Ying Wang <wangying@google.com> Load compiler environment for a second arch.

This is the first step to build 32-bit libraries in a 64-bit product.
It will work like this:
1) In the product's BoardConfig.mk, define:
TARGET_2ND_ARCH, TARGET_2ND_ARCH_VARIANT, TARGET_2ND_CPU_VARIANT.
The build system uses those variables to set up an additional compiler
environment for the second arch.

2) When parsing Android.mks, the build system sets up rules to build a
module for both the 1st arch and the 2nd arch, unless it's explicitly
asked to skip so.
Android.mk will be adapted if there is additional rule of generating
source files.
The build system will accept arch-specific LOCAL_ variables, such as
LOCAL_CFLAGS_arm, LOCAL_CFLAGS_armv7-a-neon, LOCAL_CFLAGS_cortex-a15,
LOCAL_CFLAGS_aarch64 etc. Modules use such variables to set up build for
various archs at the same time.

3) Install binary of the 2nd arch by adding "<module_name>:32" to
PRODUCT_PACKAGES. All 2nd-arch libraries linked in by "<module_name>:32"
will be installed automatically.

Bug: 11654773
Change-Id: I2df63cd5463a07bf5358bee2a109f8fb9590fe30
dddb566eba8cd666b6f3b70067e77acb4e1656de 11-Jan-2014 Elliott Hughes <enh@google.com> Remove obsolete CUSTOM_KERNEL_HEADERS.

Change-Id: Id260dd351b90f065eee56e231d4c341b18c1b27f
9824ce4e1d500d7f51e49f7673d71b207f689de5 16-Dec-2013 Christopher Ferris <cferris@google.com> Re-enable uapi kernel headers for arm.

Bug: 11559337
Change-Id: Ib914e5f22b10d5a74edc357d42b0dcb223185ab4
e2c73b3194891a5fa863a868b9bd7f71e391d0c4 16-Dec-2013 Christopher Ferris <cferris@google.com> Revert "Enable uapi kernel headers for arm."

This reverts commit 88c6c533e17f7bc2e1491310b8d679a91b33aaeb.

Change-Id: I3cd84383c6f217bc6e627e16b2d0c7d948f8131d
88c6c533e17f7bc2e1491310b8d679a91b33aaeb 16-Dec-2013 Christopher Ferris <cferris@google.com> Enable uapi kernel headers for arm.

Bug: 11559337
Change-Id: Idd251338f707b7c6a08f43a79f9784c57142f43c
9696acae02dfbf86ad5adb39682ff2e72f256226 25-Nov-2013 Elliott Hughes <enh@google.com> Add a "reverse AUX hack" for ARM.

MIPS and x86 are almost completely switched over to uapi-only. ARM is still
currently old-only. A cleanup of the uapi headers over the weekend means
that the uapi-only <linux/kexec.h> is now in the right place, which will break
the ARM build unless the ARM build also looks in the uapi headers if it can't
find an old header.

Change-Id: Ie7a53ef2122b43cdef64b71d7b36a8381992a461
818d7d04f53c56b7daf1917611871ca4e9903c18 14-Nov-2013 Ben Cheng <bccheng@google.com> Switch AOSP ARM build to use GCC 4.8.

Change-Id: I65051773153ad5bc2c093cd1313acd212eb427b1
670b8d2251cdd8d0854916774958cfdc263d07d8 17-Sep-2013 Ben Cheng <bccheng@google.com> Switch ARM platform toolchain to GCC 4.8.

Change-Id: If08cfb2b9d86c08d3b658470440242b0af4d9916
85ccf735e2d261b5b302635505ea1db85975c597 28-Aug-2013 Ben Cheng <bccheng@google.com> Re-tighten default compiler options.

Remove "-Wno-unused-parameter -Wno-unused-but-set-parameter" added for
GCC 4.8 experiment.

BUG: 10495043
(cherry picked from internal master 1cea0755f400c1d183d22679d5b931c3a04ae4a4)

Change-Id: Ifa221709b1351a9268c06872e2b667138995c3da
1cea0755f400c1d183d22679d5b931c3a04ae4a4 28-Aug-2013 Ben Cheng <bccheng@google.com> Re-tighten default compiler options.

Remove "-Wno-unused-parameter -Wno-unused-but-set-parameter" added for
GCC 4.8 experiment.

BUG: 10495043
Change-Id: I774deb09c782fe79eb473fdefd471725a1f97fd5
f4723fa49b6e61f727b6321a4006ee8ba3f393b9 15-Aug-2013 Ying Wang <wangying@google.com> No need to filter out AndroidConfig.h for unbundled build

for now we have all AndroidConfig.hs in the build project.

Change-Id: Id713fecba1378fad81688f5937f61c779b618ac2
aac3f81657b9111b3680c370083c01879612c443 13-Aug-2013 Ben Cheng <bccheng@google.com> Prepare upcoming GCC 4.8 release.

o Add -Wno-unused-parameter -Wno-unused-but-set-parameter to suppress
new warnings.
o Define GCC_COLORS to enable colorful diagnostic messages.

Change-Id: Icbd62300b0e6f39d4e514edec2431a06b4d72421
(cherry picked from internal commit ccd8e6082b5b1e519a75068fa6c887a1a85b53c4)
ccd8e6082b5b1e519a75068fa6c887a1a85b53c4 13-Aug-2013 Ben Cheng <bccheng@google.com> Prepare upcoming GCC 4.8 release.

o Add -Wno-unused-parameter -Wno-unused-but-set-parameter to suppress
new warnings.
o Define GCC_COLORS to enable colorful diagnostic messages.

Change-Id: Icbd62300b0e6f39d4e514edec2431a06b4d72421
cfdb24f1cb218a8a0bfcdfe68dec04dacf30f472 07-Aug-2013 synergydev <synergye@codefi.re> Link PRIVATE_TARGET_FDO_LIB before shared libraries

For global declaration of FDO profile generation and usage,
we need to link PRIVATE_TARGET_FDO_LIB (libgcov.a by default)
prior to linking shared libraries.

TARGET_FDO_LIB is set if feedback directed optimizations
are in use, so we do not need to worry about consistent size
increases from this change.

Change-Id: I543903f58893816f037c9466f31b19dfe822fdf4
0eb35626da3e16d8db7756913433ee37f7ec2f49 03-May-2013 Ying Wang <wangying@google.com> Add extra libgcc.a only for unbundled build.

We can save some space for platform build with this.
Previously an extra libgcc.a was put before libc.so so libraries built
against new platform can run on old platforms. This is needed only for
unbundled build.

Bug: 8805022
Bug: 8247455

Change-Id: I3c3e0092b06ec3804659d5cae048d29e0d2bf7ad
316f720b91f879c4e3972d6d595535de0ac707b2 26-Apr-2013 Nick Kralevich <nnk@google.com> arm: upgrade to _FORTIFY_SOURCE=2

Enable _FORTIFY_SOURCE=2 for ARM.

Currently, this change is a no-op, as Android's libc doesn't
support _FORTIFY_SOURCE > 1, yet.

Change-Id: Ib4c8e44e6949a37352c153e3c52a4fa001f18738
6c7bc550adb917157a9f53ebf8898110e37294b2 13-Mar-2013 Ben Cheng <bccheng@google.com> Link libgcc.a before shared libraries (especially libc.so).

[cherry-picked from internal master]

Change-Id: I53d19754d0d40e9ca2f3d043001cc77e39e5d795
ea871a06499e7433b109852d8fdda781da7c14c2 13-Mar-2013 Ben Cheng <bccheng@google.com> Link libgcc.a before shared libraries (especially libc.so).

BUG: 8247455
Change-Id: Ia8816536ca95a7084e80c7f425f81658afea9609
03d2aa4dd0adf85f240e98563ef399584baedb62 14-Feb-2013 Elliott Hughes <enh@google.com> Remove more always-true ARCH_ARM_HAVE_ flags.

All the remaining flags appear to be actually used.

Change-Id: I0e3d84915487eda4f0e97809fc36624fef5f1848
b6457c223b0d0a6fb2a1bd5f90844cd34cc7afbb 30-Jan-2013 Ying Wang <wangying@google.com> Don't fall back to host $(CC) if the target gcc is not checked out

Error "cc1plus: error: unrecognized command line option
‘-mfloat-abi=softfp’" is much more confusing than
"...gcc: No such file or directory".
Also we don't build in Windows/Cygwin any more so we don't need the old
trick.

Change-Id: Ibbe3da67b412575e56bd6e61ef412ea5b2789fea
ec4caba79cf805a21a7d705cb35ecd89bb598a7f 13-Dec-2012 Ben Cheng <bccheng@google.com> Enable lunch command to pick up new toolchain version.

Otherwise the previously exported value will be sticky and the value
defined in the TARGET makefile is ignored.

Change-Id: Icdacb8c46034b8a24a9875b7596b31d00861512a
914f7fd938ed8b1a9abcea57325010d464cdc55e 13-Dec-2012 Ben Cheng <bccheng@google.com> Enable lunch command to pick up new toolchain version.

Otherwise the previously exported value will be sticky and the value
defined in the TARGET makefile is ignored.

Change-Id: I13b9cca2d288f7ab09104c57e7cad9f23de2548a
5011dd80ee4aff6254bd5600429b3ced1e52f792 12-Dec-2012 Ben Cheng <bccheng@google.com> Refresh ARM toolchain to GCC 4.7 / binutils 2.22.

Change-Id: Id3689376ae4c4fc183569955b2ee98df5c069510
054ffd2e7c3da585ab223518569e7436858ba5e0 11-Dec-2012 Ben Cheng <bccheng@google.com> Define TARGET_GCC_VERSION in target specific make files.

So that GCC refresh can be performed in a target specific way.

Change-Id: I867e8b8fd671bef8c5af300e657a6da4fface032
07a6db8733da14ac6b0161468c697a1413a0ce8a 07-Nov-2012 Elliott Hughes <enh@google.com> Remove manual WITH_JIT setting from build/.

This is now done automatically by dalvik/, since
patch 272a54f8553e13b87bf819542ddc6701fc1232cc.

Change-Id: I57709538f20188417c014630442e897401d7ace0
06b63baedc769863f87ac0b789ac320b3cb0dc2a 22-Oct-2012 Andrew Hsieh <andrewhsieh@google.com> Add TARGET_GCC_VERSION

Default to 4.6, but can overwritten to something else in
prebuilts/gcc/$os/$arch/$arch-linux-android*-$ver

Change-Id: I16f99d642b8ff8e831d392261a0c536041107051
077007e872413ed2bf30642515a400f1b4238b25 18-Oct-2012 Nick Kralevich <nnk@google.com> arm: turn on -Wl,--fatal-warnings

Third time's the charm. :-)

In b238210c0172e771b1302364273016ad1fabafb8, we added
-Wl,--warn-shared-textrel to TARGET_GLOBAL_LDFLAGS. This generated
a warning whenever we created a shared library with a text
relocation. At the time, we wrote:
=====
Emit a warning when the static linker detects a shared library
has text relocations. Text relocations make it harder to
share pages across processes, and make it harder to use
certain memory protection features in, for example, SELinux.
This warning will turn into an error in a future change
(via --fatal-warnings)
=====

All code which uses text relocations has either been fixed, or
we've temporarily worked around the issue so the code can still
compile.

Enable --fatal-warnings.

This reverts commit 942167dab8345c420b205ce9b9b6b4fc779a7583.

Change-Id: I578701692ead7e7cd60d73d2070a5bed366e2c6c
942167dab8345c420b205ce9b9b6b4fc779a7583 18-Oct-2012 Nick Kralevich <nnk@google.com> Revert "arm: turn on -Wl,--fatal-warnings"

This reverts commit 3ab011bccd5ed416148bb6ab8ea06f23c89977e7.
3ab011bccd5ed416148bb6ab8ea06f23c89977e7 17-Oct-2012 Nick Kralevich <nnk@google.com> arm: turn on -Wl,--fatal-warnings

In b238210c0172e771b1302364273016ad1fabafb8, we added
-Wl,--warn-shared-textrel to TARGET_GLOBAL_LDFLAGS. This generated
a warning whenever we created a shared library with a text
relocation. At the time, we wrote:
=====
Emit a warning when the static linker detects a shared library
has text relocations. Text relocations make it harder to
share pages across processes, and make it harder to use
certain memory protection features in, for example, SELinux.
This warning will turn into an error in a future change
(via --fatal-warnings)
=====

All code which uses text relocations has either been fixed, or
we've temporarily worked around the issue so the code can still
compile.

Enable --fatal-warnings.

This reverts commit 4dc781657b7aa2385cc6ffedc8f3841abdcfd5f6.

Change-Id: I81b96477f1c11069637f28cfd8fb98d42b39be5e
4dc781657b7aa2385cc6ffedc8f3841abdcfd5f6 16-Oct-2012 Nick Kralevich <nnk@google.com> Revert "arm: turn on -Wl,--fatal-warnings"

This reverts commit edfee7250f072cb148da6de04eacb834366bef38.
edfee7250f072cb148da6de04eacb834366bef38 12-Oct-2012 Nick Kralevich <nnk@google.com> arm: turn on -Wl,--fatal-warnings

In b238210c0172e771b1302364273016ad1fabafb8, we added
-Wl,--warn-shared-textrel to TARGET_GLOBAL_LDFLAGS. This generated
a warning whenever we created a shared library with a text
relocation. At the time, we wrote:

=====
Emit a warning when the static linker detects a shared library
has text relocations. Text relocations make it harder to
share pages across processes, and make it harder to use
certain memory protection features in, for example, SELinux.
This warning will turn into an error in a future change
(via --fatal-warnings)
=====

We've successfully removed all text relocations from Android's
compiled code, so turn on -Wl,--fatal-warnings .
Some pre-compiled shared libraries continue to have text relocations,
but they will be unaffected by this change.

Change-Id: I505ea23120048afc45f62593704fe1d6d26a352c
57ddcb1bbce7a980e677dfd212ce76229fe33f55 26-Sep-2012 Ying Wang <wangying@google.com> Support to build executables against the NDK

Use "LOCAL_SDK_VERSION := <number>" to build against the NDK when you
include $(BUILD_EXECUTABLE).
Cherry-picked from master.

Bug: 7170098
Change-Id: Ib35a294bd6aa4e969d46ecd8ebab8ca5d843e24b
91fd1231c3254bc9d0642e5a646b5657bdaedffa 26-Sep-2012 Ying Wang <wangying@google.com> Support to build executables against the NDK

Use "LOCAL_SDK_VERSION := <number>" to build against the NDK when you
include $(BUILD_EXECUTABLE).

Bug: 7170098
Change-Id: I4cebeae3355e79a4d2f2f5549ef0613ced77e3f0
c6ffc00b9fa7898564139558a025d865bac37a38 26-Sep-2012 Ying Wang <wangying@google.com> Support to build executables against the NDK

Use "LOCAL_SDK_VERSION := <number>" to build against the NDK when you
include $(BUILD_EXECUTABLE).

Bug: 7170098
Change-Id: I4cebeae3355e79a4d2f2f5549ef0613ced77e3f0
5bdf305bbe529a85735200353478057b65bb462e 20-Sep-2012 Ying Wang <wangying@google.com> Move AndroidConfig.h from system/core to the build project.

So unbundled branches don't need to include the system/core project.

Change-Id: Ic4ef62ee6df069b9b2dd123aed95a3e7fcdfc146
26c78057816654eb7da7df343a934981b4327e19 28-Aug-2012 Andrew Hsieh <andrewhsieh@google.com> Add pattern to check for GCC 4.6

GCC 4.6 --version can return 4.6.x-google but also simply 4.6
as of https://android-review.googlesource.com/#/c/42028.
Add more pattern to detect it.

Change-Id: Ibf34fba9afdf01bd3eafc011cc4d059b59f25d3d
6c1f9ccfb1dbc04a32275bfb6133c1b122400f04 21-Aug-2012 Ard Biesheuvel <ard.biesheuvel@gmail.com> ARM: put crtbegin_so.o at the beginning where it belongs

Change-Id: I9466fe9277c58a7b8f8a9964b2d578a65e579995
da4bf4251451d2da8883d636849b65fcc368a575 17-Aug-2012 Ying Wang <wangying@google.com> Don't include system/core/include/arch/<arch>/Android.mk for apps-only build.

Bug: 6994483
Change-Id: I76c4d96264cf94a79d59fdeb52bb37c07a9458dd
b238210c0172e771b1302364273016ad1fabafb8 10-Aug-2012 Nick Kralevich <nnk@google.com> arm: add --warn-shared-textrel

Emit a warning when the static linker detects a shared library
has text relocations. Text relocations make it harder to
share pages across processes, and make it harder to use
certain memory protection features in, for example, SELinux.

This warning will turn into an error in a future change
(via --fatal-warnings)

References: http://www.akkadia.org/drepper/textrelocs.html

Change-Id: I3bc818e3ecdb8a4338668a9e816b6dc1081b7557
a46c480e43cc61d0190569684f0a1e53a5da75b6 05-Jun-2012 Nick Kralevich <nnk@google.com> arm: add -D_FORTIFY_SOURCE=1 to the default cflags

Add additional compile and runtime buffer overflow detection to
Android. As of today, Android supports additional buffer overflow
detection for the following libc functions:

* memcpy
* memmove
* strcpy
* strcat
* strncpy
* strncat

Support for additional functions will be added to bionic libc in
future code changes.

Please see
* http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
* http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html

for information on these features.

Change-Id: I1a281a4bac20009f4730dd8d8b798fa107576230
b1a4e4e89e9989b292938c800d234ab1007b848c 16-May-2012 Ying Wang <wangying@google.com> Delete the misleading var TARGET_OUT_STATIC_LIBRARIES.

Which can be replaced by TARGET_OUT_INTERMEDIATE_LIBRARIES.

Change-Id: I965ff1ebe70fc3113c19e4896277c876dcedb6a5
ee08fe31964ce65f97bc9f9341eee915cb0ea6aa 01-Nov-2011 Nick Kralevich <nnk@google.com> stop using a custom linker script for static executables.

This is causing problems with making the linker relocatable.

Change-Id: I53e37fba52eabd3145130712d6e9bff074aed493
61c37e7a4f929a79efb8abf4489bac0c1ffec8ff 20-Jan-2012 Kito Cheng <kito@0xlab.org> Update build rule for executable with PRIVATE_ALL_WHOLE_STATIC_LIBRARIES

Change-Id: I9ff53f51dcb57511a24765bdf6a61c000a7ce977

Signed-off-by: Kito Cheng <kito@0xlab.org>
233d460f21d372f964f8078b8b0d5fd17af7c6b6 26-Apr-2012 Nick Kralevich <nnk@google.com> ARM: compile everything with relro / bind_now.

Enable relro / bind_now when compiling Android applications.
This marks certain regions of memory as read-only after linking,
making memory corruption security vulnerabilities are harder
to exploit.

See:
* http://www.akkadia.org/drepper/nonselsec.pdf (section 6)
* http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html

Stop using the custom linker script, which inhibits
relro / bind_now support.

Change-Id: Ie97ccdd2845886bbc2ba2fdd47eed0ff4b29b60b
a50ef1c12441d9eccfa75409c1392befaf2abed5 21-Apr-2012 Jean-Baptiste Queru <jbq@google.com> Switch to new locations of toolchains

Change-Id: I15a8be11b3d0f1985ffd97dd51a1af18e1ce7b67
c856e31523b2a01efc39a97207d3ce11f1db1ca5 18-Nov-2011 Jing Yu <jingyu@google.com> Workaround for a gcc-4.6 bug on -fstrict-volatile-bitfields.

http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01477.html
http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01390.html

-fstrict-volatile-bitfields is set on by default on gcc-4.6
for ARM target. This causes an inline asm() error. While
upstream gcc community is working on the patch, we shut
off this option temporarily.

This patch does not affect gcc-4.4.3 build.

Change-Id: Id7016dc5856a516e10f2617232945034728a74ab
422a3650d37730a5c793e52e3e6c815278753d22 13-Oct-2011 Doug Kwan <dougkwan@google.com> Fix build problems with gcc-4.6.x.

Change-Id: If02f18efde4cec39c97bb0e7226b008cd6b85dd4
303d87685235f7576cb62ae19817cc48e159c2b6 10-Apr-2012 Nick Kralevich <nnk@google.com> Revert "ARM: compile everything with relro / bind_now."

This reverts commit 020e4919e89a824783dbe8716bc56785267323f7.
b3789be76609f78a991fc89c287379155818391b 10-Apr-2012 Nick Kralevich <nnk@google.com> Revert "ARM: compile everything with relro / bind_now."

This reverts commit 020e4919e89a824783dbe8716bc56785267323f7.
020e4919e89a824783dbe8716bc56785267323f7 20-Mar-2012 Nick Kralevich <nnk@google.com> ARM: compile everything with relro / bind_now.

Enable relro / bind_now when compiling Android applications.
This marks certain regions of memory as read-only after linking,
making memory corruption security vulnerabilities are harder
to exploit.

See:
* http://www.akkadia.org/drepper/nonselsec.pdf (section 6)
* http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html

Stop using the custom linker script, which inhibits
relro / bind_now support.

Change-Id: Iaebfbbb492299004f9da92b649985b6cd67d8c97
f5172c7564e0d84bf02b9add47809ce10a9cff4f 30-Mar-2012 Jing Yu <jingyu@google.com> Switch default gcc toolchain from 4.4.3 to 4.6.

Switch both arm-linux-androideabi toolchainand arm-eabi toolchain.

Change-Id: I7b2771fe684853ab37e3b5b7cfe4146f9f901e02
3316544b979a24306c25f15613584285b51003bd 17-Mar-2012 The Android Automerger <android-build@android.com> Revert "Swicth to toolchain gcc-4.6"

This reverts commit e5129bda36c63f5413338a0eceba59cbf4adbbb7.
e5129bda36c63f5413338a0eceba59cbf4adbbb7 16-Mar-2012 Ying Wang <wangying@google.com> Swicth to toolchain gcc-4.6

Change-Id: Iead6fe6f194821b565971bc2cac026b7d9aebe78
f2a98a3b834c982649fceaa8aaa9bf7069297181 16-Mar-2012 The Android Automerger <android-build@android.com> Revert "Swicth to toolchain gcc-4.6"

This reverts commit c914cc99c9900b5838748ae3488c5b6a37d14ed2.
c914cc99c9900b5838748ae3488c5b6a37d14ed2 16-Mar-2012 Ying Wang <wangying@google.com> Swicth to toolchain gcc-4.6

Change-Id: Iead6fe6f194821b565971bc2cac026b7d9aebe78
5d84f1659fbd48253d25785814e5c457575ea2da 31-Jan-2012 Jim Huang <jserv@0xlab.org> TARGET_linux-arm.mk: use single slash version of -print-whatever

The double slash variants are not documented in GCC manual. Therefore,
it is better to use the single slash variants as usual.
cb8f66305caf4f9252112608ad93e2ef58321244 11-Jan-2012 Jean-Baptiste Queru <jbq@google.com> Revert "Point arm toolchain to the new gcc-4.6 one."

This reverts commit 1f87795eef3ab5f63675dc6e01f304d1a6e46d2a.
1f87795eef3ab5f63675dc6e01f304d1a6e46d2a 06-Jan-2012 Jing Yu <jingyu@google.com> Point arm toolchain to the new gcc-4.6 one.

Tested build mysid-eng, sojus-eng, trygon-eng, yakju-eng.

Change-Id: I742cf9fcf2407b9098c99136d67161ecf062ac01

Conflicts:

core/combo/TARGET_linux-arm.mk
c7a10ddd3115a40de10b34d7dbfe92134ce7ae8f 06-Jan-2012 Ying Wang <wangying@google.com> Include toolchain makefile based on the current config.

So we can have the same set of module names in different host arch
/ toolchain version combinations.

Change-Id: Iec66584bf3de92aedd71a59f9dbe74b6ed025b2e
7bf82e017101ab458d085e42ca7d0aaefa8bbc9d 18-Nov-2011 Jing Yu <jingyu@google.com> Workaround for a gcc-4.6 bug on -fstrict-volatile-bitfields.

http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01477.html
http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01390.html

-fstrict-volatile-bitfields is set on by default on gcc-4.6
for ARM target. This causes an inline asm() error. While
upstream gcc community is working on the patch, we shut
off this option temporarily.

This patch does not affect gcc-4.4.3 build.

Change-Id: Id7016dc5856a516e10f2617232945034728a74ab
4185447f2f04a646c1659149699dadb6f9a48451 01-Nov-2011 Nick Kralevich <nnk@google.com> stop using a custom linker script for static executables.

This is causing problems with making the linker relocatable.

Change-Id: I53e37fba52eabd3145130712d6e9bff074aed493
026a85b129e4540a4d8d40aace47aa0c69f609da 24-Oct-2011 Nick Kralevich <nnk@google.com> enable PIE for dynamically linked executables

Compile all programs on Android with -fPIE and -pie. This enables
PIE (Position Independent Executables), which helps protect Android
applications from exploitation due to memory management bugs.

Stop using the armelf.x linker script. This script hard codes the
load address of the executable, defeating the position independence
PIE requires.

Note: PIE *static* executables are not supported at this time and
require additional linker changes.

Bug: 5323301
Change-Id: Ieafcc9c4f142495847e163881889d371a59d0878
2b407577256e97f35d1fb25f6ec95415cde8ffdf 13-Oct-2011 Doug Kwan <dougkwan@google.com> Fix build problems with gcc-4.6.x.

Change-Id: If02f18efde4cec39c97bb0e7226b008cd6b85dd4
be3689e9817e7c8c64cf8a374c2905adefb008c4 15-Jul-2011 Doug Kwan <dougkwan@google.com> Conditionally disable -Wno-unused-but-set-variable for gcc-4.6.
We used to do that unconditionally but that caused lots of spurious
warnings in gcc-4.4.x about an unrecognized gcc option.

Change-Id: Idb5118b069871859e07a7efa04914ab6ed0b1372
c101e27d547ee218337b2600e8158dedd0a064af 31-May-2011 Bruce Beare <bruce.j.beare@intel.com> Refactor Stripper. Allow a stripper other than SOSLIM to be specified

Orig-Change-Id: I61137f5bb123dc5f610af9928ed3debdf85ba74d
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
8f77c9ded3b64764ebe6f2cb1be45a2de0b7bec9 21-Jun-2011 Evgeniy Stepanov <eugenis@google.com> Add .gnu_debuglink when stripping DSOs.

This is used by debug tools to find symbols for the stripped binary.
Adds ~70 bytes to each DSO, ~25000 bytes total, which is about 0.01% of the
system image.

This change only affects -eng and -userdebug builds, and does not affect -user.

Change-Id: I0c92a9e09fbc97184dea66813923568cbcc2a3fe
c639c787a0932b230be0d991941ce26c0faea81b 21-Jun-2011 Raphael Moll <ralf@android.com> Lunch: don't use a toolchain that doesn't exist.

"lunch sdk-eng" on cygwin tries to use a gcc.exe from the
prebuild arm toolchain, but it doesn't exist. This prevents
from setting variables to point on a gcc toolchain if there
is none for the given arch.

Change-Id: I3b72220663687f9fdaacc050899aef00632f2c3c
fcdabd4bdbb347399e77d2fd4b1aefd6281d75f8 25-Apr-2011 Ying Wang <wangying@google.com> Add LOCAL_GROUP_STATIC_LIBRARIES

Set LOCAL_GROUP_STATIC_LIBRARIES := true to group the static libraries,
in case we need gcc flags "-Wl,--start-group" and "-Wl,--end-group" to
fix circular references.

Change-Id: I03c4901670112fcdd2bb0fe660b6924e5776fcf8
0cafe839e079f71e4799868d03a39ec82aa277a7 17-Mar-2011 Iliyan Malchev <malchev@google.com> build: pass --strip-all, not --strip-debug to strip

Option --strip-all will remove the static symbol section in addition to debug
symbols. We do not need the static symbol table in libraries installed on the
target.

Change-Id: I7a52d22f5b45aa727f31bfd9af796b289528caef
Signed-off-by: Iliyan Malchev <malchev@google.com>
b375e71d306f2fd356b9b356b636e568c4581fa1 09-Mar-2011 Iliyan Malchev <malchev@google.com> build: remove prelinker build build system

This patch removes support for prelinking from the build system. By now, the
prelinker has outlived its usefulness for several reasons. Firstly, the
speedup that it afforded in the early days of Android is now nullified by the
speed of hardware, as well as by the presence of Zygote. Secondly, the space
savings that come with prelinking (measued at 17MB on a recent honeycomb
stingray build) are no longer important either. Thirdly, prelinking reduces
the effectiveness of Address-Space-Layout Randomization. Finally, since it is
not part of the gcc suite, the prelinker needs to be maintained separately.

The patch deletes apriori, soslim, lsd, isprelinked, and iself from the source
tree. It also removes the prelink map.

LOCAL_PRELINK_MODULE becomes a no-op. Individual Android.mk will get cleaned
separately. Support for prelinking will have to be removed from the recovery
code and from the dynamic loader as well.

Change-Id: I5839c9c25f7772d5183eedfe20ab924f2a7cd411
bd528a82a24e2230ea797ffc7d9a20d4d917747e 16-Feb-2011 Jeff Brown <jeffbrown@google.com> Build system tweaks for Valgrind.

Added LOCAL_NO_CRT to enable building executables that do not link
to the C runtime library.

Removed support for LOCAL_MODULE_SUBDIR since it was broken
and unused. (Was going to use it but ended up using LOCAL_MODULE_PATH
instead.)

Change-Id: Ifed4ffe17003d90370c711ea6606e2b75e841dee
5116e50705974bdf994fd46418529b6f94b61bfd 16-Feb-2011 Ben Cheng <bccheng@android.com> Remove usused workaround.

Change-Id: I1d42d0f0dee361b98403bc87296dcbc37484ebcb
703e7c6d50a5bddf0fb057a1a26618e2f7138c31 05-Feb-2011 Jeff Brown <jeffbrown@google.com> Build system tweaks for Valgrind.

Added LOCAL_NO_CRT to enable building executables that do not link
to the C runtime library.

Removed support for LOCAL_MODULE_SUBDIR since it was broken
and unused. (Was going to use it but ended up using LOCAL_MODULE_PATH
instead.)

Change-Id: I3b6f5ab7e5ae6aaa7119899adccece2b4ab1cbb3
3a7e4ccad9c910ac798a8c324f7718d137bd7692 28-Jan-2011 Ying Wang <wangying@google.com> Unify use of $(hide).

Change-Id: Ib7e17bbb4682caecce5812e63de872b676403d64
f5653d1cee10cd8995217e0831678a3610544b20 28-Jan-2011 Ying Wang <wangying@google.com> Regularize use of PRIVATE_CXX.

Change-Id: Ifc628c67b5fa142cec59187f89f2d39df81160b9
80e6cce93e36787be9123f9b5dc91da1a0d2f472 25-Jan-2011 Ying Wang <wangying@google.com> Correct misuse of target/host vars.

Change-Id: Ide41aeddc44ca05d85a36035c2d55ea453cfd216
a83b769566550e30b368836e77b5ac3286844768 22-Dec-2010 Jing Yu <jingyu@google.com> Remove global inline options.

The purpose of removing global inline options is to give
compiler the opportunity to do inline optimizations and inline
tunings for Android native codes.

By removing these global inline options now, the size of
almost all native libraries are reduced. And there is no
noticable performance degradation on webkit, gcstone and
skia benchmarks.

Change-Id: I31e71f51e4f29fa6286fddb89e9eab227581c7b3
efd2489b39a840a66baa06a2f333e7c15d4ba383 22-Oct-2010 Ben Cheng <bccheng@android.com> Insert directives to work around a CPU bug.

Bug: 3117632
Change-Id: I2fb58e7093984d18d2d2d21edf687206f4ddab31
6d98f5f4d6a25b03c7322ed596ab377ef65cf1fd 06-Aug-2010 Dima Zavin <dima@android.com> core: fix paths to libm arch-specific include dirs

Change-Id: I17a1ed13af6d4955a636ad429917b683ac59a947
Signed-off-by: Dima Zavin <dima@android.com>
9d396e37ac695916671614ab89797652ed02538c 30-Jul-2010 Jing Yu <jingyu@google.com> Make arm-linux-androideabi toolchain the default for Android build.

androideabi target is already in upstream GCC. The arm-linux-
androideabi toolchain can be built directly from upstream GCC.
Switching from old special tailored arm-eabi toolchain to the new
arm-linux-androideabi toolchain make us closer to the opensource
community and friendly to all toolchain developers.

kernel still uses arm-eabi toolchain. So we add arm-eabi toolchain
path to PATH.

The arm-linux-androideabi-4.4.x toolchain is built with the same
source as the latest arm-eabi-4.4.3 toolchain except for the
target change patches.

Change-Id: I1e5f2fe2faeee08f913f37e0ba93e84d2654a8ff
584f5b7a84b6187a3d72d42aa5af2f0bda2eb874 20-May-2010 Jing Yu <jingyu@google.com> Group needed libraries together to solve the cyclic dependence
between libc, libc_nomalloc and libgcc. When building with upcoming
arm-linux-androideabi toolchain, Symbol raise is needed by libgcc.a
and defined by libc.a or libc_nomalloc.a.which.

This patch groups libgc.a, libc_nomalloc.a and libgcc.a together, which is
a minimal group to solve this problem.

Change-Id: I27ed78c495dc53c1db7b302da8704f5e478ad893
1a08100fa9d92c25de32ba4d13fd3958bbcab894 13-Jul-2010 Ying Wang <wangying@google.com> Support to build native libraries with prebuilt NDK

Bug: http://b/issue?id=2811253
Change-Id: Iabd4ab8b3d7236dffe89f1939e1142e882944026
45ac4341515f7ff4d483cfb8e2fba8d3c2cb1f6e 24-Jun-2010 Bruce Beare <brucex.j.beare@intel.com> Refactor Stripper. Allow a stripper other than SOSLIM to be specified

Change-Id: I61137f5bb123dc5f610af9928ed3debdf85ba74d
Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
baff089c37b6ad5e317ffb1dc1f08905e873ae8a 29-Jun-2010 Doug Kwan <dougkwan@google.com> Enable ICF link-time optimization.

Change-Id: I49af3366262bebe12dacfebe99ec742b79bf9d84
438f5f75ec650dee5918e1976fedf2ed871dcd04 19-Jun-2010 David 'Digit' Turner <digit@google.com> Enable shared libraries to use crtbegin_so.S and crtend_so.S

This is necessary to ensure that dlclose() will properly call C++
destructors for the static objects within the shared library.

Change-Id: Ieb056042f9cda7ab120eb770b21f365cd6d64a66
ada132a80ba7edde00ac71727a205d55578e3f47 17-Jun-2010 Jing Yu <jingyu@google.com> Switch toolchain from gcc-4.4.0 to gcc-4.4.3

gcc-4.4.3 toolchain is based on fsf GCC-4.4.3 with numerous patches.
It reduces 3.65% code size than the prebuilt gcc-4.4.0 toolchain,
and improves 3.4% performance on Android benchmarks.

The toolchain uses gold as default linker. With gold, the toolchain
further reduces 1MB system image.

Change-Id: I55eb4df185f2932e71498fcc28428e4d1b175393
3e4677856f0e16a732cecc15cafa7efde1f21241 17-Jun-2010 David 'Digit' Turner <digit@google.com> Remove irritating warnings about 'va_list' mangling when building C++ sources.

Change-Id: I6305e93515e57462e7c57af0cc41a659e4190696
d868cad8284730bd902a354a984dc57c870802fc 14-May-2010 Nick Kralevich <nnk@google.com> Add -Werror=format-security

Security hardening: don't allow code to compile which
uses format strings in an inappropriate way. Make format
string compiler warnings into errors.

Change-Id: I1461dad589a2416420fd84ccf765983e859eea8a
2915cc3e323a9bf86e1a20b201ceb4e9529bc5a2 05-May-2010 Nick Kralevich <nnk@google.com> Enable NX protections

Add -Wa,--noexecstack and -Wl,-z,noexecstack as default
flags when compiling applications. This enables NX
protections, which prevent code from executing on the
stack or heap. NX protections can block a large number
of buffer overflow attacks, and is an important security
feature.

Change-Id: Iad4bab9f8664584ba6ce832a5318d07680d7a908
387e4d0601fad468f51cba8286522674914e01cb 26-Apr-2010 Nick Kralevich <nnk@google.com> LOCAL_LDFLAGS should come after TARGET_GLOBAL_LDFLAGS

A package can define a LOCAL_LDFLAGS. If a LOCAL_LDFLAGS
exists, it should come after the global LDFLAGS, to allow
the local flags to override the global flags.

Change-Id: I6e44c17949c1f11c808d0ed3f327d63fb51a1468
9b4a81237be29b0aae50d1e370b63a07ea2b88b9 23-Feb-2010 Jean-Baptiste Queru <jbq@google.com> Get rid of $(combo_target)

The only OS-ARCH combo that would have benefited from it
is linux-x86, but it explicitly used separate configurations
for the HOST_ and TARGET_ side of things.

This makes is clear which files are related to the HOST_
configuration and which ones are related to the TARGET_
configuration, and expands $(combo_target) to the only
possible/reasonable value that it could have had in every
file.

This also cleans up the simulator, by moving it in a single
place in TARGET_linux_x86 (since the only part that's special
is to use HOST_ settings even when building TARGET_ modules).

Change-Id: I2420eeb8cfe539f5807ec99cb3177ffb9f2476d5