Commit graph

351 commits

Author SHA1 Message Date
Andrew Hsieh
f116e9bc84 Add -fuse-ld=bfd to x86 target
Add -fuse-ld=bfd because ld.gold doesn't support "--copy-dt-needed-entries".

Change-Id: I4e78967a076b3d093dd55366f7a54f0c9f9a45d1
2012-07-25 11:06:28 -07:00
Andrew Hsieh
bae121afcd Add -fuse-ld=bfd to x86 target
Add -fuse-ld=bfd because ld.gold doesn't support "--copy-dt-needed-entries".

Change-Id: Ie6fa0a2ddfc57b650552c8cf0891f738a5be0dda
2012-07-25 11:02:52 -07:00
Ying Wang
dfb5818027 am d512fda4: am e42ed0ba: Merge "Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk"
* commit 'd512fda4ae7cc56cc9b83fcb6e7a9e0d0f02c259':
  Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk
2012-06-29 20:22:20 -07:00
Ying Wang
d512fda4ae am e42ed0ba: Merge "Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk"
* commit 'e42ed0ba1571f20866609710ba7c73fd138c0405':
  Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk
2012-06-29 20:19:50 -07:00
Ying Wang
478ba5e3f0 Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk
Bug: 6754632
So the warning won't show up when you run lunch.
Now the warning only shows when you do a clean build.

Change-Id: I7876da783f059d390f0072df37d3ab0291589eb7
2012-06-28 16:02:19 -07:00
Jean-Baptiste Queru
41a3fb3707 am 6e207824: resolved conflicts for merge of 572d0d7d to jb-dev-plus-aosp
* commit '6e207824af267eea8777949ccf6d0584accd55a0':
  x86: Clean up atom vs/ non-atom compiler flags, enable SSSE3
2012-06-13 07:44:31 -07:00
Jean-Baptiste Queru
6e207824af resolved conflicts for merge of 572d0d7d to jb-dev-plus-aosp
Change-Id: I6c750adcf06457bf8a3b47423c990be6e9d23bbb
2012-06-13 07:42:04 -07:00
Jean-Baptiste Queru
3f8ff030e0 Merge "x86: Clean up atom vs/ non-atom compiler flags, enable SSSE3" 2012-06-13 06:25:00 -07:00
Jean-Baptiste Queru
2f65e81974 am 06b1a47f: am d3d78a30: am a11ad6c2: Merge "gcc 4.6 requires --copy-dt-needed-entries"
* commit '06b1a47fe19699e8cb94fd6a007f82f3b41119fe':
  gcc 4.6 requires --copy-dt-needed-entries
2012-06-12 15:56:29 -07:00
Jean-Baptiste Queru
06b1a47fe1 am d3d78a30: am a11ad6c2: Merge "gcc 4.6 requires --copy-dt-needed-entries"
* commit 'd3d78a30a4f8dd40fa055577ea2708ab34606cec':
  gcc 4.6 requires --copy-dt-needed-entries
2012-06-12 15:52:54 -07:00
Jean-Baptiste Queru
a11ad6c2b3 Merge "gcc 4.6 requires --copy-dt-needed-entries" 2012-06-12 15:24:17 -07:00
Ying Wang
e556005331 resolved conflicts for merge of 5c0ee702 to master
Change-Id: I6bdcc87482c45988d410a4c4d0abc43a1416277e
2012-06-08 09:37:54 -07:00
Ying Wang
5c0ee702d6 am 79d39a30: am 874563f9: Merge "Fix generic build on Max OS X 10.7 Lion"
* commit '79d39a303e036dc70eccf2e2e7489fa0bbfd3a4b':
  Fix generic build on Max OS X 10.7 Lion
2012-06-08 09:27:08 -07:00
SangWook Han
02eb37c267 Fix generic build on Max OS X 10.7 Lion
Recover variable build_mac_version which is removed on
    commit 644dc16 and added on commit 9ce06f1.

    Without this, ranlib libSDL.a is executed on Lion which
    causes build fail of emulator-arm.

Change-Id: I06144a288921f8f968ef457999398c1b9152d4aa
2012-06-08 14:55:05 +09:00
Ying Wang
10f775379d Tweak cflags for building with SDK 10.6.
Change-Id: I4db9949577591ef6756812769f04cfaddd876faf
2012-06-07 17:10:53 -07:00
Ying Wang
fcc2a604af am f1e424a6: am 3da13457: am 4b030617: Merge "XCode 4.3+ compatibility check-in"
* commit 'f1e424a63658eb15ba61ca2eb8f0df38733188fe':
  XCode 4.3+ compatibility check-in
2012-06-07 12:03:46 -07:00
Ying Wang
f1e424a636 am 3da13457: am 4b030617: Merge "XCode 4.3+ compatibility check-in"
* commit '3da13457cfa46cf7d46b57c00f387c7c310b2dba':
  XCode 4.3+ compatibility check-in
2012-06-07 12:02:06 -07:00
Al Sutton
51f9bb02da XCode 4.3+ compatibility check-in
XCode 4.3 and later use a different location for SDKs. This check in
ensures the build checks for the new location as well as the old one.

