Use a variable for module.base() and separate the full list of
targets for the class from the filtered list of targets for the
module.
Test: m checkbuild
Change-Id: I32edd26bcbaff0baf433d0581f253b8a5c8b81f3
Binaries that use multilib "first" expect zero or one architectures
because they will install to the same bin directory for any
architecture. Replace preferTargets with firstTarget that always
returns zero or one Target.
Test: OUT_DIR=out_ndk build/soong/scripts/build-ndk-prebuilts.sh
Test: m checkbuild
Change-Id: I6dcfa9ecda30177e1a262153d93a5a205d5c7076
Remove the ability for Soong to build 32-bit darwin code. We've already
disabled this in Make, this is just removing the unused bits in Soong
and simplifing the toolchain config.
Test: m host
Test: build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I968c5d98bdf162297d639f7988918dadb7ba6e07
To save space, only the primary arch variant is installed to the
recovery partition. This has been done in the imageMutator by not
creating recovery variant for the non-primary arch.
However, this caused a problem for recover-only module, i.e., recovery:
true. Such module ends up creating no variant for the non-primary arch.
Since every other modules are at least in one image variant, any
dependency fro such module with no image variant can't be satisfied.
In order to solve the problem, archMutator is modified to create only
the primary arch for recovery-only modules.
Bug: 111321972
Test: m -j (TestRecovery added)
Change-Id: Ie32ae06fb094efcfd8531cdf6071139d292d93ab
Bug: 78133793
Bug: 78242072
Test: Builds when using cortex-a75 as a target.
Change-Id: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
Merged-In: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
(cherry picked from commit 0612597a41)
All access to these should be going through the methods on Config /
DeviceConfig.
Bug: 76168832
Test: m blueprint_tools
Change-Id: I47512dd58fb1a1a3f25838a9b1adaed2c41af8d3
We only define arm_on_x86 in the x86 code, but sometimes arm code needs
to know that it's working in the emulated mode, too.
Test: CtsRsCppTestCases
BUG=75971275
Change-Id: I99564fbe9aeb284e2f11ffb593b18536a7755ea5
This architecture only existed for unbundled use, but even the NDK is
removing support in their r17 release, so just remove support for it.
Test: build/soong/build_test.bash -only-soong
Change-Id: I4bd23babf567128d2d242cbdee3311abb198dd7c
We don't support armv5 any more, and we can't build bionic as armv5.
Test: build/soong/scripts/build-ndk-prebuilts.sh
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: I4026d48e7d5db78f6aa4e9796da1ec9cf10021ca
Add a common_first multilib type and use it for java.Binary
so that the java part is compiled as a "common" arch type
but the wrapper script is installed as a "linux_glibc" arch
type. This allows java_binary to be used as a tool dependency
for a genrule.
Bug: 68397812
Test: TestJavaBinary
Change-Id: I809060839ce8878300da3fb76426ceb1ea6b0e8e
AConfig() now duplicates Config(). Replace the uses of AConfig()
with Config(). Leave AConfig() for now until code in other
projects is cleaned up.
Test: m checkbuild
Change-Id: Ic88be643049d21dba45dbd1a65588ed94bf43bdc
This reverts commit 5c3c768187.
This reapplies I70e45caa92f65dc6a3bc81ae33a5a8f34ad11890 along with
additional changes in other projects to match the new types.
Bug: 68337468
Test: m checkbuild
Change-Id: I2d2d876b291869f834a6468d3e2ad99148f94a15
Switch commonProperties to *string and *bool so that defining them
in a module correctly overrides instead of appends to values set
in defaults modules.
Bug: 68337468
Test: m checkbuild
Change-Id: I70e45caa92f65dc6a3bc81ae33a5a8f34ad11890
Once this is submitted and we don't have any more references to
target.linux, it can be added back as a common target for all
linux-kernel based targets.
Test: m nothing
Change-Id: Iae5e82eaed65f58950115f21530ae04afd0602b9
Arch specific properties were not being applied to modules
with OS set to Common.
Test: java_test.go
Change-Id: I8f1b49ca51b0cf96f78006dfcd121672e581d9c5
target.linux_glibc will apply to host builds with glibc, which is
identical to the current target.linux. In a future change, target.linux
will change to affect all targets using the Linux kernel (android,
linux_bionic, and linux_glibc).
target.bionic will apply to all OS variants using Bionic.
Bug: 31559095
Test: Add target.linux_glibc, target.bionic sections to an Android.bp, build
Test: m host
Change-Id: I677a67c22fba148fec264132311e355283f9d88d
Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.
Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
Descriptions currently look like:
[ 0% 4/29328] cc out-soong/.intermediates/external/clang/lib/Sema/libclangSema/android_arm_armv7-a-neon_denver_static_core/obj/external/clang/lib/Sema/SemaCodeComplete.o
This is not very helpful - most of the characters are used to show the
output path, which contains useful information like target architecture,
but also contains most of the path to the source files twice, and less
useful information like the exact variant name used by soong.
Make the descriptions look like:
[ 0% 3/29329] //external/clang/lib/Sema:libclangSema clang++ SemaTemplateInstantiate.cpp
This is //path/to/module:modulename tool relative/path/to/source/file
Test: builds, looks pretty
Change-Id: I3087aa7d4eb1860ef6239d77407b8b35445616d7
The base module handles all the common functionalites, such as version
compatibilty check, version variations split, source file format check,
source/data file duplicate check.
The library/binary module focuses on how to generate binary build actions,
such as setting up stub script, zipping, filling in __init__.py in
runfiles dir tree.
Bug: b/31676493
Test: go test under python package
Change-Id: I06608369f350f7195873d459e1c8d1bdb811e77e
Current modules must use armv7_a_neon to specify source files that
compile only with neon. If a future arch variant also supports neon,
all these modules will fall back to non-neon. Support a neon arch
feature that modules can use instead. Similarly, support dspr2 for
mips.
arm_device.go was also mixing armv7-a-neon with armv7_a_neon. Use
armv7-a-neon consistently, and fix the - to _ when creating the
property structs.
Test: m -j checkbuild
Change-Id: I24d3764280ab3bcbb9a73c0934edc9b99fc7f6a0
Enable arm_on_x86 mode whenever compiling for x86 on the device,
and either arm is listed as an ABI on the x86 arch, or arm exists
as a target arch.
Bug: 35286489
Test: examine bcc cflags
Change-Id: Iebd0e7b95f584d25773a60474c27425cac7a578e
* Use mcpu=cortex-a57, since it is the closest to Kryo.
* Clang doesn't support Kryo as a target yet.
Bug: 36728278
Test: Built and booted a sailfish using Kryo.
Change-Id: Ic0c9588d86fba41896e50e3f0cf0d2b310ffee93
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
* Kryo is closer to Krait than to cortex-a53, so choose Krait defaults.
* Made together with Jake Weinstein (xboxfanj)
Bug: 36728278
Test: Built and boot sailfish set up as kryo.
Change-Id: I04fa0a1dca6f97ae19202d28ee3ce8a59bf169b5
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
This adds a toolchain definition for LinuxBionic that only supports
Clang/64-bit. It pulls pieces from the x86_linux_host and x86_64_device
configs, and uses the android clang triple, with some manual overrides.
To enable building this, set your soong.config file to:
{"Host_bionic": true}
Bug: 31559095
Test: out/soong/{Android,make-vars}-aosp_arm64.mk the same with or
without host bionic turned on
Test: No change to out/soong/build.ninja before/after this change
Change-Id: Id97dda8bd9aa670c32aed31fbe6aaa8175e70b59
This breaks when I enable a second host configuration for host bionic.
Make non-arch modules !Device and !Host by adding "Generic" as the zero
value. Make the SkipDeviceInstall config only apply to Device modules.
Test: out/soong/build.ninja is identical expect for comments
Change-Id: I6e2bd3814a9968554d3901a508d822d5c79d08a0
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
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
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
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
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
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
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
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
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
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
Append .Parallel() to the defaults RegisterTopDownMutator call to tell
Blueprint it can run it in parallel. Saves ~500ms in soong_build.
Change-Id: I43ddd9d6995674ccc06fed6928514f15a15712c1
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
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
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
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
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
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
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