Commit graph

278 commits

Author SHA1 Message Date
Carmen Jackson
45b9d751ab Add init_rc as a property to the debuggable product_variable.
am: 6fe956b129

Change-Id: Ibc6fdb7235b56efda5c62eb91e7a03a732c57427
2017-04-18 23:47:44 +00:00
Carmen Jackson
6fe956b129 Add init_rc as a property to the debuggable product_variable.
Bug: 37110010
Test: See related change - verified manually that the default init_rc
file as well as the 'debuggable' init_rc file were executed.

Change-Id: Id6a51201cf10633e9a86d2c76a3e64b50225bf55
2017-04-14 15:43:02 -07:00
Dan Albert
30c9d6e771 Generate file to map codenames to API levels.
The NDK stub library generator needs to know what unreleased API
levels exist and what the ordering is between them. This singleton
will later be expanded to generate api-level.h to cut down on
duplication.

Test: make out/soong/api_levels.json && cat out/soong/api_levels.json
Bug: None
Change-Id: I53126dd2cacb67c331c44f7d7c77c98b176b93cd
2017-03-31 12:27:42 -07:00
Dan Willemsen
615609854f Revert "install *.so in different paths for their types"
This reverts commit 4c48f724e1. It's
causing test failures, warnings and complaints, so backing it out and
we'll resolve those before putting it back in.

Bug: 33681361
Test: m -j
2017-03-16 19:48:32 -07:00
Jiyong Park
4c48f724e1 install *.so in different paths for their types
Shared libraries are now installed to different directories depending on
their types.

* NDK libraries: /system/lib/ndk
* VNDK libraries: /system/lib/vndk
* VNDK-ext libraries: /system/lib/vndk-ext
* Framework-only libraries: /system/lib
* Vendor-only libraries: /vendor/lib
* Same-process HALs: /vendor/lib/sameprocess

In addition, a new module type vndk_ext_library is added. It is almost
identical to cc_shared_library but it introduces another attribute
'extends'. This is use to reference the vndk library that this vndk-ext
library is extending.

For example, in order to extend a vndk library libFoo:

cc_library {
  name: "libFoo",
  srcs: [...]
}
---------------------
vndk_ext_library {
  name: "libFoo-extended",
  srcs: [...]
  extends: "libFoo"
}

Then, libFoo will be installed as /system/lib/vndk/libFoo.so and
libFoo-extended will be installed as /system/lib/vndk-ext/libFoo.so.
Note that file name of the latter is libFoo.so, not libFoo-extended.so:
file name of an extending module is automatically set to that of the
extended module.

Bug: 33681361
Test: build & run. Libraries must be in the correct directories.
Change-Id: Ia1eb3940605d582a252c78da0f3a5b36fdab062b
2017-03-14 09:13:44 +09:00
Ryan Campbell
469a18aae2 Support path exclusion for native coverage.
Specify list of paths to exclude from coverage instrumentation.

Test: make NATIVE_COVERAGE=true COVERAGE_PATHS=hardware/interfaces
COVERAGE_EXCLUDE_PATHS=hardware/interfaces/graphics
Bug: 35769817

Change-Id: I3bf10e5e5697d140d6cff73d000768b00aa28ca4
2017-02-27 11:08:34 -08:00
Colin Cross
d2906e5deb Remove cpusets and schedboost product variables
They are no longer needed, remove them.

Bug: 35129304
Bug: 35128496
Test: builds
Change-Id: Ib144ddc2db40bc4f38a4e06ca40eabe85814e03c
2017-02-23 09:44:22 -08:00
Dan Willemsen
581341d4f2 Native Coverage support in Soong (gcov)
This is configured the same as make -- a global NATIVE_COVERAGE=true
flag to allow native coverage, then COVERAGE_PATHS=path1,path2,... to
turn it on for certain paths.

There are .gcnodir files exported to Make and saved in $OUT/coverage/...
files which are `ar` archives containing all of the compiler-produced
.gcno files for a particular executable / shared library.

Unlike the Make implementation, this only passes links the helper
library (automatically through --coverage) when one of the object files
or static libraries being used actually has coverage enabled.