Change-Id: I97884e5009f229f8b42e57a8feeb702b3a40a241
Signed-off-by: Al Sutton <al@funkyandroid.com>
2012-06-07 19:10:13 +01:00
Nick Kralevich
a46c480e43 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
2012-06-07 08:55:06 -07:00
Ying Wang
130ae6adcb resolved conflicts for merge of 9f4d00b9 to master
Change-Id: I1818896ae714aa54ad980bfbf7648652369497e5
2012-06-05 15:44:21 -07:00
Ying Wang
9f4d00b94b am e534e2eb: am 47450542: Merge "Use Mac OS X SDK 10.6."
* commit 'e534e2eb2b5e79facf24c31eb2f60b8a0ee1f5b7':
  Use Mac OS X SDK 10.6.
2012-06-05 15:25:39 -07:00
Ying Wang
644dc164cc Use Mac OS X SDK 10.6.
Change-Id: I8ca16db2fb93d350829e14f4339e7ece75a2fb54
2012-06-05 14:23:22 -07:00
Ying Wang
abf72cf3f4 Use Mac OS X SDK 10.6.
Change-Id: I8ca16db2fb93d350829e14f4339e7ece75a2fb54
2012-05-30 18:16:10 -07:00
Ying Wang
9d50defb8b Revert "Use Mac OS X SDK 10.6."
This reverts commit 4c1b310b9b
2012-05-25 18:55:52 -07:00
Ying Wang
4c1b310b9b Use Mac OS X SDK 10.6.
Change-Id: Ie36914ab1763c5606111f7501c97ed97517e7187
2012-05-25 15:43:38 -07:00
Bruce Beare
c3192b3164 x86: Clean up atom vs/ non-atom compiler flags, enable SSSE3
Change-Id: I0576514621affefea86a14d419f428761a60e067
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-05-25 09:59:25 -07:00
Bruce Beare
52b63178d9 gcc 4.6 requires --copy-dt-needed-entries
Change-Id: Icc62106e0f2e96f4cd871bb4b3c46c7ca83cabec
Author: Bruce Beare <bruce.j.beare@intel.com>
Reviewed-by: Lu, Hongjiu <hongjiu.lu@intel.com>
2012-05-25 09:27:23 -07:00
Elliott Hughes
f440828fa0 Merge "Compile Mac OS binaries with unwind tables for libcorkscrew." 2012-05-24 15:21:44 -07:00
Elliott Hughes
468d6a584f Compile Mac OS binaries with unwind tables for libcorkscrew.
Change-Id: I9755d8d39913830180da2ce32bcdd357309ff792
2012-05-23 17:32:32 -07:00
Andrew Hsieh
0fc900754d am 6dfe3e11: Merge "Set generic_x86/BoardConfig.mk TARGET_ARCH_VARIANT to x86" into jb-dev-plus-aosp
* commit '6dfe3e11a56707ce288a4dec8d3022ff61ef023f':
  Set generic_x86/BoardConfig.mk TARGET_ARCH_VARIANT to x86
2012-05-21 18:53:49 -07:00
Andrew Hsieh
6dfe3e11a5 Merge "Set generic_x86/BoardConfig.mk TARGET_ARCH_VARIANT to x86" into jb-dev-plus-aosp 2012-05-21 18:51:52 -07:00
Jean-Baptiste Queru
fed04c4c72 am 99e1613f: am 72b329e5: am 3c5191c6: Merge "Update build rule for executable with PRIVATE_ALL_WHOLE_STATIC_LIBRARIES"
* commit '99e1613fd5d3773387b52910d7daa86535f42e25':
  Update build rule for executable with PRIVATE_ALL_WHOLE_STATIC_LIBRARIES
2012-05-21 14:30:47 -07:00
Andrew Hsieh
8e376fb633 am 112a6747: Add -mno-movbe to disable "movbe" instruction from code-gen
* commit '112a674798c58052ddce94418e34f3e5a084ed1a':
  Add -mno-movbe to disable "movbe" instruction from code-gen
2012-05-21 12:44:38 -07:00
Jean-Baptiste Queru
99e1613fd5 am 72b329e5: am 3c5191c6: Merge "Update build rule for executable with PRIVATE_ALL_WHOLE_STATIC_LIBRARIES"
* commit '72b329e5042b8fc15cbcbea3d382a072f79eb961':
  Update build rule for executable with PRIVATE_ALL_WHOLE_STATIC_LIBRARIES
2012-05-21 08:10:26 -07:00
Jean-Baptiste Queru
3c5191c61a Merge "Update build rule for executable with PRIVATE_ALL_WHOLE_STATIC_LIBRARIES" 2012-05-21 07:30:17 -07:00
Andrew Hsieh
b968c85edf Set generic_x86/BoardConfig.mk TARGET_ARCH_VARIANT to x86
Change TARGET_ARCH_VARIANT from x86-atom to x86, for the reason
that atom-specific instruciton like "movbe" isn't "generic" to
x86 Android devices and x86 host running emulator-x86, which may
crash non-atom host in VT because "movbe" isn't supported natively.

Also revert previous fix in TARGET_linux-x86.mk which conservatively
disable "movbe" across the board

