Commit graph

325 commits

Author SHA1 Message Date
Ying Wang
40b49d3043 am a74ade94: Merge "Support host multilib build"
* commit 'a74ade945776e80f99f3b05d06a131cfd353c3f6':
  Support host multilib build
2014-05-15 00:41:37 +00:00
Ying Wang
6feb6d5607 Support host multilib build
This change basically ported our target multilib to the host side.
It supports 2 host build modes: x86 and x86_64 multilib build.
For now you need to set "BUILD_HOST_64bit=true" to switch to x86_64
multilib build. Later we'll default to x86_64 build and have a flag
to force 32-bit only build, which may be needed by SDK build.

In host module definition, like in target ones, you can use the
following
LOCAL variables to set up multilib configuration:
LOCAL_MULTILIB: can be "both", "first", "32" or "64".
It also supports the same set of arch or 32-vs-64 specific LOCAL
variables.
By default, it builds only for the first arch.

To keep path compatibility, in x86_64 build files are still output to
out/host/linux-x86; Both 32-bit and 64-bit executables are in
out/host/linux-86/bin;
In x86_64 build 32-bit shared libraries are installed to
out/host/linux-x86/lib32
and 64-bit shared libraries are installed to out/host/linux-x86/lib;
32-bit object files are output to out/host/linux-x86/obj32 and 64-bit
object files
are output to out/host/linux-x86/obj.

Bug: 13751317
Change-Id: I6044f83b7db369a33e05209e8c588eb6dc83409f
2014-05-14 16:55:04 -07:00
Bill Yi
1e4adfa837 Merge commit '8113e43601aac7702b9ec007e81a179826143d1e' into HEAD 2014-04-29 11:32:53 -07:00
Ying Wang
faf3d5ed0f Disable host -fPIE if BUILD_HOST_static is set.
It turns out -static doesn't work with -fPIE.

Bug: 13568878
Change-Id: I66951a5517dece1c5f4f22c329cf703bd99b5163
2014-04-04 14:38:14 -07:00
Torne (Richard Coles)
3972253b0f Add GYP as a target type that requires 2nd arch.
"GYP" class targets are used by external/chromium_org for gyp's "none"
type. The processing in these targets needs a separate intermediate
directory for the primary/secondary architecture, so add it to the list
in intermediates-dir-for along with libraries/executables.

Change-Id: Id05899c83b45ed0647dfbfa6b0b2e7f61b04348b
2014-04-02 11:33:17 +01: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
Ying Wang
288bf3a377 am 266cf4f2: am f39752e9: Skip the product-scoped --product flag if it\'s set in LOCAL_AAPT_FLAGS
* commit '266cf4f2595323170fe02db05835884b4522a0f9':
  Skip the product-scoped --product flag if it's set in LOCAL_AAPT_FLAGS
2014-03-24 21:26:51 +00:00
Ying Wang
266cf4f259 am f39752e9: Skip the product-scoped --product flag if it\'s set in LOCAL_AAPT_FLAGS
* commit 'f39752e99b4e5083f1e91c46722f87def8143b49':
  Skip the product-scoped --product flag if it's set in LOCAL_AAPT_FLAGS
2014-03-24 21:21:26 +00:00
Ying Wang
f39752e99b Skip the product-scoped --product flag if it's set in LOCAL_AAPT_FLAGS
Bug: 11335547
Change-Id: Ic08b7557a288508e8e8d14a725923960c47f5ca0
2014-03-20 17:28:57 -07:00
Christopher Ferris
810cf65d71 am aea9f041: am 8b1bcc7d: Merge "Add a method to leave the symbol table in a library."
* commit 'aea9f041f72a128065691ac402ccdb72a5a7aad4':
  Add a method to leave the symbol table in a library.
2014-03-19 18:15:39 +00: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
Colin Cross
9bdcdff615 HACK: add 64-bit directory blacklist
Change-Id: I431e8b220db81d51930dc0b3d95995df120c179a
2014-03-13 11:26:26 -07:00
Nicolas Geoffray
e7be6ffa98 am db48d145: am 247dd0c4: Merge "Do not remove the generated .hpp file from yacc."
* commit 'db48d145841afb9b9b6d1c124191a1681d6b4f39':
  Do not remove the generated .hpp file from yacc.
