Commit graph

118 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
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
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
Colin Cross
c3256c770d 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
2014-01-24 13:41:00 -08:00
Ying Wang
6ef6519170 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
2014-01-24 13:35:09 -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
Elliott Hughes
dddb566eba Remove obsolete CUSTOM_KERNEL_HEADERS.
Change-Id: Id260dd351b90f065eee56e231d4c341b18c1b27f
2014-01-10 16:35:08 -08:00
Christopher Ferris
9824ce4e1d Re-enable uapi kernel headers for arm.
Bug: 11559337
Change-Id: Ib914e5f22b10d5a74edc357d42b0dcb223185ab4
2013-12-16 13:58:39 -08:00
Elliott Hughes
9696acae02 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
2013-11-25 12:06:25 -08:00
The Android Open Source Project
b9041a45b1 Merge commit 'c73341006286c391ae4d268a77f5e008045d5308' into HEAD
Change-Id: I4bf7d32d65e19dfa1f0533fdd3b2295c50b13005
2013-11-22 11:06:11 -08:00
Ben Cheng
818d7d04f5 Switch AOSP ARM build to use GCC 4.8.
Change-Id: I65051773153ad5bc2c093cd1313acd212eb427b1
2013-11-14 14:05:29 -08:00
Ben Cheng
e3b1fc39f9 am db4113fd: am d58df2de: Merge "Re-tighten default compiler options."
* commit 'db4113fdcce77872cc4657d74ac4136b356de928':
  Re-tighten default compiler options.
2013-08-28 11:32:25 -07:00
Ben Cheng
85ccf735e2 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 1cea0755f4)

Change-Id: Ifa221709b1351a9268c06872e2b667138995c3da
2013-08-28 11:17:43 -07: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
Ben Cheng
aac3f81657 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 ccd8e6082b)
2013-08-13 14:52:31 -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
Ying Wang
a1c0206c31 am 0eb35626: Add extra libgcc.a only for unbundled build.
* commit '0eb35626da3e16d8db7756913433ee37f7ec2f49':
  Add extra libgcc.a only for unbundled build.
2013-05-06 11:10:54 -07:00
Ying Wang
0eb35626da 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
2013-05-03 14:38:36 -07:00
Nick Kralevich
1d7bebca7e am 835816ae: Merge "arm: upgrade to _FORTIFY_SOURCE=2"
* commit '835816ae9eb9de2ae7b75e2318d5eba596f1275c':
  arm: upgrade to _FORTIFY_SOURCE=2
2013-04-25 21:22:26 -07:00
Nick Kralevich
316f720b91 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
2013-04-25 16:52:02 -07:00
Ben Cheng
6c7bc550ad Link libgcc.a before shared libraries (especially libc.so).
[cherry-picked from internal master]

Change-Id: I53d19754d0d40e9ca2f3d043001cc77e39e5d795
2013-03-18 14:00:44 -07:00
Ben Cheng
ea871a0649 Link libgcc.a before shared libraries (especially libc.so).
BUG: 8247455
Change-Id: Ia8816536ca95a7084e80c7f425f81658afea9609
2013-03-14 13:39:29 -07:00
Elliott Hughes
b2bbff7cba am ea852f6e: am f6b670b7: Merge "Remove more always-true ARCH_ARM_HAVE_ flags."
# Via Android Git Automerger (1) and others
* commit 'ea852f6ed3e9f251eaef4f041fbc0b09229ac924':
  Remove more always-true ARCH_ARM_HAVE_ flags.
2013-02-14 17:31:40 -08:00
Elliott Hughes
03d2aa4dd0 Remove more always-true ARCH_ARM_HAVE_ flags.
All the remaining flags appear to be actually used.

Change-Id: I0e3d84915487eda4f0e97809fc36624fef5f1848
2013-02-14 12:04:48 -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
Ben Cheng
9c68f06a54 Merge commit 'ec4caba7' into manualmerge
Conflicts:
	CleanSpec.mk

Change-Id: Idd8f8f4a896b47bd6275daeb71a24a317da4c98a
2012-12-13 11:03:58 -08:00
Ben Cheng
ec4caba79c 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
2012-12-13 10:43:55 -08:00
Ben Cheng
02d29216c9 am b3a68f6e: am 62f1d86e: Merge "Define TARGET_GCC_VERSION in target specific make files."
* commit 'b3a68f6e002cdbc946d08a76656067d63542a98a':
  Define TARGET_GCC_VERSION in target specific make files.
2012-12-11 16:53:05 -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
334423b749 am d125adca: am ef9744f7: Merge "Remove manual WITH_JIT setting from build/."
* commit 'd125adca42283777f08abae3171623048fa94b8a':
  Remove manual WITH_JIT setting from build/.
2012-11-07 18:36:33 -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
a5b28e2d92 am 267b07b2: am 7176e801: Merge "Add TARGET_GCC_VERSION"
* commit '267b07b2aafede64d212402c3554fc2888821c98':
  Add TARGET_GCC_VERSION
2012-10-23 17:29:45 -07: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
Nick Kralevich
077007e872 arm: turn on -Wl,--fatal-warnings
Third time's the charm.  :-)

In b238210c01, 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 942167dab8.

Change-Id: I578701692ead7e7cd60d73d2070a5bed366e2c6c
2012-10-19 08:40:56 -07:00
Nick Kralevich
942167dab8 Revert "arm: turn on -Wl,--fatal-warnings"
This reverts commit 3ab011bccd.
2012-10-18 14:03:49 -07:00
Nick Kralevich
3ab011bccd arm: turn on -Wl,--fatal-warnings
In b238210c01, 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 4dc781657b.

Change-Id: I81b96477f1c11069637f28cfd8fb98d42b39be5e
2012-10-18 12:03:30 -07:00
Nick Kralevich
4dc781657b Revert "arm: turn on -Wl,--fatal-warnings"
This reverts commit edfee7250f.
2012-10-16 13:51:02 -07:00
Nick Kralevich
edfee7250f arm: turn on -Wl,--fatal-warnings
In b238210c01, 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
2012-10-15 11:22:31 -07:00