Host support is currently disabled, since we set -nodefaultlibs, which
prevents libclang_rt.profile-*.a from being picked up automatically.

Bug: 32749731
Test: NATIVE_COVERAGE=true COVERAGE_PATHS=system/core/libcutils m -j libbacktrace libutils tombstoned
      $OUT/coverage/system/lib*/libcutils.gcnodir looks correct (self)
      $OUT/coverage/system/lib*/libbacktrace.gcnodir looks correct (static)
      $OUT/coverage/system/lib*/libutils.gcnodir doesn't exist (shared)
      $OUT/coverage/system/bin/tombstoned.gcnodir looks correct (executable)
Test: NATIVE_COVERAGE=true COVERAGE_PATHS=external/libcxxabi m -j libc++
      Confirm that $OUT/coverage/system/lib*/libc++.gcnodir looks correct (whole_static_libs)
Change-Id: I48aaa0ba8d76e50e9c2d1151421c0c6dc8ed79a9
2017-02-14 13:05:48 -08:00
Jack He
ee8e7a7a2c Removed Bluetooth build variables from the soong build parser
* Removed BLUETOOTH_HCI_USE_MCT
* Removed BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED

Bug: 34951912, 35203653
Test: Code compilation, no visible user effects
Change-Id: I89af075a334f2ec7b2a3046a4aaa5bcc19d454e0
2017-02-09 14:36:09 -08:00
Vishwath Mohan
1b017a76e1 Hide CFI behind a global flag.
This CL ensures that locally enabling CFI in a .bp file is not honored
unless it is enabled globally using ENABLE_CFI=true first, effectively
hiding it behind a flag.

Bug: 30227045
Bug: 22033465
Test: m -j40 works and device boots
Test: cfi is correctly honored only when the global flag is set.
Change-Id: Iccc6e4bf5e7828ab8ce6056f3e40922712faa0d8
2017-01-19 14:40:34 -08:00
Jack He
8cc714313c Add Android.bp variables to the soong build parser
* BtConfigIncludeDir: BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR
* BtHcilpIncluded: BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED
* BtHciUseMct: BLUETOOTH_HCI_USE_MCT

Bug: 32958753
Test: Code compilation, no user visible effects

Change-Id: I0dc53172ee823e4e0fa69749e1297713796538cf
2017-01-11 16:07:44 -08:00
Hiroshi Yamauchi
e2a106353f Add ArtUseReadBarrier to ProductVariables.
Bug: 33492005
Test: top-level angler build.
Change-Id: Ib04284bac923a143038655d495bcbacaabf61440
2016-12-19 15:31:32 -08:00
Colin Cross
6bc59ef731 Support eng product variable
The eng product variable will be true for builds where
TARGET_BUILD_VARIANT==eng.

Test: mmma -j frameworks/compile/libbcc
Change-Id: I808129740643495370bea64df3fe5bcf01eb9915
2016-12-08 09:46:35 -08:00
Dan Willemsen
4353bc4422 Support system/vendor for devices without a vendor partition
Test: lunch aosp_arm-eng; m -j vulkan.default
Change-Id: I91eabf98f53c455ec4ade95215f11a6f89631747
2016-12-05 17:21:13 -08:00
Dan Willemsen
d2ede879b5 Add basic VNDK support in Soong
Export a list of libraries in the VNDK, which is currently empty.

Take in Make's global BOARD_VNDK_VERSION, and use that as the SDK
version for modules that specify use_vndk: true.

Modules that use the vndk have some configuration as if they were
building against the NDK (the absence of globally defined headers), but
in other cases look like platform modules (using the platform libc++,
for now).

This change does not attempt to enforce any linking constraints, that
will come in a later patch.

Test: out/soong/build.ninja doesn't change
Change-Id: I3be206b67015ac5177b7eef4a451c579e3dc903f
2016-11-28 13:45:24 -08:00
Dan Albert
22c0b4131d Fix the Platform_sdk_version default.
N has merged into aosp now.

Test: OUT_DIR=ndk-out DIST_DIR=ndk-dist \
          build/soong/scripts/build-ndk-prebuilts.sh
Bug: None