2014-03-11 18:29:45 +00:00
Ying Wang
009f48b00f am a6230641: am 26bcd640: Merge "Try to catch more misuse of ."
* commit 'a623064131f23412daa0ac4b333320e2e30d85f0':
  Try to catch more misuse of $(my-dir).
2014-03-11 18:17:42 +00:00
Ying Wang
8ec7041127 am 8e286fbf: am cf1b7d4b: Merge "Select src arch for prebuilts."
* commit '8e286fbfc712ed695008f786592fe83e4a1331a7':
  Select src arch for prebuilts.
2014-03-11 18:16:49 +00:00
Torne (Richard Coles)
bbc3a3eda3 am 63002088: Merge "Allow LOCAL_LDFLAGS to override HOST_GLOBAL_LDFLAGS."
* commit '630020883abc6c8b2c13876e3195ed6abcf4890f':
  Allow LOCAL_LDFLAGS to override HOST_GLOBAL_LDFLAGS.
2014-03-11 18:08:03 +00:00
Ying Wang
2c5666fc4d am eb9b62e0: Merge "Make -rpath-link work with multilib."
* commit 'eb9b62e08d25ec9067a3f47634a2b8cf750230d8':
  Make -rpath-link work with multilib.
2014-03-10 18:06:15 +00:00
Ying Wang
16ae8b4dd1 am 5c7039fb: Merge "Remove dead code."
* commit '5c7039fb069c040759df0a5a15241dd7f8b2f9b7':
  Remove dead code.
2014-03-07 02:30:02 +00:00
Elliott Hughes
77285ffc9b am 993ffb80: Merge "Add all-S-files-under."
* commit '993ffb802ee90e07e73e67e523fd040395dfd74d':
  Add all-S-files-under.
2014-03-07 02:27:16 +00:00
Colin Cross
b9ad6792c0 am 717de0f5: Merge "Fix installing 2nd arch shared libraries"
* commit '717de0f553dc3c1a2baa0cc988af1adc5b26dba8':
  Fix installing 2nd arch shared libraries
2014-03-07 02:23:35 +00:00
Nicolas Geoffray
3cb9ddbdec Do not remove the generated .hpp file from yacc.
Depending on the file extension of the generated C++ file,
bison will generate a #include of a .h or .hpp. So both files
must be kept in the generated directory.

Change-Id: Id0aac7f407bdc69c7f5012c0d021761b0fceb427
2014-03-04 14:48:55 +00:00
Ying Wang
79e8319b2e Try to catch more misuse of $(my-dir).
Change-Id: I0c07d7115c66b30ba1383dfaa133f0cc40a33ad7
2014-02-28 18:23:06 -08:00
Ying Wang
6c930fc1c9 Select src arch for prebuilts.
Change-Id: I2d08f923d28d59cfef93ff0bd9893352baaee60b
2014-02-27 18:25:29 -08:00
Torne (Richard Coles)
db7dcc210a Allow LOCAL_LDFLAGS to override HOST_GLOBAL_LDFLAGS.
For host executables and shared libraries, the global LDFLAGS were being
inserted into the linker command line after the module-specific ones,
making it impossible to override the default settings. Change the order
to match target linker invocations.

