Commit graph

90 commits

Author SHA1 Message Date
Ying Wang
d481b112f2 Fix HOST_LIBRARY_PATH.
Since we switched to $(HOST_OUT)/lib64 for 64-bit libraries and
$(HOST_OUT)/lib for 32-bit libraries.

Change-Id: Ie43bc03c37e2ac8542412a7543a6af5d60c6f725
2014-08-14 11:03:56 -07:00
Ying Wang
6aef047362 Support to set up TARGET_COPY_OUT_VENDOR in board config.
We first define TARGET_COPY_OUT_VENDOR as a placeholder. In product
config makefiiles we actually get the placeholders in
PRODUCT_COPY_FILES. A device can set up TARGET_COPY_OUT_VENDOR in its
BoardConfig.mk. We substitute the placeholder with the real
TARGET_COPY_OUT_VENDOR value after loading the BoardConfig.mk.
With this change, we can support building vendor stuff to
system.img (the default) or a separate vendor.img.

Bug: 16515152
Change-Id: I5b601d7a8b34fe032a1bac02aa5c204a3765691d
2014-07-23 22:26:32 -07:00
Ying Wang
26dbc3e6e4 am d3b5d574: am ce40d5f9: am bc7501e1: Merge "More consistent use of 64-bit build variable."
* commit 'd3b5d574defd565d6e810cbb86e3943837f94065':
  More consistent use of 64-bit build variable.
2014-07-09 15:07:12 +00:00
Ying Wang
4b1c95d8d2 More consistent use of 64-bit build variable.
Set up TARGET_IS_64_BIT and HOST_IS_64_BIT early so we don't need 2
mechanisms to judge if it's 64-bit build;
Remove the unnecessary 32-bit host variables.

Change-Id: I08d6d4d9ea70f91135fe2ee05463fb9a0d1cee42
2014-07-08 18:04:17 -07:00
Ying Wang
e050245b7a am 0d0b7b36: am 2530c787: am 4b539d15: Merge "More consistent host library path in multilib build."
* commit '0d0b7b3669d3cb309ddd26cf23ddddbe4d42fd8e':
  More consistent host library path in multilib build.