Change-Id: Ief93a3585566ffae558fcdc29741e6213a048d7d
2012-05-21 14:27:59 +08:00
Andrew Hsieh
112a674798 Add -mno-movbe to disable "movbe" instruction from code-gen
Intruction "movbe" (move data after swapping bytes) is only available in
Intel atom.  Disable it for more general x86 devices and x86 hosts which
run emulator-x86.  Although emulator-x86 can support "movbe", most of
the time we want to run emulator-x86 with VT support for speed (with KVM
in Linux, or HAXM in Windows/MacOSX).  The presence of "movbe" can crash
emulator-x86 in VT because non-atom host doesn't have it natively.

Change-Id: I86e037900ddcb8d544f92b8d8464c8627347e560
2012-05-18 15:53:35 +08:00
Jean-Baptiste Queru
dacf9bfe16 am feec98b1: resolved conflicts for merge of 62855a83 to jb-dev-plus-aosp
* commit 'feec98b139d2ca0b0164a5e178e75ce88b8f492f':
  Use i686-linux-android-4.6 for x86 build
2012-05-17 15:34:07 -07:00
Jean-Baptiste Queru
feec98b139 resolved conflicts for merge of 62855a83 to jb-dev-plus-aosp
Change-Id: Ic424ff756396463b98d137f8353d4a230e806a07
2012-05-16 13:18:39 -07:00
Jean-Baptiste Queru
2436ea8a8c Merge "Use i686-linux-android-4.6 for x86 build" 2012-05-16 06:42:55 -07:00
Ying Wang
b1a4e4e89e Delete the misleading var TARGET_OUT_STATIC_LIBRARIES.
Which can be replaced by TARGET_OUT_INTERMEDIATE_LIBRARIES.

Change-Id: I965ff1ebe70fc3113c19e4896277c876dcedb6a5
2012-05-15 16:12:18 -07:00
Nick Kralevich
ee08fe3196 stop using a custom linker script for static executables.
This is causing problems with making the linker relocatable.

Change-Id: I53e37fba52eabd3145130712d6e9bff074aed493
2012-05-15 10:40:35 -07:00
H.J. Lu
402d7f3654 Use i686-linux-android-4.6 for x86 build
Change-Id: Ibbb0a899f147013503d6830bb93050c5ae588539
Author: "H.J. Lu" <hongjiu.lu@intel.com>
2012-05-14 08:22:27 -07:00
Nick Kralevich
0dc038075c am 9d602a70: am ecb1a565: x86: compile everything with relro / bind_now
* commit '9d602a7005683965814823feda5aabcce5a92201':
  x86: compile everything with relro / bind_now
2012-05-10 09:30:54 -07:00
Nick Kralevich
9d602a7005 am ecb1a565: x86: compile everything with relro / bind_now
* commit 'ecb1a565849b40ab7aa45b7fe71e24e29a059376':
  x86: compile everything with relro / bind_now
2012-05-10 09:24:10 -07:00
Nick Kralevich
ecb1a56584 x86: 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

relro support has been enabled for ARM since 233d460f21.
This change enables it for x86.

Change-Id: Ib90704f2fecffcfdc3587607112804faa0e16385
2012-05-09 14:49:04 -07:00
Kito Cheng
61c37e7a4f Update build rule for executable with PRIVATE_ALL_WHOLE_STATIC_LIBRARIES
Change-Id: I9ff53f51dcb57511a24765bdf6a61c000a7ce977

Signed-off-by: Kito Cheng <kito@0xlab.org>
2012-05-09 23:54:45 +08:00
Jean-Baptiste Queru
92fadc6fbf am 269a40d1: am b031afab: am bf3d3287: Merge "Use the same compilation flags on OS X 10.8 as 10.7"
* commit '269a40d140753aee1e579f8179b132ffe3415150':
  Use the same compilation flags on OS X 10.8 as 10.7
2012-05-08 11:32:54 -07:00
Jean-Baptiste Queru
269a40d140 am b031afab: am bf3d3287: Merge "Use the same compilation flags on OS X 10.8 as 10.7"
* commit 'b031afab543d8bf9bb236ff4c297f5ced70f8943':
  Use the same compilation flags on OS X 10.8 as 10.7
2012-05-07 13:59:56 -07:00
Al Sutton
35bb6422bc Use the same compilation flags on OS X 10.8 as 10.7
Added Mountain Lion to the list of versions which don't need ranlib
and don't need the pre-Lion linker flags

Change-Id: I0c785f0c66e324af9a209520c5a5b3c9bf7df0d5
Signed-off-by: Al Sutton <al@funkyandroid.com>
2012-05-07 09:44:28 +01:00
Shih-wei Liao
eaa0f82295 Merge "Members in LOCAL_WHOLE_STATIC_LIBRARIES should be force_loaded." 2012-05-03 15:40:27 -07:00
Shih-wei Liao
b2680757a0 Members in LOCAL_WHOLE_STATIC_LIBRARIES should be force_loaded.
For Mac build, force_load the LOCAL_WHOLE_STATIC_LIBRARIES.

Mac has its custom linker. However, its linking rule for generating
shared libraries doesn’t take the LOCAL_WHOLE_STATIC_LIBRARIES
into consideration.

