Commit graph

28 commits

Author SHA1 Message Date
Stephen Hines
a8b65126ca Merge "Add -shared to clang LDFLAGS." 2014-05-30 22:59:48 +00:00
Nick Kralevich
45545761d2 arm64: restore relro/now
The bug which required this option has been fixed.

Bug: 11434996
Change-Id: I7ab7e2e8ba7b993281902832d01b3ee3ba9e06ef
2014-05-30 15:46:40 -07: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
Ben Cheng
d033121431 Use aarch64-linux-android-4.9 for arm64 build (attempt #4)
GCC: 4.9 (which supports -fstack-protector)
Binutils: 2.24 (which supports gc-sections)
GDB: 7.7

NDK libraries are still picked up from prebuilts/ndk/*/4.8/*

GCC has been patched to disable codegen for calling
__cxa_throw_bad_array_new_length.

Source code has been sync'ed against the 2014-05-14 snapshot which
contains many important fixes (devirtualization, codegen, ...).

Change-Id: I43229360ad0132193d5208cb0d1acba55084853c
2014-05-19 16:22:21 -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
e76fee59fc Revert "Use aarch64-linux-android-4.9 for arm64 build (attempt #3)"
This reverts commit 084a7f8387.

GCC 4.9 still has stability issues (b/14160872)

Change-Id: I4d40829dbbfac0e7b6cd7eaf9924744bc5714271
2014-04-18 18:34:35 +00:00
Ben Cheng
084a7f8387 Use aarch64-linux-android-4.9 for arm64 build (attempt #3)
GCC: 4.9 (which supports -fstack-protector)
Binutils: 2.24 (which supports gc-sections)
GDB: 7.7

NDK libraries are still picked up from prebuilts/ndk/*/4.8/*
GCC has been patched to disable codegen for calling
__cxa_throw_bad_array_new_length.

Change-Id: Ie0bf38357c0cf3d265d8b5dd3c2b8a8fd83b1de1
2014-04-16 12:18:14 -07:00
Andrew Hsieh
50536c20af Add -Wl,-maarch64linux
The "-maarch64linux" switch is needed before aarch64-*4.8 is rebuilt with
backport of upstream patch, see https://android-review.googlesource.com/#/c/91099/

The existing ld.bfd is fine because it's configured to support
aarch64linux only.  ld.mcld (see https://android-review.googlesource.com/#/c/91047)
needs explicit emulation switch because it supports multiple targets

Change-Id: Idc1a491c5722ea9e26db917b667b1000bccc1f60
2014-04-15 11:54:06 -07:00
Ben Cheng
38fef38c40 Revert "Use aarch64-linux-android-4.9 for arm64 build (attempt #2)"
This reverts commit 1ae9b213eb.
Sigh... new warnings found by 4.9 break checkbuild.

Change-Id: I46ad622fa9c8ac4fb1e15e29bb400634abc5914c
2014-04-11 23:36:25 +00:00
Ben Cheng
1ae9b213eb Use aarch64-linux-android-4.9 for arm64 build (attempt #2)
GCC: 4.9 (which supports -fstack-protector)
Binutils: 2.24 (which supports gc-sections)
GDB: 7.7

NDK libraries are still picked up from prebuilts/ndk/*/4.8/*
GCC has been patched to disable codegen for calling
 __cxa_throw_bad_array_new_length.

Change-Id: Ie647fc4c6b227d6bee792f04d5c2f02eb0099559
2014-04-11 12:22:56 -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
Ben Cheng
81892e29ff Revert "Use aarch64-linux-android-4.9 for arm64 build."
This reverts commit 6154690d86.

Change-Id: I7427ad6ca1f74ad632229348bac31ebdbc0590ad
2014-04-10 17:14:01 +00:00
Ben Cheng
6154690d86 Use aarch64-linux-android-4.9 for arm64 build.
Change-Id: I63e1b54947326fb5da07af7691d4729bcbf99ac1
GCC: 4.9 (which supports -fstack-protector)
Binutils: 2.24 (which supports gc-sections)
GDB: 7.7
2014-04-09 15:58:08 -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
ed56902c29 Remove arm64 clang build warning
Now we have enabled arm64 clang.
This change remvoed arm64 clang build warning and cleaned the
arm64 unknow c flags.

Change-Id: Ia583a78c6d364e603ff09df423aa34a6e03d0b9b
2014-03-18 15:58:13 -07:00
Tim Murray
b5f333bbef Work in progress to enable build system support for Clang.
Change-Id: I278b48bcd976afcbde8d86261da9b9b9efc9002c
2014-03-14 00:39:03 -07:00
Ying Wang
ba8b377d89 Split WITHOUT_CLANG to WITHOUT_HOST_CLANG and WITHOUT_TARGET_CLANG
Still keep WITHOUT_CLANG, which enables both.

Bug: 13402154
Change-Id: I32cb668223997719875751bf3d64f592d6086830
2014-03-10 18:59:12 -07:00
Ying Wang
9fb3526648 Make -rpath-link work with multilib.
Change-Id: If69ea6ed6cdbb657ed4005f8217d653e29626783
2014-02-21 16:20:20 -08:00
Ben Cheng
859c826ffc Refreshed gcc predefines __ANDROID__
Change-Id: Id76f5a7490fba8190329e5ce3c4b138976a034ce
2014-02-07 13:16:18 -08:00
Elliott Hughes
18042e1960 Turn 64-bit-related warnings into errors on 64-bit builds.
I don't think we can realistically turn this on for 32-bit builds any
time soon.

Also, fix the arm64 stack-protector hack.

Change-Id: Ie1e7c875bbc06fb21bb372b8ca99879a23ef53d4
2014-02-05 17:40:02 -08:00
Colin Cross
8f47fc379e Add support for TARGET_GLOBAL_UNSUPPORTED_CFLAGS
To ease the transition between toolchains, allow a target to specify
a list of cflags that the toolchain does not support.  These will be
filtered out of the cflags provided by the module.

Add TARGET_GLOBAL_UNSUPPORTED_CFLAGS := -fstack-protector for the
aarch64 toolchain, it does not yet suport -fstack-protector.

Change-Id: I168d0c6f131326fad305ec86fad46e6a3e03295a
2014-01-27 18:21:12 -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
Colin Cross
4f0eb7d50c build: rename aarch64 target to arm64
Rename aarch64 build targets to arm64.  The gcc toolchain is still
aarch64.

Change-Id: Ia92d8a50824e5329cf00fd6f4f92eae112b7f3a3
2014-01-23 22:39:38 -08:00
Renamed from core/combo/TARGET_linux-aarch64.mk (Browse further)