Commit graph

49 commits

Author SHA1 Message Date
Stephen Hines
a8b65126ca Merge "Add -shared to clang LDFLAGS." 2014-05-30 22:59:48 +00:00
Tim Murray
0f9276d4ba Add -shared to clang LDFLAGS.
TOT clang doesn't do the right thing with regards to -pie without this.

Change-Id: Ic14cfb25d96359eb18899c09ebaf1d311e937d01
2014-05-29 17:54:07 -07:00
Andrew Hsieh
4c952d72b7 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
2014-05-29 11:40:46 -07:00
Ying Wang
d90de32951 Exclude libstdc++ and libgcc if libc++ is requested.
Bug: 15174002
Change-Id: I24fe428c3520f76cd61f0660b59ba18a1f2d2dad
2014-05-23 16:42:37 -07:00
Andrew Hsieh
48f239c94f 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
2014-05-09 22:12:49 +08:00
Ying Wang
de36cd72e8 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
2014-05-07 11:33:19 -07:00
Elliott Hughes
1acd8b0552 Leave 'linux' defined on mips/mips64, like arm.
Change-Id: Idf1e781c34d45d1e20b7e5542d79201ae93668fe
2014-04-23 23:24:36 -07:00
Ben Cheng
4de6fa4069 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
2014-04-10 22:46:26 -07:00
Ying Wang
ce1c596e15 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
2014-03-28 17:25:34 -07:00
Christopher Ferris
a6e2f9322c 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
2014-03-18 17:34:41 -07:00
Ying Wang
9fb3526648 Make -rpath-link work with multilib.
Change-Id: If69ea6ed6cdbb657ed4005f8217d653e29626783
2014-02-21 16:20:20 -08:00
Elliott Hughes
369b3326f3 Add missing $(combo_2nd_arch_prefix)s to mips.
Change-Id: I91a5f2d92cc964cbaeb1c07f27eb56ea1a0d53cc
2014-02-19 20:29:25 -08:00
Elliott Hughes
171e940c7a Fix KERNEL_HEADERS_ARCH for mips and x86.
arm and arm64 have distinct headers, but mips and mip64, and x86 and x86_64
use headers that work for both widths. So where arm/arm64 need to handle the
second architecture case specially, all we need to do for the others is
hard-code the name. (x86_64.mk already hard-codes x86; we need to change
x86.mk for the case where we're building the 32-bit binaries for a mixed
system. mips64.mk doesn't exist yet, but when it does, it'll hard-code
just plain "mips" too.)

Change-Id: Ia6b9f77b4eb2c78729b454045875c409e0ea8197
2014-01-28 13:10:19 -08:00
Elliott Hughes
2f8dcdd961 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
2014-01-27 15:45:17 -08:00
Ying Wang
1d274d2686 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
2014-01-24 13:34:26 -08:00
Chris Dearman
13eb1eb53d [MIPS] Reenable linker fatal-warnings
Change-Id: I4efbb7d0b1026b49a9b8bf968dd4752fca8a543b
2014-01-15 19:00:37 +00:00
Elliott Hughes
dddb566eba Remove obsolete CUSTOM_KERNEL_HEADERS.
Change-Id: Id260dd351b90f065eee56e231d4c341b18c1b27f
2014-01-10 16:35:08 -08:00
Elliott Hughes
b88bdebcb9 Switch MIPS over to uapi-only.
Bug: 11559337
Change-Id: I04b93d0d681ddf75573cdeca2d25ffa44862a35f
2013-11-25 14:01:10 -08:00
The Android Open Source Project
b9041a45b1 Merge commit 'c73341006286c391ae4d268a77f5e008045d5308' into HEAD
Change-Id: I4bf7d32d65e19dfa1f0533fdd3b2295c50b13005
2013-11-22 11:06:11 -08:00
Elliott Hughes
66ef53d83b Switch mips to the uapi kernel headers.
Bug: 11559337
Change-Id: Ic37b284398c049011f98651de84cef760566ebde
2013-11-20 12:55:09 -08:00
Andrew Hsieh
8baaca5f97 Switch AOSP X86/MIPS compiler to gcc4.8
Change-Id: Ifeee2c7d696c8a8e96e52c6ca51434260bdae5f8
2013-11-15 10:25:58 +08:00
Ying Wang
0634a437a3 am 3208b615: am fc8b6338: resolved conflicts for merge of d65a7da3 to jb-mr2-dev-plus-aosp
* commit '3208b615c5cde2b682c3bbbcd2bb064b14b57489':
  No need to filter out AndroidConfig.h for unbundled build
2013-08-15 14:42:57 -07:00
Ying Wang
fc8b633851 resolved conflicts for merge of d65a7da3 to jb-mr2-dev-plus-aosp
Change-Id: I14c4ddf5f02c8dec86f45bedf679bcebff1448dc
2013-08-15 12:02:30 -07:00
Ying Wang
f4723fa49b No need to filter out AndroidConfig.h for unbundled build
for now we have all AndroidConfig.hs in the build project.

Change-Id: Id713fecba1378fad81688f5937f61c779b618ac2
2013-08-15 11:01:10 -07:00
synergydev
cfdb24f1cb 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
2013-08-08 05:31:12 -07:00
Nick Kralevich
3d660f2a7c am 042723c0: Merge "x86/mips: enable _FORTIFY_SOURCE=2"
* commit '042723c0151980fee315678736751f7385977d90':
  x86/mips: enable _FORTIFY_SOURCE=2
