Commit graph

75 commits

Author SHA1 Message Date
Colin Cross
0801633173 Do not duplicate arch properties when cpu variant == arch variant
build/make/board/generic_mips/BoardConfig.mk sets
TARGET_CPU_VARIANT := TARGET_ARCH_VARIANT, which can cause the same
variant-specific properties to be applied twice.

Test: lunch aosp_mips-eng && mmma -j external/skia TARGET_ARCH_VARIANT=mips32r2dspr2-fp
Change-Id: Ie4abe804f8ce898bf89664ae749b9bc8ac3e649f
2016-12-20 09:53:14 -08:00
Colin Cross
bb2e2b7d7f Support arm_on_x86 properties
Allow Android.bp files to set properties when an x86 device supports
arm abis.

Test: lunch aosp_fugu-userdebug && mmma -j frameworks/compile/libbcc
Change-Id: Ic142a3f93175924a826dea9908b2e5183a486184
2016-12-08 17:27:25 -08:00
Dan Willemsen
00fcbde401 Add LinuxBionic OsType
Actual support will come in later changes.

Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: I31392fb78a51f43567d16aef89e32cd5137cdbc1
2016-11-17 01:49:50 -08:00
Dan Willemsen
0a37a2a2b8 Encode default enabled state in OsType
Currently our only default-disabled Os is Windows since it's HostCross,
but we'll be adding non-default Host and Device types in the future.

Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: I2bc3a3cc76f2c95ea040bc34ba6706fcc178c68d
2016-11-17 01:49:39 -08:00
Dan Albert
4098deb0b8 Add an NDK ABIs mega build configuration.
The NDK needs generic prebuilts for all architectures.

Test: echo '{ "Ndk_abis": true }' > soong.config && \
          ./soong $OUT_DIR/ndk.timestamp
Bug: None

Change-Id: I2ee3ebbf4cbd1bc593f9e4e9fb44fb66711da9d5
2016-10-19 14:33:37 -07:00
Colin Cross
1e676bef94 Control mutator order
Register mutators inside lambdas that are called in a defined order to
correctly order mutators before and after the arch and deps mutators.

Test: build.ninja identical
Change-Id: Iefe2a3515aee8570e76a6e76925db4cda0e9e822
2016-10-12 15:33:33 -07:00
Dan Willemsen
0b24c74fcb Disable cc_benchmark for Darwin hosts
The google-benchmark library is disabled on Darwin, so we cannot create
host benchmarks. Instead of having every user specify this, put the
logic in Soong. Then if we decide to support it later, it's an easier
switch.

Test: build.ninja identical before/after on Linux
Test: Ignores failing cc_benchmark_host on Darwin
Change-Id: I61f3a571fd160d8e479a512992bc68601f1c9b28
2016-10-04 15:20:16 -07:00
Colin Cross
628a88c951 Fix windows builds
Windows builds have the first arch set to x86 and the second set to
x86_64, and always prefers 32-bit.  Specify the 32-bit preference
manually, instead of relying on the architecture order for now.

Change-Id: I1900ec095e7773f68c0db293bfc48bd0815661b2
2016-09-13 15:15:51 -07:00
Colin Cross
8b74d17220 Fix binaries and symlinks for prefer32
Track the primary architecture selected for each class based on the
module's multilib setting and the global config.  Fixes building
binaries with multlib set to first and DevicePrefer32BitExecutables set,
and fixes symlinks to binaries with multilib set to prefer32.

Bug: 31452121
Test: mmma -j art HOST_PREFER_32_BIT=true
Change-Id: I75094df42f3273f6d613e4058eaa565957174c28
2016-09-13 10:01:45 -07:00
Dan Willemsen
b1957a5021 Dynamically generate arch struct
Now we don't need to hardcode the list of OS/Arch/Variant/Features in
android/arch.go.

Change-Id: I0f9cc35d55baa31f036825fdf5b9dd30d076e56e
2016-09-08 13:50:36 -07:00
Colin Cross
69617d3b7d Extend multilib
Allow multilib to be set to "prefer32", which will compile as 32-bit if
available, otherwise as 64-bit.

Add target.device.compile_multilib and target.host.compile_multilib.  If
set, they override the top-level compile_multlib property.

Change-Id: If658a035b5f441547bc74526feb1d34f773776ff
2016-09-06 13:26:37 -07:00
Colin Cross
a120ec1c5e Add PropertyCustomizer
Allow any module factory to insert a PropertyCustomizer on the module,
which will be called before any other mutators.  The PropertyCustomizer
can append or prepend to any properties, allowing module types to extend
other module types by modifying the public, stable interface provided by
the properties.

Change-Id: Idff02be80d939a70df1c6bbccffdd1f04ff975d2
2016-08-22 17:08:06 -07:00
Colin Cross
9272ade7a8 Add DeviceConfig and OncePer objects
Add DeviceConfig to store per-device configuration information.  Put a
OncePer object inside Config and DeviceConfig, which computes a value
once per key per object to allow build logic to store arbitrary
per-build or per-device computed values.