Change-Id: Ia6858bf6e2ebb334db8f3d0bdc71d7ecc0ef11c1
2012-05-03 15:38:17 -07:00
Jean-Baptiste Queru
e11abdbe57 am 76cc34ca: am 6dfbf024: am 9e4e3b37: Merge "TARGET_linux-arm.mk: use single slash version of -print-whatever"
* commit '76cc34ca0adefac91f90fae478f2c6140e41e088':
  TARGET_linux-arm.mk: use single slash version of -print-whatever
2012-05-02 17:07:09 -07:00
Jean-Baptiste Queru
76cc34ca0a am 6dfbf024: am 9e4e3b37: Merge "TARGET_linux-arm.mk: use single slash version of -print-whatever"
* commit '6dfbf0240b77acaf7d6b650b4c206deb29337e7b':
  TARGET_linux-arm.mk: use single slash version of -print-whatever
2012-05-02 17:05:04 -07:00
Jean-Baptiste Queru
cd742a991e am 9bdc2907: am 8571ee47: am f562adc8: Merge "Force use of compatibility compilers on Apple\'s command line tools"
* commit '9bdc290792f8c5c4e4beb40e6b7f335759b6d6d5':
  Force use of compatibility compilers on Apple's command line tools
2012-05-02 14:21:06 -07:00
Jean-Baptiste Queru
9bdc290792 am 8571ee47: am f562adc8: Merge "Force use of compatibility compilers on Apple\'s command line tools"
* commit '8571ee478ee352827ec37460d23e6e0dbb1e96db':
  Force use of compatibility compilers on Apple's command line tools
2012-05-02 14:18:28 -07:00
Jean-Baptiste Queru
9e4e3b378f Merge "TARGET_linux-arm.mk: use single slash version of -print-whatever" 2012-05-02 13:26:50 -07:00
Al Sutton
0d07c732c7 Force use of compatibility compilers on Apple's command line tools
The cc and c++ compilers included in Apple's command line tools show some
unusual behaviour which causes the build to fail in several projects under
Xcode 4.3

This patch uses the gnu compatibility gcc and g++ compilers on OS X instead
to reduce problems, and generates an error when an llvm based compiler is
detected because they currently do not generate usable emulator executables
due to them not honouring global register variables.

Change-Id: I506c22dad3dcbd41df3c7672802a675d3655e262
Signed-off-by: Al Sutton <al@funkyandroid.com>
2012-05-02 07:11:27 -07:00
Andrew Hsieh
f9613a4f73 Added BUILD_HOST_static to build statically linked executable/shared-lib
Statically linked executable/shared-lib (eg. SDK tools) are useful
in sandboxed environment.

In BUILD_HOST_static zipalign needs -lpthread indirectly:
zipalign->libutils.a->liblog.a->logd_write.c->pthread

Change-Id: I8fa91a937b728ccdf942c4ba199efb1e2e49da3d
2012-04-28 00:53:55 +08:00
Nick Kralevich
233d460f21 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
2012-04-26 09:09:24 -07:00
Jean-Baptiste Queru
4e82d1fa7f On linux, always use the prebuilt host toolchain
Change-Id: I8077c4780e1e3540e5e2133cf0ffa61d474d3acc
2012-04-20 19:04:56 -07:00
Jean-Baptiste Queru
a50ef1c124 Switch to new locations of toolchains
Change-Id: I15a8be11b3d0f1985ffd97dd51a1af18e1ce7b67
2012-04-20 16:15:42 -07:00
Jing Yu
c856e31523 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
2012-04-20 07:53:16 -07:00
Doug Kwan
422a3650d3 Fix build problems with gcc-4.6.x.
Change-Id: If02f18efde4cec39c97bb0e7226b008cd6b85dd4
2012-04-20 07:52:47 -07:00
Nick Kralevich
b3789be766 Revert "ARM: compile everything with relro / bind_now."
This reverts commit 020e4919e8.
2012-04-10 13:13:29 -07:00
Nick Kralevich
020e4919e8 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
2012-04-09 12:04:32 -07:00
Jing Yu
f5172c7564 Switch default gcc toolchain from 4.4.3 to 4.6.
Switch both arm-linux-androideabi toolchainand arm-eabi toolchain.

Change-Id: I7b2771fe684853ab37e3b5b7cfe4146f9f901e02
2012-03-29 20:45:50 -07:00
Andrew Hsieh
2245d17dc8 Point to new linux prebuilt toolchain for SDK build
Change-Id: I21849119b0f3f45f950e9e6d1da0833aff381fb7
2012-03-22 09:55:36 -07:00
Andrew Hsieh
0e63fd37dd Point to new linux prebuilt toolchain for SDK build
Change-Id: I21849119b0f3f45f950e9e6d1da0833aff381fb7
2012-03-13 02:17:35 -07:00
Andrew Hsieh
ed6b815505 BUILD_HOST_64bit=1 to build host tools in 64-bit
By default we build tool in 32-bit.  This flag allow individual tool and its
dependencies to be built in 64-bit (eg. Emulator).  Fixes to resolve 64-bit
porting issues (in other git) will be submitted seperately.