2013-04-29 14:12:50 -07:00
Nick Kralevich
fb45baa7e7 x86/mips: enable _FORTIFY_SOURCE=2
Enable _FORTIFY_SOURCE=2 for x86 and MIPS.

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

The ARM change was made in 316f720b91

Change-Id: Iafe90beadf9b6a41ea294b7107cf4f18141acf3a
2013-04-29 12:41:53 -07:00
Andrew Hsieh
79a6b76ec8 am e874f3ab: am 55c06f75: Merge "Duplicate libgcc.a in front of *so"
* commit 'e874f3ab7c3f70582f877e762c13c1943ed0e398':
  Duplicate libgcc.a in front of *so
2013-03-19 11:17:07 -07:00
Andrew Hsieh
8725b941b0 Duplicate libgcc.a in front of *so
Also see 6c7bc550ad

Change-Id: Iade6cd6b40cd4840a148098e1d8fc7a0c97e2f66
2013-03-19 07:51:52 -07:00
Ying Wang
00b2811e66 resolved conflicts for merge of 40ab92d0 to master
Change-Id: I400c1655c57237687a21a017b9c2065d166e3097
2013-02-22 11:02:03 -08:00
Chris Dearman
6cc0c334fc [MIPS] Update build rules
Add  -D_FORTIFY_SOURCE=1 to the default cflags
Update build rule for executable with PRIVATE_ALL_WHOLE_STATIC_LIBRARIES
Use single dash version of -print-whatever
compile everything with relro / bind_now
Enable NX protections

Some other cleanups to reduce differences between ARM and MIPS config files

Change-Id: I30b4de449e6353b581ef7f9437a3bb9be53d5bbf
Signed-off-by: Chris Dearman <chris@mips.com>
2013-02-19 17:04:57 -08:00
Ying Wang
b6457c223b 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
2013-01-30 10:33:27 -08:00
Andrew Hsieh
098a5968fa Switch to GCC 4.7 for X86 and MIPS
Change-Id: I1c2021a15f53e064baf69084894c114289ef7c54
2012-12-21 09:23:05 +08:00
Ben Cheng
914f7fd938 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
2012-12-12 21:56:58 -08:00
Ben Cheng
054ffd2e7c Define TARGET_GCC_VERSION in target specific make files.
So that GCC refresh can be performed in a target specific way.

Change-Id: I867e8b8fd671bef8c5af300e657a6da4fface032
2012-12-11 14:03:18 -08:00
Elliott Hughes
d125adca42 am ef9744f7: Merge "Remove manual WITH_JIT setting from build/."
* commit 'ef9744f7ee4fd2315f41c58ba48906d9d79363dd':
  Remove manual WITH_JIT setting from build/.
2012-11-07 18:31:35 -08:00
Elliott Hughes
07a6db8733 Remove manual WITH_JIT setting from build/.
This is now done automatically by dalvik/, since
patch 272a54f8553e13b87bf819542ddc6701fc1232cc.

Change-Id: I57709538f20188417c014630442e897401d7ace0
2012-11-06 16:41:52 -08:00
Andrew Hsieh
267b07b2aa am 7176e801: Merge "Add TARGET_GCC_VERSION"
* commit '7176e8013bb2e563c3e3e56af4c04c50de3a7f37':
  Add TARGET_GCC_VERSION
2012-10-23 17:15:01 -07:00
Andrew Hsieh
06b63baedc 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
2012-10-23 12:06:01 +08:00
Ying Wang
15f116b2bb am 91fd1231: Support to build executables against the NDK
* commit '91fd1231c3254bc9d0642e5a646b5657bdaedffa':
  Support to build executables against the NDK
2012-10-08 14:21:37 -07:00
Ying Wang
91fd1231c3 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
2012-10-08 14:12:41 -07:00
Nick Kralevich
23025ecdc0 am f3b02739: am 7653519f: Merge "[MIPS] Makes a build system use PIE flag"
* commit 'f3b02739a7abba7c8f4884d49553f8a9f3fcfaf8':
  [MIPS] Makes a build system use PIE flag
2012-10-04 17:14:17 -07:00
Miroslav Ignjatovic
f1e4df7265 [MIPS] Makes a build system use PIE flag
Change-Id: I07be4e8ae559dca615b0c59a71d7363adab4f49b
2012-09-27 13:59:15 -07:00
Ying Wang
5bdf305bbe 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
2012-09-20 10:33:20 -07:00
Jean-Baptiste Queru
d4ace13802 am 4dc6ed96: am 9eb87b8d: Merge "Add pattern to check for GCC 4.6"
* commit '4dc6ed96a0612d4693cca5ed5674873754bcb37e':
  Add pattern to check for GCC 4.6
2012-08-28 13:41:09 -07:00
Andrew Hsieh
26c7805781 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
2012-08-28 10:49:05 +08:00
Ying Wang
da4bf42514 Don't include system/core/include/arch/<arch>/Android.mk for apps-only build.
Bug: 6994483
Change-Id: I76c4d96264cf94a79d59fdeb52bb37c07a9458dd
2012-08-16 16:45:01 -07:00
Keun young Park
a8811fda4f fix MIPS build
- crtxx.o built under TARGET_OUT_INTERMEDIATE_LIBRARIES,
  not under TARGET_OUT_STATIC_LIBRARIES

Change-Id: Ife05206bd66f691853100bbf17e08a13c287d073
2012-08-15 13:42:37 -07:00
Raghu Gandham
06afc1c5ab Support for MIPS Build targets.
Change-Id: I14c27305298ce36d5c100abf25489275c2269c5f
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
2012-08-01 11:18:25 -07:00