2014-07-01 00:35:21 +00:00
Ying Wang
36ef50f2a2 More consistent host library path in multilib build.
In 64-bit multilib host build, changed from
32-bit lib: out/host/<platform>/lib32
64-bit lib: out/host/<platform>/lib
to
32-bit lib: out/host/<platform>/lib
64-bit lib: out/host/<platform>/lib64
.
That way the host library path is consistent with the multilib target
build's. Also with this change prebuilt 32-bit libraries can be reused
in 64-bit host build as 2nd arch binaries. (With previous setup, they
can't be used because they have rpath ../lib in it while the 2nd arch
library path needs ../lib32.

Change-Id: I020199d0c7dd52cdc8dcb7d3a1d22cd6178672e1
2014-06-30 17:06:21 -07:00
Colin Cross
a58f8e04c9 build: fix vendor symbols in gdb
Set TARGET_OUT_VENDOR_SHARED_LIBRARIES_UNSTRIPPED
Append '64' for 64-bit libraries

Change-Id: Ief289bb23950d4bed84cf616cff6038fbd8caf95
2014-06-27 10:48:22 -07:00
Ying Wang
f15250ed86 Set up oem.img directory structure for TARGET_2ND_ARCH.
Change-Id: Ia931a10708225c428b658cb4a30e8bba66fa7308
2014-06-26 14:12:35 -07:00
Ying Wang
70ae5e23fc am 0d276266: am 128cd1b7: am 6cc4598d: Merge "Add global variable HOST_LIBRARY_PATH."
* commit '0d27626620676dbe72bf5c020008bb2dad20d75f':
  Add global variable HOST_LIBRARY_PATH.
2014-06-11 20:24:22 +00:00
Ying Wang
f7988507f4 am 2d19cbd2: resolved conflicts for merge of 135e11df to klp-modular-dev-plus-aosp
* commit '2d19cbd279ed69c7202f089be174c35c1585f709':
  Switch to 32-bit-by-default host multilib build.
2014-06-11 19:26:30 +00:00
Ying Wang
c4595868c4 Add global variable HOST_LIBRARY_PATH.
With multilib host build, the build system installs host
shared libraries to different directories depending on a
library's bitness:
- HOST_OUT_SHARED_LIBRARIES points to the library path of 64-bit;
- 2ND_HOST_OUT_SHARED_LIBRARIES points to the library path of 32-bit;
- If you don't care the bitness of the libraries and just want whatever
  version the librareies are built by default, use HOST_LIBRARY_PATH.

Bug:13751317
Change-Id:Id4c818941dc4ea35d795767c76f698529bd6aebb
2014-06-10 12:04:56 -07:00
Ying Wang
2713fcebba Switch to 32-bit-by-default host multilib build.
Also we don't need to force LLVM built from source, for we already force
LLVM to be built as 32-bit.

Bug: 13751317
Change-Id: Ifadf1988d28b60cb06316de50f5bdc1834f1acc0
2014-06-09 17:48:05 -07:00
Ying Wang
1dc4f0bace am 2bf10a72: am cdcb6926: am 6cb69bd4: Merge "Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build"
* commit '2bf10a72f87a8e97923286aa331f7db81e2361ca':
  Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build
2014-05-23 19:43:57 +00:00
Ying Wang
966c1e0cae Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build
We already support pure 32-bit and 64-bit-by-default multilib build.
With HOST_PREFER_32_BIT we can build 32-bit-by-default multilib build.
This will be lest disruptive during the period we transition to
64-bit-by-default.

Bug: 13751317
Change-Id: I0d56ce4abbe4afeaacfd70d709f6a349791c0722
2014-05-20 18:03:21 -07:00
Ying Wang
8200231ae1 am e50f2d9f: am 40b49d30: am a74ade94: Merge "Support host multilib build"
* commit 'e50f2d9f32a27d8290692dbf99ab8b247ef9d553':
  Support host multilib build
2014-05-15 01:09:49 +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
Ying Wang
b8888432f0 Set up rules to build oem.img
To build oem.img:
- You must define BOARD_OEMIMAGE_PARTITION_SIZE in your BoardConfig.mk
- The file system type will be the same as system.img and userdata.img.
- To install a module to oem.img, use "LOCAL_OEM_MODULE := true"
- run "make -j48 showcommands oem_image dist". By default it's not
  built.

Bug: 13367676
Change-Id: I1a26d4d0c61b72ecffe60279667b1b3de050780d
2014-04-28 09:43:51 -07:00
Narayan Kamath
110ea46e09 resolved conflicts for merge of 8af7e8ed to master
Change-Id: Ib427b36e133e29d1c2e9cea065e4e63c1e2e2122
2014-04-09 12:33:03 +01:00
Narayan Kamath
7303ebda84 Add 32 / 64 bit abi lists to system properties.
Introduce ro.product.cpu.abilist32 / abilist64, which are
comma separated lists of the 32 and 64 bit ABIs that the
device supports. These properties are used by the zygote and
system server to determine what ABI an app should be
started with.

This changes move abilist related make steps out of envsetup.mk
and into config.mk because they depend on variables set by
core/combo/***. Additionally, config.mk performs a few additional
cleanups of these variables (like stripping them) after the
inclusion of envsetup.mk so this seems like a better place to
put them.

bug: 13647418

Change-Id: I3db39bdd761220c5b4966f651892fb592396f9a1
2014-04-08 17:40:40 +01:00
Narayan Kamath
b4d757b1b2 am f6811abe: am 9fbd3afd: am 431b4bb3: Merge "Extend the CPU ABI specification mechanism."
* commit 'f6811abe12601c9753f329cb34da568f0072ca76':
  Extend the CPU ABI specification mechanism.
2014-03-31 12:35:14 +00:00
Narayan Kamath
1a43b375b4 Extend the CPU ABI specification mechanism.
Add a (read only) system property that is a comma
separated list of ABIs supported by the device in order
of preference. For example, typical arm-v8 device might
define:

ro.cpu.abilist = arm64-v8a,armeabi-v7a,armeabi

For most purposes, a single flattened list like the above is
probably more useful than the parallel system of variables
TARGET_CPU_ABI{2} / TARGET_2ND_ARCH_CPU_ABI{2} that we use
in the build system.

Change-Id: If9102669ad9f5f8fd89a8bcc5bf88cca1acadc3c
2014-03-28 17:10:47 +00:00
Colin Cross
40826c170c am 8c89a9ff: am 4695598d: am ae49acbd: am 1acb1b64: Merge changes I62504bad,I16208cca,I4e4ceec6
* commit '8c89a9ff9cd461e4bc077a91a0c7c32b17a92ebd':
  add new gen/ directory for generated sources
  warn on LOCAL_MODULE_PATH in multiarch shared libraries
  Support LOCAL_MODULE_RELATIVE_PATH
2014-01-27 23:48:52 +00: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
Colin Cross
f6c0e042fd am 088319dd: am dda94546: am 4a1f42d7: am 7c7f28e7: Merge changes Ib1d950e1,I3d020a3c,Ic9594718
* commit '088319dd22ac4bc65eb284dfeeab368ac2e90ca9':
  Add 2nd arch directories for apps
  Set up rules to build prebuilts for TARGET_2ND_ARCH
  Set up rules to build packages for TARGET_2ND_ARCH
2014-01-25 00:58:58 +00:00
Colin Cross
d9574462d8 Add 2nd arch directories for apps
Apps built for 2nd arch install in the same directories as when
built for the 1st arch.

Change-Id: Ib1d950e186eef88212b44d04e6bc6c30a3d56155
2014-01-24 16:44:06 -08:00
Ying Wang
b8e0185489 Support arch-specific LOCAL_ variables
With those variables, you can set up different values for TARGET_ARCH
and TARGET_2ND_ARCH.
Also fixed a couple of variables.

Bug: 11654773
Change-Id: I4c7684a562cd5877d18f67d4f848b8df07d0103b

Conflicts:
	core/base_rules.mk
2014-01-24 13:38:34 -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
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
Ying Wang
e3d067926f Support arch-specific LOCAL_ variables
With those variables, you can set up different values for TARGET_ARCH
and TARGET_2ND_ARCH.
Also fixed a couple of variables.

Bug: 11654773
Change-Id: I4c7684a562cd5877d18f67d4f848b8df07d0103b
2014-01-23 15:12:51 -08:00
Ying Wang
72b01d6121 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-21 11:26:39 -08:00
Ying Wang
61d499b965 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-16 14:34:13 -08:00
Ying Wang
e1d44c3b4a 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
2014-01-16 14:30:02 -08:00
Ying Wang
734afe4e42 am 94ff79ea: am adc66128: am b6c57051: am f5ce4fa9: Merge "Install 64-bit libraries to /system/lib64."
* commit '94ff79eaf2d66be4c83656a41b4efa38ad34a970':
  Install 64-bit libraries to /system/lib64.
2014-01-14 20:15:45 +00:00
Ying Wang
c634974d37 Install 64-bit libraries to /system/lib64.
/system/lib always contains 32-bit libraries, and /system/lib64 (if
present) always contains 64-bit libraries.
Move things around a little bit, so TARGET_ARCH can be used to define
the build paths.

Bug: 11654773
Change-Id: I2edd91e162c7a20d7719d7bae15e5fa6c2a5b498
2014-01-13 16:20:31 -08:00
Ying Wang
ec900ac4dc Support host phony package.
Bug: 11467421
Change-Id: I146387aecc57aaabbbb81f8c8bc9b5c9a5e81f05
2013-11-13 15:56:18 -08:00
Tsu Chiang Chuang
40da8832c9 add a fake data target.
(cherry picked from commit 3ba7baf14875d3cd360006be7dffe7e4e0cf1882)

Change-Id: I691d4dda65437d3f57e77ed207da406fd1f53355
2013-05-14 10:58:26 -07:00
Ying Wang
5338fbfaca Install to TARGET_OUT_APPS_PRIVILEGED if LOCAL_PRIVILEGED_MODULE is true
Change-Id: I268b8652f18034aa3fdd3126ebf6196f78c4bbb2
2013-05-08 15:49:08 -07:00
Ying Wang
0abb0fd409 Default install path of shared Java library with tag tests
To $(PRODUCT_OUT)/data/framework/.

Change-Id: Iff6bbada47258344c13853d4fd71c7ad4b709c2c
2013-03-26 16:01:02 -07:00
Ying Wang
d0244b395a Remove build variant "tests"
Bug: 5368571
Now we have a phony target "tests" instead.
The target can be built in any other build variant (eg userdebug).
For example, "make PRODUCT-full-userdebug tests dist" will build and
put the *-test-* zip file in the dist dir.
The "tests" target will include all modules tagged as "tests" in
addition to other modules in specific target out directories.

Change-Id: I8383097380d8e6846c3e2107d6dd5f68788cfc39
2012-10-01 10:18:40 -07:00
Joe Onorato
6a185e453d Remove support for user tags in the build system.
It is not forbidden to say LOCAL_MODULE_TAGS := user,
and if you don't say LOCAL_MODULE_TAGS, it now defaults
to optional.

Change-Id: I0a0b200bb6f1c7bf1fe3a89cdc8f69678617526c
2012-08-16 22:45:56 -07:00
Jean-Baptiste Queru
049d97d778 am 2387857d: am 968f20a4: Merge "MIPS support to *.mk files and envsetup.sh"
* commit '2387857dad06b3437ffcf0c14e2bc9f5956a5888':
  MIPS support to *.mk files and envsetup.sh
2012-08-10 12:43:59 -07:00
Raghu Gandham
8da4310646 MIPS support to *.mk files and envsetup.sh
Change-Id: Iba4d046e3202524b29cfe32980927f8cc0aa8496
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
2012-08-10 09:15:38 -07:00
Ying Wang
3f7246a081 Delete unused variable.
Change-Id: I17f0e2c0b911e505c7ddd3c9c9c56e8a38239e17
2012-05-16 10:16:49 -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
Dima Zavin
8e4042cc79 Revert "core: the device/board/product kernel headers will be auto-generated"
This reverts commit 992a52990c.

Change-Id: I9919f13705509a793f856da8ef7207b3feb47092
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-30 10:46:28 -07:00
Dima Zavin
992a52990c core: the device/board/product kernel headers will be auto-generated
So, just add the output include directory to the include path

Change-Id: Ia370454237913a748288124f65a6b731b17d6e1a
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-19 12:32:08 -07:00
Ying Wang
89686538d7 Support to build factory ramdisk image.
Bug: 5769921

With this change, to build factory_ramdisk.img, set
PRODUCT_FACTORY_RAMDISK_MODULES in your product config.
PRODUCT_FACTORY_RAMDISK_MODULES consists of
"<module_name>:<install_path>" pairs.
<install_path> is relative to the root of the factory ramdisk output.
For example:
PRODUCT_FACTORY_RAMDISK_MODULES := \
    toolbox:bin/toolbox adbd:sbin/adbd adb:bin/adb

On the other hand you can use PRODUCT_COPY_FILES to copy prebuilt files
to the factory ramdisk.
Or you can define modules that are specific for the factory ramdisk
(with LOCAL_MODULE_PATH pointing to TARGET_FACTORY_RAMDISK_OUT) and add
the module names to PRODUCT_PACKAGES.

Change-Id: I80ff72606415cd74fe6f3bc93020a05d84e45b70
2011-12-16 13:54:10 -08:00
Jean-Baptiste Queru
316febd715 am 78b68045: am ffe03c98: Set OUT_DIR based on a common base path
* commit '78b680458b3ba53fb2f88a603e371c002eb8944b':
  Set OUT_DIR based on a common base path
2011-12-06 22:53:44 -08:00
Jean-Baptiste Queru
ffe03c984b Set OUT_DIR based on a common base path
Change-Id: I2c4ba8b101d4d186ed4b371b9d07b3bcf75bbcc9
Author: Jean-Baptiste Queru<jbq@google.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-12-06 14:36:49 -08:00