Change-Id: I486cf7ddac727d3c374ed890857d497c3a69e598
2012-02-28 10:24:39 -08:00
Ying Wang
92ca609cd1 Fix bug with the HOST_AR.
Change-Id: I28ab86d3b6e7cbd4391e2640cf8e2be269b03e76
2012-02-23 16:27:43 -08:00
Kenny Root
87f4d5a926 Enable TLS register by default for ARMv7a arch
Everything that is based on ARMv7a should have a cp15 TLS register.
Enable it by default so it's not accidentally missed in newer board
configurations. In fact, this could be enabled for ARMv6 as well, but we
currently don't distinguish between ARMv5 and ARMv6 in the build system.

This can still be disabled by setting it to "false" in the board
configuration, but this shouldn't ever be needed.

Change-Id: Ic2918f32899c8bcfa482f92c98f5a192fa318470
2012-02-21 09:17:18 -08:00
Ying Wang
5dea692715 Use @rpath and @loader_path to avoid absolute path
With "-Wl,-rpath,@loader_path/../lib" the linker embeds
@loader_path/../lib as the target binary's rpath.
Here @loader_path means the path of the binary that initiates the
loading.
With "-install_name @rpath/libfoo.dylib " the linker runtime searches
libfoo.dylib in the binary's embeded rpath.

With this change you can call dlopen() without specifying the full path
of the shared library.

Change-Id: If9beb3f6f4642a377bff603bab5ba3fdb96211bf
2012-02-01 13:20:30 -08:00
Ying Wang
80469e4d6c Delete unused var.
Change-Id: Ib6c295287f064529a8b4d8ada15a9fbb73064f1e
2012-02-01 11:28:00 -08:00
Ying Wang
b4c2a64040 Set install name with absolute path for Mac host shared libraries.
Before this change, path of the install name is relative to the top dir.
That means you can execute dynamically-linked binaries only in the top dir.
With this change, you can execute dynamically-linked binaries anywhere.

Change-Id: I1c6441579ffb68505ea678296aceb2e66a6df1be
2012-01-31 21:04:25 -08:00
Jim Huang
5d84f1659f 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.
2012-01-31 11:11:29 +08:00
Ying Wang
fcf246c989 Workaround for lack of "-Wl,--whole-archive" in MacOS's linker.
Change-Id: I2b1de0a253d341bcb7ee05fdc96bdc0d0967985e
2012-01-20 12:59:58 -08:00
Jean-Baptiste Queru
3b1dbe9302 Merge "Revert "Reference new location of SDK toolchain"" 2012-01-11 09:04:25 -08:00
Jean-Baptiste Queru
d75dbec617 Revert "Reference new location of SDK toolchain"
This reverts commit 1b834c6660.
2012-01-11 09:00:41 -08:00
Jean-Baptiste Queru
b6737c1366 Merge "Reference new location of SDK toolchain" 2012-01-11 06:36:55 -08:00
Jean-Baptiste Queru
cb8f66305c Revert "Point arm toolchain to the new gcc-4.6 one."
This reverts commit 1f87795eef.
2012-01-11 04:23:06 -08:00
Jean-Baptiste Queru
1b834c6660 Reference new location of SDK toolchain
Change-Id: If470d742a92061006d94b72f21df5c642348e179
2012-01-09 15:07:59 -08:00
Jean-Baptiste Queru
ea91f0a40e Reference x86 toolchain in its new location
Change-Id: I990b03107d1596a87a8d4cea6973735c60db4c64
2012-01-09 13:02:03 -08:00
Ying Wang
71b5cc1b8e Reference the new prebuilt ccache location.
Change-Id: I4450a8254fe82ed3a670ce653f49381d9c075c8e
2012-01-09 11:52:23 -08:00
Jing Yu
1f87795eef 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
2012-01-06 14:14:06 -08:00
Ying Wang
c7a10ddd31 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
2012-01-06 11:59:30 -08:00
Al Sutton
f79ce15891 am 1964c8ed: am d8765f0f: am 80cfc37d: Partial fix for emulator under Lion.
* commit '1964c8ed2d6b1981ee991b5ecd95ab711affdf62':
  Partial fix for emulator under Lion.
2012-01-05 12:08:29 -08:00
Al Sutton
80cfc37d0f Partial fix for emulator under Lion.
Don't use -Wl,-dynamic on Lion
2012-01-04 15:16:50 -08:00
Al Sutton
a4f5991486 am 657aeac8: am 9ce06f11: Don\'t run ranlib on MacOS 10.7
* commit '657aeac8423d9e3cd31c0dffcecaad78a53d7604':
  Don't run ranlib on MacOS 10.7
2011-12-21 16:46:37 -08:00
Al Sutton
9ce06f11d6 Don't run ranlib on MacOS 10.7
Change-Id: I74f4623e6044dd804669aaa70c6e410fa8988d75
2011-12-21 13:12:33 -08:00
David 'Digit' Turner
6371da10f8 x86: Refine the way we configure the x86 build.
This is the result of a recent conversation around the x86 ABI
and its relationship with how we build platform images. Briefly:

- We want to use feature-based macros like ARCH_X86_HAVE_$FEATURE
  instead of relying on explicit compiler macros like -DUSE_$FEATURE