Change-Id: Icd5f6f83df9f27a5be97ddb197ee245c1ab8c2be
2014-02-25 13:33:30 +00:00
Ying Wang
9fb3526648 Make -rpath-link work with multilib.
Change-Id: If69ea6ed6cdbb657ed4005f8217d653e29626783
2014-02-21 16:20:20 -08:00
Ying Wang
dc6bb0477d Remove dead code.
Change-Id: Ia36a04037e15cbf296f375f3ece9a7e977fdca1e
2014-02-12 17:38:46 -08:00
Colin Cross
02e31d240a HACK: add 64-bit directory blacklist
Change-Id: I431e8b220db81d51930dc0b3d95995df120c179a
2014-02-12 12:17:55 -08:00
Elliott Hughes
e3b044a0cc Add all-S-files-under.
Change-Id: I25416e2acc850c61226bc7a8e0536384f6eb2dce
2014-02-11 13:48:35 -08:00
Ying Wang
960d919e81 resolved conflicts for merge of 4df82b3e to klp-dev-plus-aosp
Change-Id: I7a1d9e1954ede06a818814bd05a77c69f1ed3bc6
2014-02-08 10:31:46 -08:00
Mihail Dumitrescu
4df82b3e30 Allow proguarding the main app and the test app in a single run.
Bug: 12895101
Change-Id: I6804d73306a164d3e3ec0cab4743f9582b5ef2cf
2014-02-07 19:11:24 +00:00
Colin Cross
5394bf1950 Fix installing 2nd arch shared libraries
2ND_TARGET_DEPENDENCIES_ON_SHARED_LIBRARIES was not set,
which was causing the later += to act like = instead of
:=, and the dependencies would disappear as soon as
LOCAL_MODULE was cleared.

Change-Id: Idea291524fc06377deafec62f37d20eaa7f93bca
2014-02-04 19:44:09 -08:00
Colin Cross
d826264621 add new gen/ directory for generated sources
Allow modules to generate source into $OUT/gen, which will then
be copied into $OUT/obj and $OUT/obj_$(TARGET_2ND_ARCH) as
necessary.  This allows a single build rule invocation that includes
generated source to build for the first and second architectures.

Modules will need to change calls to local-intermediates-dir into
local-generated-sources-dir.

Change-Id: I62504bad9454b3d9fde7b84ab9f0a487a2ecf0bf
2014-01-27 14:45:44 -08:00
Ying Wang
dd814bf8c2 Support to build executables for TARGET_2ND_ARCH
By default, an executable is built for TARGET_ARCH.
To build it for TARGET_2ND_ARCH in a 64bit product, use:
LOCAL_32BIT_ONLY := true
To skip a module for TARGET_2ND_ARCH, use:
LOCAL_NO_2ND_ARCH := true

Bug: 11654773
Change-Id: Ieb293d25b21024bfe1b554044df338e064ac7b46
2014-01-24 13:36:30 -08:00
Ying Wang
4d2cc665ea Set up rules to build shared libraries for TARGET_2ND_ARCH
The rules for the 2nd arch are set up in the second inclusion
of shared_library_internal.mk.
Intermediate fils of libfoo of the 2nd arch will be built into
$(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)/SHARED_LIBRARIES/libfoo_intermediates/
and the built libfoo.so will be in
$(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)/lib.

Bug: 11654773
Change-Id: I58bbe5a05a65f63bce6279131552f3792000716e
2014-01-24 13:35:30 -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
Logan Chien
e6f65438a4 Allow clang to build host binaries.
Change-Id: I7e4f9dc6f69a97cfefdfa2ed55c5d7b8ad496da7
2014-01-07 14:49:20 +08:00
Joshua J. Drake
b0eafa21b9 enable PIE for dynamically linked Linux host executables
Compile all host programs for Android with -fPIE and -pie. This
enables PIE (Position Independent Executables), which helps
protect these applications from exploitation due to memory
management bugs.

Note: PIE *static* executables are not supported at this time. darwin
and windows are also not supported.

Change-Id: I67c1be297711ea23064c349f97ebd02eef3eff09
2013-12-12 17:36:53 -08:00
Ying Wang
7493c39eff Add utility function find-files-in-subdirs
find-files-in-subdirs uses utility find to find given files in the given
subdirs. This function uses $(1), instead of LOCAL_PATH as the base.

Change-Id: Ib76631c97acd257d651a580cbad767606874f5d0
(cherry picked from commit 85898bca99)
2013-12-05 18:37:20 +00:00
Ying Wang
7c8c7bd4b6 Add utility function find-files-in-subdirs
find-files-in-subdirs uses utility find to find given files in the given
subdirs. This function uses $(1), instead of LOCAL_PATH as the base.

Change-Id: Ib76631c97acd257d651a580cbad767606874f5d0
2013-12-04 16:56:38 -08:00
Ying Wang
c5b72527d3 am ec3c15e5: am 04c4d34d: am 7311a344: Make it easier to enable obfuscation and optimization.
* commit 'ec3c15e5c7c11cf3a831898f286c7eb7c216e50f':
  Make it easier to enable obfuscation and optimization.