Change-Id: I2685c700e2cb138708a3e8a5f51281c30fb582db
2016-11-10 11:11:07 -08:00
Colin Cross
23ae82a2b2 Support sanitizing a single device arch
Allow specifying one or more architectures to sanitize for.  Defaults to
sanitizing all architectures.  Allows reducing the cost of sanitization
by only sanitizing half of the platform.

Bug: 29498013
Test: No change to build.ninja files with m -j SANITIZE_TARGET=address
Test: m -j SANITIZE_TARGET=address SANITIZE_TARGET_ARCH=arm
Test: nm -D $OUT/system/bin/app_process64 | grep asan, no asan symbols found
Change-Id: I972cccc2f19443895d47b44bd8104105f93ffb7d
2016-11-02 15:18:19 -07:00
Dan Willemsen
a03cf6d322 Add clang-tidy support
For every file which we can run clang-tidy (C/C++ clang-built), we add a
new build node that depends on the object file (since clang-tidy does
not export a depfile), and is depended on by the link step. This is
better than how we're doing it in make, since calling tidy can be turned
on or off without needing to rebuild the object files.

This does not attempt to port WITH_TIDY_ONLY from Make, since the way
that it works is broken (due to the lack of a depfile).

Bug: 32244182
Test: WITH_TIDY=true mmma -j bionic/libc
Test: ./soong (Setting ClangTidy: true)
Change-Id: I40bbb5bb00d292d72bf1c293b93080b5f9f6d8ea
2016-10-31 16:21:01 -07:00
Dan Willemsen
7b872837c6 Allow brillo cflags and debuggable cppflags
Test: mmma -j frameworks/native/{libs/gui,opengl/libs} w/Android.bp
Change-Id: I31286c92ec4befaa486052ba2e6d55cd0d5fe62d
2016-10-17 14:50:08 -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
fcebcd5c37 Add debuggable product variable with cflags
Allows changing cflags based on the build variant being `eng` or
`userdebug`. This is used by some modules to turn on asserts for these
builds, and used by adb to allow root on non-user builds.

Test: Use this flag in an Android.bp, check the ninja file.
Change-Id: I27a5081378e94920482b4a742d65c46065047573
2016-09-22 15:22:15 -07:00
Colin Cross
9d45bb78c5 Enable goma in soong
When the UseGoma flag is set, put all rules except the C compilation
rule in an externally defined local_pool, which will have been created
by kati.  The gomacc wrapper will already be in the CC_WRAPPER
environment variable.

Bug: 31142427
Change-Id: I699d4edff2e302eee398dad8692ceb14721a628c
2016-08-31 09:48:08 -07:00
Colin Cross
1e7d3706d6 Add support for preferred arch symlinks
Add a symlink_preferred_arch property to binaries to allow compiling the
binary for multiple architectures and then creating a symlink to the
preferred archicture, for example dalvikvm32 and dalvikvm64, with
dalvikvm symlinked to dalvikvm64.

Test: mmma -j art/dalvikvm
Change-Id: Ied15f2be9d52c01006fe8ac207c175b78558eab1
2016-08-25 22:42:02 +00: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
Dan Willemsen
1be3538862 Add Binder32bit product variable
To allow cflag changes when using the "old" binder API that are still
used by all 32-bit only configurations. We can't just use
android32/android64 here, since some devices use a 64-bit kernel with a
32-bit userspace, which is configured as "android32".

Change-Id: I8450484b75d59c1855c7ba36260c08925e7b28ad
2016-07-26 23:03:47 +00:00
Dan Willemsen
5951c8a3a9 Use PlatformSdkVersion from Make
This doesn't need to be hardcoded, and should be updated anyways.

Change-Id: Ie28d0d7655e8db3c02d110ae578a763a69b73f92
2016-07-19 19:17:52 -07:00
Dan Willemsen
a6f7d15609 Add product variables: cpusets schedboost
These are used by libcutils, and are equivalent to the ENABLE_CPUSETS
and ENABLE_SCHEDBOOST make variables.

Change-Id: I65d0eed49b5bcb4d6415e9e64a0159209a43b922
2016-07-12 15:41:09 -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/variable.go (Browse further)