- We want to allow for other x86-based arch variants, e.g. if
  someone wants to build Android for a CPU that doesn't support
  the NDK x86 ABI. However, we need to ensure these are not
  tagged compatible by mistake (see check at the end of TARGET_linux-x86.mk)

- There are several flags which use is dubious now that we have
  a dedicated toolchain to build all the x86 stuff. Comment them
  as 'to be considered for removal'. We'll do the proper checks
  later.

Change-Id: I7768d7c34d73e274cbf4c09ae831b55280d6bb58
2011-12-14 18:08:47 +01:00
Bruce Beare
29371f157a am 38158161: am 3343b27c: x86: The default ATOM BSP flags need to be in sync with the NDK ABI
* commit '381581613aab988acc6f9d5b459fd4f533d8c2a5':
  x86: The default ATOM BSP flags need to be in sync with the NDK ABI
2011-12-12 15:39:05 -08:00
Bruce Beare
3343b27c53 x86: The default ATOM BSP flags need to be in sync with the NDK ABI
Change-Id: Ic741e1795c655ace1e33ae6708219f2708358090
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-12-09 13:27:08 -08:00
Jing Yu
7bf82e0171 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
2011-11-18 14:22:55 -08:00
Jim Huang
ba2c734f71 am e39ee4d5: am cb48497f: HOST_linux-x86: Avoid doubly define macro _FORTIFY_SOURCE
* commit 'e39ee4d5e043872b3ef8053678a9c6020d82d4b6':
  HOST_linux-x86: Avoid doubly define macro _FORTIFY_SOURCE
2011-11-10 21:35:56 +00:00
Jim Huang
cb48497ff2 HOST_linux-x86: Avoid doubly define macro _FORTIFY_SOURCE
While building Android with latest host gcc, it causes the following
build error:

Install: out/host/linux-x86/bin/mkbootimg
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors

In order to make build system happy, this patch does unset macro
_FORTIFY_SOURCE and then define it in host cflags.

Change-Id: Ic37a90f05081a2c3650b3335bc87e9e895900fb2
2011-11-10 13:28:13 -08:00
Nick Kralevich
d9d2e7a42c x86: enable PIE for dynamically linked executables
Compile all x86 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.

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

Note 2: This change compliments 026a85b129,
which was the exact same change, except for ARM.

Testing: Rebuilt the tree completely from scratch, and verified
that the system boots and basic functionality works in the emulator.

Change-Id: I990064c37da3d857e663b27f31fee05f689a2824
2011-11-04 13:15:24 -07:00
Nick Kralevich
4185447f2f stop using a custom linker script for static executables.
This is causing problems with making the linker relocatable.

Change-Id: I53e37fba52eabd3145130712d6e9bff074aed493
2011-11-01 12:09:29 -07:00
Jean-Baptiste Queru
e7d25da929 am 9a3dfc06: am 68eb6649: am 432f8d88: Reconcile with AOSP master
* commit '9a3dfc06b94a59bdc7005a8a944996c956527c19':
2011-10-28 15:28:28 +00:00
Jing Yu
6af4bb07e3 Merge "Fix build problems with gcc-4.6.x." 2011-10-27 10:47:40 -07:00
Conley Owens
5071047d7e Merge "HOST_linux-x86: Avoid doubly define macro _FORTIFY_SOURCE" 2011-10-27 10:36:13 -07:00
Nick Kralevich
026a85b129 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
2011-10-24 11:37:37 -07:00
Jim Huang
59d296623b HOST_linux-x86: Avoid doubly define macro _FORTIFY_SOURCE
While building Android with latest host gcc, it causes the following
build error:

Install: out/host/linux-x86/bin/mkbootimg
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors

In order to make build system happy, this patch does unset macro
_FORTIFY_SOURCE and then define it in host cflags.

Change-Id: Ic37a90f05081a2c3650b3335bc87e9e895900fb2
2011-10-24 10:23:21 -07:00
Doug Kwan
2b40757725 Fix build problems with gcc-4.6.x.
Change-Id: If02f18efde4cec39c97bb0e7226b008cd6b85dd4
2011-10-13 12:28:34 -07:00
Ying Wang
45bee774eb am a1b603a5: am 4b398749: am c5033a33: Merge "x86: remove obsolete comments"
* commit 'a1b603a556e338d4899a62ea37810aff81ab7fa1':
  x86: remove obsolete comments
2011-08-29 11:05:08 -07:00
Ying Wang
a1b603a556 am 4b398749: am c5033a33: Merge "x86: remove obsolete comments"
* commit '4b3987498eb15dc654fe572aadf53396aac36479':
  x86: remove obsolete comments