2013-08-23 10:12:26 -07:00
Ying Wang
ec3c15e5c7 am 04c4d34d: am 7311a344: Make it easier to enable obfuscation and optimization.
* commit '04c4d34d4fdb56c824abf39239d2c87806706b7e':
  Make it easier to enable obfuscation and optimization.
2013-08-23 10:09:27 -07:00
Ying Wang
7311a344be Make it easier to enable obfuscation and optimization.
With this change, use:
* LOCAL_PROGUARD_ENABLED := obfuscation  # to enable obfuscation
* LOCAL_PROGUARD_ENABLED := optimization # to enable optimization
* LOCAL_PROGUARD_ENABLED := obfuscation optimization # to enable both

Now the meaning of the LOCAL_PROGUARD_ENABLED options:
* full:
    Use the build system's default configurations:
    with shrink but no obfuscation or optimization,
    global proguard flags in build/core/proguard.flags
    are applied.
* custom:
    The same as "full" except no aapt-generated resource-related
    proguard flags.
* nosystem:
    Don't use any build system's default configurations; but
    aapt-generated proguard flags are still applied. You are
    responsible for any other flags.
* disabled:
    Disable proguard.
* obfuscation:
    The same as "full" but with obfuscation enabled.
* optimization:
    The same as "full" but with optimization enabled.
* no value (the default):
    The build system chooses the proper value: "full" if it's an
    app; "disabled" if it's a library.

You can use more than 1 of them in a meaningful combination,
for example:
LOCAL_PROGUARD_ENABLED := obfuscation optimization

Bug: 10307372
Change-Id: Id248caca3048e99547f16559fae74f4afe85c354
2013-08-22 17:12:38 -07:00
Jean-Baptiste Queru
8a7cd65585 am 50a402af: am f1534b62: Merge "Added generic hook for loading vendor specific defintions"
* commit '50a402af7ae550c96b9142ab56d3a23a8a8d22b1':
  Added generic hook for loading vendor specific defintions
2013-07-30 10:28:17 -07:00
Jean-Baptiste Queru
50a402af7a am f1534b62: Merge "Added generic hook for loading vendor specific defintions"
* commit 'f1534b6292a609bb5f55c4a617f3cd1054f90a81':
  Added generic hook for loading vendor specific defintions
2013-07-30 07:33:53 -07:00
Ying Wang
54d9cc3fac am cd9cadbc: am 7768c91c: am 94de1eba: Put a copy of the radio/bootloader files in the dist dir.
* commit 'cd9cadbcf68bfe07ac994e61aa00969572ae3fd5':
  Put a copy of the radio/bootloader files in the dist dir.
2013-07-26 13:00:20 -07:00
Ying Wang
cd9cadbcf6 am 7768c91c: am 94de1eba: Put a copy of the radio/bootloader files in the dist dir.
* commit '7768c91c1c90e7c13390396d895a3afd5fda3e0f':
  Put a copy of the radio/bootloader files in the dist dir.
2013-07-26 12:57:19 -07:00
Ying Wang
94de1eba0e Put a copy of the radio/bootloader files in the dist dir.
Bug: 10035750
Change-Id: I3b51e61ec737899d9264885a1e66c89a7a740d54
2013-07-26 12:19:20 -07:00
Marie Lennerhagen
9e5efceff9 Added generic hook for loading vendor specific defintions
Change-Id: I6dec9c378ed0aabf9e60f8dcb05c6043bbcc30e5
2013-07-26 18:12:36 +00:00
Ying Wang
5efaa72ac1 am 51aab877: am 5d1db8b4: Merge "Allow proto builds to pass in java proto params."
* commit '51aab8775ab86990abef411d00f5686e41022eee':
  Allow proto builds to pass in java proto params.
2013-07-25 17:04:20 -07:00
Ulas Kirazci
6e485b545a Allow proto builds to pass in java proto params.
Change-Id: I65fe0cd96f818f59267da6159e6bd2ad28f07a11
2013-07-25 13:40:53 -07:00