Change-Id: I1a38b426f29d223ef5e803e0d4d9604500de2fd2
2016-08-17 16:39:06 -07:00
Colin Cross
76f2f97c51 Make defaults TopDownMutator parallel
Append .Parallel() to the defaults RegisterTopDownMutator call to tell
Blueprint it can run it in parallel.  Saves ~500ms in soong_build.

Change-Id: I43ddd9d6995674ccc06fed6928514f15a15712c1
2016-08-11 17:15:07 -07:00
Colin Cross
e8a67a7c58 Make BottomUpMutators parallel
Append .Parallel() to all of the RegisterBottomUpMutator calls to tell
Blueprint it can run them in parallel.

Test: identical build.ninja, passes race detector
Change-Id: I969a0689522d4cba7c8ff51e2aa00fe2fd338a89
2016-08-11 13:20:16 -07:00
Colin Cross
1317701114 Convert defaults to a top down mutator
BottomUpMutators are going to lose their ctx.Visit* functions in order
to allow parallelizing them, move defaults to a TopDownMutator using
WalkDeps to only visit defaults modules.

Test: no changes to out/soong/build.ninja
Change-Id: I54ba65a7e2ae9503f4d217f63aa9178a7c5341f0
2016-08-09 13:54:03 -07:00
Colin Cross
62496a0d2e Use nil pointers for arch property structs
Blueprint can now handle creating a zero-valued struct when it
encounters a nil pointer to a struct, reducing the amount of allocations
and copying for arch structures that are not used.

Change-Id: If36da5603dbe6469fe6406c821f21a122ea6ea49
2016-08-08 15:56:19 -07:00
Colin Cross
e7b07137d4 Allow defaults modules to have defaults
Allow chaining defaults modules by making Defaults be a Defaultable.

Change-Id: I4ba86c07f7aad9c396ed33d55fe95d1fb78e487d
2016-07-27 10:15:06 -07:00
Dan Willemsen
65fb981814 Fix Mega_device build
Change-Id: I128d013ef7c1cb0afa71dc011bf5d4180f468a1b
2016-07-19 21:37:28 -07:00
Dan Willemsen
3f32f03067 Support no configured device architectures
There are some builds where we only want to build host tools, and we may
not have a valid device configuration. Support 0 device architectures
and modules that don't have any configured way to build.

Change-Id: I732251e1cd3cdbfafbc6ef6a550e33e653876f7c
2016-07-11 14:36:48 -07:00
Colin Cross
a1ad8d1889 Simplify arch target handling
Soong's multi-architecture building has grown complex, with the
combination of HostOrDevice+HostType+Arch necessary to determine how to
build a variant of a module, and three separate mutators to split each
into its variations.

Combine HostOrDevice+HostType into Os, which will be Linux, Darwin,
Windows, or Android.  Store Os+Arch as a single Target.

Change-Id: I92f2e2dac53617d595a35cc285d2bd348baa0fbd
2016-06-02 19:09:32 -07:00
Colin Cross
b9db480385 Revert "Simplify arch target handling"
This reverts commit 6713fb26cbcadf525cd75e47d7d0cbc23d282b3e.

Change-Id: Ic473cea2563b0b37dc08b0bc5d3a0ac8c4b6afe6
2016-06-03 01:50:47 +00:00
Colin Cross
54c7112c43 Simplify arch target handling
Soong's multi-architecture building has grown complex, with the
combination of HostOrDevice+HostType+Arch necessary to determine how to
build a variant of a module, and three separate mutators to split each
into its variations.

Combine HostOrDevice+HostType into Os, which will be Linux, Darwin,
Windows, or Android.  Store Os+Arch as a single Target.

Change-Id: Iae677eff61a851b65a7192a47f2dc17c1abb4160
2016-06-02 17:37:02 -07:00
Dan Willemsen
17f052647f Support installing non-native arch binaries
For the x86_arm target, which uses two 32-bit architectures, x86
libraries should be installed into ".../lib", and arm libraries should
be installed into ".../lib/arm".

This shouldn't be necessary for binaries, but non-native binaries aren't
supported in Make right now, so we can revisit this once it's necessary.

Change-Id: I4d883c85d3ef4945ff6149d9c4fc81af5023e12b
2016-05-31 16:27:00 -07:00
Colin Cross
635c3b0157 Rename common to android
Rename the "common" package to "android", because common is too
generic.  Also removes all android.Android naming stutter.

Ran:
gomvpkg -from 'android/soong/common' -to 'android/soong/android'
gorename -from '"android/soong/android".AndroidModuleContext' -to 'ModuleContext'
gorename -from '"android/soong/android".AndroidBaseContext' -to 'BaseContext'
gorename -from '"android/soong/android".AndroidModuleBase' -to 'ModuleBase'
gorename -from '"android/soong/android".AndroidBottomUpMutatorContext' -to 'BottomUpMutatorContext'
gorename -from '"android/soong/android".AndroidTopDownMutatorContext' -to 'TopDownMutatorContext'
gorename -from '"android/soong/android".AndroidModule' -to 'Module'

Change-Id: I3b23590b8ce7c8a1ea1139411d84a53163288da7
2016-05-18 15:37:25 -07:00
Renamed from common/arch.go (Browse further)