2011-08-26 12:12:48 -07:00
Chih-Wei Huang
aa1c321a58 x86: remove obsolete comments
Change-Id: Ifb12892c17a50f85c7700d6413ea295a4dad7047
2011-08-03 12:16:59 +08:00
Doug Kwan
be3689e981 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
2011-07-14 16:34:26 -07:00
Jeff Brown
e33ba4c49e Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: Ie814f4c8d3aa1e7cc7f5735822ab25542f36cf62
2011-07-11 23:51:37 -07:00
Evgeniy Stepanov
8f77c9ded3 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
2011-06-28 12:47:34 +04:00
Raphael
ecb957705c resolved conflicts for merge of 732936d9 to master
Change-Id: I1fc667057aebbbef19bde746ebcc650ac0e8c35c
2011-06-23 13:52:29 -07:00
Raphael
732936d99a resolved conflicts for merge of 8508a073 to honeycomb-plus-aosp
Change-Id: I376928881adb0e9fd62fabc1e21542bf0d700ca2
2011-06-22 14:35:32 -07:00
Raphael Moll
c639c787a0 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
2011-06-21 06:11:05 -07:00
Martijn Coenen
3c22287c1b Revert "x86: Enable -fstack-protector"
This reverts commit e397dcccbb.
2011-06-07 08:57:34 -07:00
David Turner
5d627263c8 am 0a2d335e: am c1705c9a: Merge "x86: Enable -fstack-protector"
* commit '0a2d335e99bae3c257c0e26fe180d00de04bebaa':
  x86: Enable -fstack-protector
2011-06-06 14:39:32 -07:00
David Turner
486ce3495c am e4778e6a: am 4272b32a: Merge "Clean up of X86 build flags"
* commit 'e4778e6ab82a40475081482f26759985deeb7f21':
  Clean up of X86 build flags
2011-06-06 12:56:15 -07:00
David Turner
0a2d335e99 am c1705c9a: Merge "x86: Enable -fstack-protector"
* commit 'c1705c9ad8da4d6c2d267e27afd6e16aa7b431b6':
  x86: Enable -fstack-protector
2011-06-06 12:27:26 -07:00
David Turner
e4778e6ab8 am 4272b32a: Merge "Clean up of X86 build flags"
* commit '4272b32a86bd22ce560e41816cece950a7af4e51':
  Clean up of X86 build flags
2011-06-06 11:33:04 -07:00
Bruce Beare
e397dcccbb x86: Enable -fstack-protector
Change-Id: I1fe10159b7a29452ecfc6ba328164948cf9950d6
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-05-26 08:53:04 -07:00
Mark D Horn
5812d7b469 Clean up of X86 build flags
Review and clean-up of both compiler and linker flags
to ensure proper usage and consistency for images, toolchain,
SDK, and NDK.

Change-Id: Ife75c32cd49b32345712dee28fa5f2283069a90e
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Author: Bruce Beare <bruce.j.beare@intel.com>
2011-05-18 14:10:58 -07:00
Ying Wang
c6bb84159c Merge "Add LOCAL_GROUP_STATIC_LIBRARIES" 2011-04-27 09:34:13 -07:00
David Turner
cb040fbca4 am 57a477ff: am 6f9b7562: am d5565942: Merge "x86: Disable stack-protector until bionic is fixed"
* commit '57a477ff2e3dc853d24ca4ce490dbc50feeca3c8':
  x86: Disable stack-protector until bionic is fixed
2011-04-26 12:45:49 -07:00
David Turner
57a477ff2e am 6f9b7562: am d5565942: Merge "x86: Disable stack-protector until bionic is fixed"
* commit '6f9b7562e36483a7bf23833d99da6a50e57f7266':
  x86: Disable stack-protector until bionic is fixed
2011-04-26 10:24:24 -07:00
Ying Wang
fcdabd4bdb 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
2011-04-25 14:22:41 -07:00
Bruce Beare
6ddd4ead92 x86: Disable stack-protector until bionic is fixed
Change-Id: I2862de5c1b02490197704f4578a8a91d0565eef0
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-04-01 09:09:18 -07:00
Raphael
2396a0db92 resolved conflicts for merge of 9b4660a1 to master
Change-Id: Ide155e276c6e994ad330a5ac1c2676a7acc1efed
2011-03-25 16:21:38 -07:00
Raphael
9b4660a1c6 resolved conflicts for merge of db0d59d1 to honeycomb-plus-aosp
Change-Id: Ie3f5b2986bc926407a7883b449441cb58ab70e30
2011-03-25 15:13:55 -07:00
Iliyan Malchev
0cafe839e0 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>
2011-03-17 10:09:59 -07:00
Bruce Beare
2e8283d9bc x86: the -mbionic flag is needed for IA builds.
Change-Id: I00c75f37d7ea46b9f8ad3d7b2ff7094477ff0916
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-03-15 07:47:49 -07:00
David 'Digit' Turner
8c675d2293 am 16e7050c: am e9b1d0ee: am f8f95fc8: Merge "Allow win_sdk build with USE_CCACHE=1"
* commit '16e7050cbaa292c0f36275cdb4c56f357cbfa79a':
  Allow win_sdk build with USE_CCACHE=1
2011-03-15 04:13:24 -07:00
David 'Digit' Turner
16e7050cba am e9b1d0ee: am f8f95fc8: Merge "Allow win_sdk build with USE_CCACHE=1"
* commit 'e9b1d0eee715895f156c8e2601d5b1996919da6d':
  Allow win_sdk build with USE_CCACHE=1
2011-03-15 04:09:34 -07:00
David 'Digit' Turner
55aad08663 Allow win_sdk build with USE_CCACHE=1
This patch allows the Window sdk build (lunch sdk-eng; make win_sdk)
to work properly when USE_CCACHE is defined in the environment.

There is no Windows ccache prebuilt, but since we're cross-compiling
from Linux, detect it and use the linux prebuilt binary instead.

Note: Depends on https://review.source.android.com//#change,21755
      for a complete solution to the problem.

Change-Id: I0b1b59efae86ee7114225258c9ecf9f257913347
2011-03-15 01:01:32 +01:00
Iliyan Malchev
b375e71d30 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
2011-03-12 14:59:46 -08:00
David Turner
1c908fa188 am b9c627c6: am 0683a773: Merge "x86: Use GCC 4.4.3"
* commit 'b9c627c6a0c6f0af57d0912175bfc739b0eb6249':
  x86: Use GCC 4.4.3
2011-03-07 13:45:59 -08:00
Bruce Beare
a17b91faa4 x86: Use GCC 4.4.3
Change-Id: I083c1afcbb98cfeb48d7bcb7681e5c34db52e767
Author:    H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-03-01 13:04:24 -08:00
Jeff Brown
bd528a82a2 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
2011-02-16 15:06:30 -08:00
Ben Cheng
5116e50705 Remove usused workaround.
Change-Id: I1d42d0f0dee361b98403bc87296dcbc37484ebcb
2011-02-16 12:48:38 -08:00
Jeff Brown
703e7c6d50 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
2011-02-08 16:38:56 -08:00
Ying Wang
3a7e4ccad9 Unify use of $(hide).
Change-Id: Ib7e17bbb4682caecce5812e63de872b676403d64
2011-01-28 14:14:47 -08:00
Ying Wang
f5653d1cee Regularize use of PRIVATE_CXX.
Change-Id: Ifc628c67b5fa142cec59187f89f2d39df81160b9
2011-01-27 20:08:34 -08:00
Ying Wang
80e6cce93e Correct misuse of target/host vars.
Change-Id: Ide41aeddc44ca05d85a36035c2d55ea453cfd216
2011-01-24 23:25:36 -08:00
David 'Digit' Turner
60a1e88052 Add support for custom Linux host toolchains when building the SDK.
This is needed in order to build Linux SDK binaries that can run
properly on Ubuntu 8.04 (Hardy). By default, the host toolchain
on 10.04 (Lucid) generates machine code that won't run on Hardy
due to GLibc ABI mistmatches.

Note that nothing happens if the new toolchain is not in the
prebuilt tree.

Change-Id: I914f5a303f16b6871759ce5a7178585ed3060870
2011-01-16 19:14:04 +01:00
Jing Yu
a83b769566 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
2010-12-21 16:33:48 -08:00
David 'Digit' Turner
02e172e892 am efc5d814: am 15f4980d: Merge "Add support for custom Linux host toolchains when building the SDK." into gingerbread
* commit 'efc5d81428a8c7d9cf7cb7b3a5f1a8344b02a700':
  Add support for custom Linux host toolchains when building the SDK.
2010-12-14 02:45:58 -08:00
David 'Digit' Turner
efc5d81428 am 15f4980d: Merge "Add support for custom Linux host toolchains when building the SDK." into gingerbread
* commit '15f4980d510824113a4d2b71d70de9c67715f3dc':
  Add support for custom Linux host toolchains when building the SDK.
2010-12-14 02:42:10 -08:00
David 'Digit' Turner
0960ca7488 Add support for custom Linux host toolchains when building the SDK.
This is needed in order to build Linux SDK binaries that can run
properly on Ubuntu 8.04 (Hardy). By default, the host toolchain
on 10.04 (Lucid) generates machine code that won't run on Hardy
due to GLibc ABI mistmatches.

Note that nothing happens if the new toolchain is not in the
prebuilt tree.

Change-Id: I45c1f68e37e15a0032f885df1c5c0f297b3d8642
2010-12-13 11:52:03 +01:00
Jean-Baptiste Queru
cdfcc05897 am 6c7b6fb3: resolved conflicts for merge of b2028868 to gingerbread-plus-aosp
* commit '6c7b6fb3d2fda5cc5b881e01eb8bb0936ef0eeaf':
  IA: enable SSE fpmath, Separate ARCH_VARIANT and ARCH makefile settings
2010-11-19 16:56:31 -08:00
Jean-Baptiste Queru
6c7b6fb3d2 resolved conflicts for merge of b2028868 to gingerbread-plus-aosp
Change-Id: Ibe616c0bdf8e36aaee42279292a2dbe03c5643c2
2010-11-19 12:35:33 -08:00
Bruce Beare
ccec9c45d9 IA: enable SSE fpmath, Separate ARCH_VARIANT and ARCH makefile settings
Change-Id: I60b8121c92b39a60b513bc2496a1e0a21015c586
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2010-11-19 11:15:40 -08:00
Jean-Baptiste Queru
75220495d0 am 766a2a21: am 48ec6d6f: Merge "Enables x86-atom as a valid TARGET_ARCH_VARIANT for the simulator build."
* commit '766a2a2125d41e8bfb88112601a34af08f47f7f1':
  Enables x86-atom as a valid TARGET_ARCH_VARIANT for the simulator build.
2010-11-17 15:52:09 -08:00