Commit Graph

197 Commits

Author SHA1 Message Date
Rajeev Kumar 6f80dfd857 Merge "Add product_variables.Use_lmkd_stats_log." into pi-dev
am: f65a99cee1

Change-Id: I235eb051a60b01039f4ee2b3dcb41802fa81b797
2018-03-26 23:33:53 +00:00
Rajeev Kumar 423e2db0f9 Add product_variables.Use_lmkd_stats_log.
Bug: 74443701
Test: Tested manually
Merged-In: I512d1a4b5e796b459a7ecdd3649ffd147bcf4cbf
Change-Id: I512d1a4b5e796b459a7ecdd3649ffd147bcf4cbf
(cherry picked from commit 1e6056a380)
2018-03-23 19:47:10 +00:00
Dan Willemsen 04f97ce059 Remove obsolete Brillo variable am: a052599bb6
am: 567eda6a7d

Change-Id: I69edc621c71a4a5dc80595392b8914e1cca07e52
2018-03-12 22:04:12 +00:00
Dan Willemsen a052599bb6 Remove obsolete Brillo variable
Test: none
Change-Id: I6a5ce57b317f0cdae1abef15def01e6a31e18d3e
2018-03-10 15:29:03 -08:00
Nan Zhang bfef411697 Droiddoc Support in Soong am: 581fd21e91 am: 2ea76706b3
am: a400bb400c

Change-Id: I5c317052e5b1cba68e04720db75cb07cdd7ca0f7
2018-02-22 23:25:14 +00:00
Nan Zhang 581fd21e91 Droiddoc Support in Soong
Support Droiddoc to Soong based on core/droiddoc.mk. The non-std doclet
based droiddoc compilation output is a "real" stubs.jar instead of a
directory of java files and a timestamp file.

The std doclet based javadoc compilation output is a "empty" stubs.jar
instead of a timestamp file.

The stubs.jar will be exported to
out/target/common/obj/JAVA_LIBRARIES/$(LOCAL_MODULE)_intermediates/classes.jar
and out/target/common/docs/$(LOCAL_MODULE)-stubs.jar

A $(LOCAL_MODULE).zip file will be generated also, and is exported to
out/target/common/docs/$(LOCAL_MODULE)-docs.zip if property: installable is not set
to false.

Bug: b/70351683
Test: unittest + convert libcore docs Android.mk to Soong manually.

Change-Id: I1cffddd138a5d9d445f86a3d4a3fd4de88a2bc0f
(cherry picked from commit 78188ec622cb1ee24171455867fc58ffab91562e)
2018-02-22 11:14:13 -08:00
Pirama Arumuga Nainar beb1452783 Search for PGO profiles in PGO_ADDITIONAL_PROFILE_DIRS am: 49540800f0 am: 8f7ea0ebdd
am: 0ee536259f

Change-Id: I6b767ab0b947054ce3264ce0cf478c4d0403bb38
2018-02-13 21:15:24 +00:00
Pirama Arumuga Nainar 49540800f0 Search for PGO profiles in PGO_ADDITIONAL_PROFILE_DIRS
This variable can be set in BoardConfig.mk to specify a list of
additional paths that contain PGO profiles.  These directories are
searched after the predefined paths in soong/cc/pgo.go while finding
PGO profiles.

Test: Set this variable in a BoardConfig and verify that such profiles
are found and that these paths are searched after the predefined paths
in soong/cc/pgo.go.

Change-Id: I0bb9523de614d0f23aba8d51c887d8fc8f41c993
2018-02-13 09:41:13 -08:00
Jaekyun Seok e3e265939f Use product instead of oem for Product specific module am: 5cfbfbb67a am: 2b6236308b
am: be16d5e84f

Change-Id: I6ee908710e7d7b7fe9d3ce7e6c43287e3e8c0835
2018-01-25 04:17:04 +00:00
Jaekyun Seok 5cfbfbb67a Use product instead of oem for Product specific module
Bug: 64195575
Test: succeeded building product.img with BOARD_PRODUCTIMAGE_PARTITION_SIZE,
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE and PRODUCT_PRODUCT_VERITY_PARTITION.
Change-Id: Icc4f8c16bc389fe20db680849f311d02df1299c3
2018-01-25 07:50:35 +09:00
Jiyong Park 596229feb4 Merge "Add PLATFORM_SYSTEMSDK_VERSIONS and BOARD_SYSTEMSDK_VERSIONS" am: d89f6621ae am: ee33e88111
am: a64cc46798

Change-Id: Ic3ea155a5f5dda891d59da2b9921f3cd5af96ddc
2018-01-23 19:00:09 +00:00
Ivan Lozano 8704d606cb Merge "Revert "Support enabling overflow sanitization by path."" am: e021b0405d am: a8388ac9e6
am: 0370b8c419

Change-Id: I04330526423727b61697734c3cf160e93a6ccfc4
2018-01-20 04:05:46 +00:00
Ivan Lozano b7d0f52337 Revert "Support enabling overflow sanitization by path."
This reverts commit 17df3c1b76.

Change-Id: Id5dab777da591c24113c3048b8606547a661afdd
2018-01-20 01:44:38 +00:00
Ivan Lozano bb20d98bb7 Merge "Support enabling overflow sanitization by path." am: c1fecc2dfa am: a613b55860
am: cbc5232329

Change-Id: I99e120a4e5442bf2715ffce7f2ac69c60085140b
2018-01-19 16:07:51 +00:00
Jiyong Park 1a5d7b1539 Add PLATFORM_SYSTEMSDK_VERSIONS and BOARD_SYSTEMSDK_VERSIONS
PLATFORM_SYSTEMSDK_VERSIONS is the list of System SDK versions that the
platform is supporting. Contrary to the public SDK where platform
essentially supports all previous SDK versions, platform support only a
few recent System SDK versions, since some of old System APIs are
gradually deprecated, removed from the following SDKs and then finally
deleted from the platform. This will be part of the framework manifest.

The list can be specified by setting PLATFORM_SYSTEMSDK_MIN_VERSION. If
it is set to an old version number, then System SDKs from the version
to the current version (PLATFORM_SDK_VERSION) are considered to be
supported by the platform. If PLATFORM_SYSTEMSDK_MIN_VERSION is not set,
only the latest System SDK version is supported.

Next, BOARD_SYSTEMSDK_VERSIONS is the list of System SDK versions that
the device is using. This is put to the device compatibility matrix
device is using. The device and the platform is considered as compatible
only BOARD_SYSTEMSDK_VERSIONS in the device compatibility matrix are
in the PLATFORM_SYSTEMSDK_VERSIONS in the framework manifest.

When BOARD_SYSTEMSDK_VERSIONS is set, a Java app or library in vendor or
odm partitions which didn't specify LOCAL_SDK_VERSION  is forced to use
System SDK. Also, the build system does the additional integrity check
to ensure that LOCAL_SDK_VERSION is within BOARD_SYSTEMSDK_VERSIONS or
PLATFORM_SYSTEMSDK_VERSIONS (if BOARD_SYSTEMSDK_VERSIONS isn't set).

Bug: 69088799
Test: m -j
Test: BOARD_SYSTEMSDK_VERSIONS=P m -j
Change-Id: Id38f02b4be86710411be22bc28109e6894f8a483
2018-01-19 15:42:18 +09:00
Ivan Lozano 17df3c1b76 Support enabling overflow sanitization by path.
Handle paths variable provided from Make about where integer overflow
sanitization should be enabled by default, and prepare to enable minimal
runtime diagnostics for integer overflow sanitizers in userdebug/eng builds.

This provides Soong support for on-by-default paths from Make for
integer overflow sanitization.

Bug: 30969751
Bug: 63927620
Test: Include paths passed from Make are being sanitized.
Test: Compilation succeeds with and without diagnostics enabled.
Test: See Make patch for further test notes.

Change-Id: I803a75646cc27ef5b4b5b74b8eb2981c39f8a6a3
2018-01-18 14:16:47 -08:00
Hirokazu Honda 8991335666 [Android.bp] Add cflags, include_dirs, shared_libs ans srcs to ARC++ Product
Test: Compile
Bug: None
Change-Id: I422f2194208ea14e976970de748d6d9238fe9f14
2018-01-17 14:00:33 +09:00
Stephen Hines 51207eb44d Merge "Remove unnecessary DeviceUsesClang." am: 2e020842dc am: 4bf625d7e6
am: 8d7ba61a81

Change-Id: Ibfd4b158180d54607d9b9d7c6de927b071f1d425
2018-01-12 18:49:32 +00:00
Stephen Hines 6ea0f81c3f Remove unnecessary DeviceUsesClang.
This build function is unnecessary now that GCC is completely
unsupported for Android platform builds. It is similar to
USE_CLANG_PLATFORM_BUILD from the build/make side of things.

Bug: http://b/64032869
Test: Builds
Change-Id: Iddf5f91cc997c337c77a644265cb8dc4e5a915b4
2018-01-11 14:29:41 -08:00
Jiyong Park eb7b1a2490 Merge "Add [soc|device|product]_specific" am: 95fba1a8f8 am: 0fffd6bca4
am: 4500bca56d

Change-Id: I6a3457b18df366aec5767ddb98314872e15be124
2017-12-21 18:35:16 +00:00
Jiyong Park 2db7692a74 Add [soc|device|product]_specific
Added three properties (soc_specific, device_specific, and
product_specific) that shows what a module is specific to.

`soc_specific: true` means that the module is specific to an SoC
(System-On-a-Chip) and thus need to be installed to vendor partition.
This has the same meaning as the old `vendor: true` setting.

`device_specific: true` means that the module is specific to the entire
hardware configuration of a device includeing the SoC and off-chip
peripherals. These modules are installed to odm partition (or /vendor/odm
when odm partition does not exist).

`product_specific: true` means that the module is specific to the
software configuration of a product such as country, network operator,
etc. These modules are installed to oem partition (or /system/oem when
oem partition does not exist). These modules are assumed to be agnostic
to hardware, so this property can't be true when either soc_specific or
device_specific is set to true.

Bug: 68187740
Test: Build. path_tests amended.
Change-Id: I44ff055d87d53b0d2676758c506060de54cbffa0
2017-12-21 12:16:29 +09:00
Steven Moreland 35a468eeaf Merge "Remove sepolicy_split from soong." am: 57603998a6 am: 3fac38f544
am: 9bbc5b65e1

Change-Id: I0413a91f87446112d15e692a8a62230647ae48ea
2017-12-20 21:14:35 +00:00
Steven Moreland 0afa55ae12 Remove sepolicy_split from soong.
No longer needed.

Bug: 62019611
Test: manual
Change-Id: Id485e6db4cc9b5a7cf553e5089fd85b667c7c660
2017-12-19 20:41:21 +00:00
Steven Moreland ec1c4d57eb Merge "Remove Treble/PRODUCT_FULL_TREBLE from Soong." am: e565435a7b am: 642948940e
am: 74fc159270

Change-Id: I8079e8d1704de5f465a56c7e9d3190ac687cefb8
2017-12-15 20:25:03 +00:00
Steven Moreland dd0bb0b26c Remove Treble/PRODUCT_FULL_TREBLE from Soong.
This variable is being broken up because it isn't well
defined, and breaking it into smaller components makes
device bringup easier.

Bug: 62019611
Test: nothing uses it
Change-Id: I748958b7276f607f8a711289f3bde163a1a56596
2017-12-15 10:25:48 -08:00
Steven Moreland 631efe9318 Merge "Add split PRODUCT_FULL_TREBLE variables to Soong." am: 4c016b996e am: 3b81e0d9f6
am: 3ca2f36a19

Change-Id: I72f547172e6cac75d46b2b2f90e1ce417b7ad9c7
2017-12-15 17:57:18 +00:00
Steven Moreland c2b9f060d9 Add split PRODUCT_FULL_TREBLE variables to Soong.
As a follow-up to this, Treble will be removed from Soong.

Bug: 62019611
Test: manual
Change-Id: I840e0d6130b834299d0cf3603443cc4c3f7f8e6d
2017-12-13 22:21:46 +00:00
Justin Yun b41da7cd8e Install current VNDK libs to the versioned directories. am: 8fe1212261 am: df323367e7
am: 0de3759433

Change-Id: I70feaaa31fe8b66714cedeede3b6692ed283301f
2017-12-13 03:00:05 +00:00
Justin Yun 8fe1212261 Install current VNDK libs to the versioned directories.
If PLATFORM_VNDK_VERSION has a version $VER other than "current",
install current VNDK libs to /system/lib[64]/vndk[-sp]-$VER.
Otherwise, they will be installed to /system/lib[64]/vndk[-sp].

Bug: 69883025
Test: device boot
Change-Id: Ifa8564f39687dab5b407bf2178b13022625a94f3
2017-12-13 10:47:44 +09:00
Jeff Gaston 729ee1dd4f Revert "Revert "Soong support for namespaces"" am: 088e29ed38 am: 994f9e7a92
am: e2a73fe8f5

Change-Id: Ib4f244a1e2d91b5acbf2dcc251a041ad7798e64d
2017-12-05 04:01:47 +00:00
Justin Yun 3978135eea Install VNDK snapshot libraries for system build am: 7154928c93 am: 702a40d5cd
am: bc90006024

Change-Id: I4bbfc018d62fb67bdad7828fa8a2a2298d4b2369
2017-12-05 01:59:44 +00:00
Jeff Gaston 088e29ed38 Revert "Revert "Soong support for namespaces""
This mostly reverts commit 178d5fefc0
and mostly reapplies change I6d3e52ef62c4cabe85b9a135a54de0e1a6aab29c .

Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm \
      'build/blueprint:work^ build/soong:work^' \
      'build/blueprint:work build/soong:work'
      # and see that the only changes were:
      # 1. adding some new files
      # 2. changing some line numbers
Test: m -j nothing # which runs unit tests

Change-Id: I32baae00277a547fdcdd1c2219fe6625ee0e45d7
2017-12-04 17:44:29 -08:00
Justin Yun 7154928c93 Install VNDK snapshot libraries for system build
When BOARD_VNDK_VERSION := <VNDK version>, or
PRODUCT_EXTRA_VNDK_VERSIONS includes the needed <VNDK version> list,
the prebuilt VNDK libs in prebuilts/vndk/ directory will be
installed.

Each prebuilt VNDK module uses "vndk_prebuilt_shared" for shared
VNDK/VNDK-SP libs.

Following is the sample configuration of a vndk snapshot module:
vndk_prebuilt_shared {
    name: "libfoo",
    version: "27",
    vendor_available: true,
    vndk: {
        enabled: true,
    },
    arch: {
        arm64: {
            srcs: ["arm/lib64/libfoo.so"],
        },
        arm: {
            srcs: ["arm/lib/libfoo.so"],
        },
    },
}

The Android.bp for the snapshot modules will be auto-generated by a
script.

Bug: 38304393
Bug: 65377115
Bug: 68123344
Test: set BOARD_VNDK_VERSION := 27
      copy a snapshot for v27
      build with make command

Change-Id: Ib93107530dbabb4a24583f4d6e4f0c513c9adfec
2017-12-05 10:19:43 +09:00
Colin Cross dfff3da415 Use default app certificate from Make am: 61ae0b7eed am: 9d58bf0610
am: 04585ff7d8

Change-Id: I1918429630415d83b72ab04f630fccc9fba766d7
2017-12-02 04:54:11 +00:00
Colin Cross 61ae0b7eed Use default app certificate from Make
Bug: 69917341
Test: m checkbuild
Test: framework-res.apk is identical after converting to Soong
Change-Id: I6980afd94ea130740da0defeea045eddc2fc6439
2017-12-02 01:26:50 +00:00
Risan ea004dd75f [Android.bp] Add ARC++ product variable
Test: Compile
Bug: 64500663

Change-Id: I92739eb46029f7c808e1f1a928947b3ec596a0b2
2017-11-30 04:20:04 +00:00
Colin Cross aabf67968c Make *Context.Config return a Config instead of a interface{}
In Soong, a Config() method will always return a Config.  Make
ModuleContext, SingletonContext, TopDownMutatorContext and
BottomUpMutatorContext's Config() methods explictly return
a Config to avoid having to type-assert everywhere.  Overriding
the Config method requires duplicating the list of methods in
blueprint.BaseModuleContext and blueprint.BottomUpMutatorContext,
following the same pattern used by the other *Contexts.

Config() obsoletes the AConfig() method used in some places, which
will be cleaned up in the next patch.

Test: m checkbuild
Change-Id: Ibe21efde933959811d52443496967ab8ce71215e
2017-11-30 00:44:11 +00:00
Jeff Gaston 178d5fefc0 Revert "Soong support for namespaces"
This reverts commit 63a250a336.

Reason for revert: Some failures:
  namespace_test.go:648: dir1/Blueprints:2:4: a namespace must be the first module in the file 
  such as New Build Breakage: aosp-master/build_test @ 4475274

Change-Id: I1b5db8eb934e51ff22241bfca44199d886b1393b
2017-11-30 00:43:43 +00:00
Jeff Gaston 63a250a336 Soong support for namespaces
Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm \
      'build/blueprint:work^ build/soong:work^' \
      'build/blueprint:work build/soong:work'
      # and see that the only changes were:
      # 1. adding some new files
      # 2. changing some line numbers
Test: m -j nothing # which runs unit tests

Change-Id: I6d3e52ef62c4cabe85b9a135a54de0e1a6aab29c
2017-11-29 13:03:40 -08:00
Jayant Chowdhary 219139df8c Copy abidiffs into /abidiffs on abi breakages.
Bug: 64267858

Test: create reference abi dump for libjpeg locally. Change return type
      of libjpeg_std_err and build with :
      BOARD_VNDK_VERSION=current mm -j64 showcommands dist
      Build fails and abidiff report gets copied into out/dist/abidiffs.

Change-Id: I7c8ecfac95361e731009e5913bd3a7bb323a9597
2017-11-27 17:16:29 -08:00
Dan Willemsen cbf9e827a7 Update default configuration
This isn't often used, but the values were quite old. So update them to
something closer to aosp_arm64 from today.

Bug: 68803744
Test: m clean; m --skip-make libc
Change-Id: Id5c60b62e7c7a91635dea9669fc604d63d299778
2017-11-13 14:46:44 -08:00
Vishwath Mohan 1fa3ac552d CFI include/exclude path support (Soong)
This CL adds the ability to centrally enable or disable CFI for
components using either an environment or product config
variable. This is a better, nore manageable option that enabling CFI
across each component individually.

Bug: 67507323
Test: CFI_INCLUDE_PATHS= system/nfc m -j40
Test: CFI_EXCLUDE_PATHS = frameworks/av m -j40

Change-Id: I38b77946759121aec99ab25f31aaee2e5d993f73
2017-11-08 18:56:10 -08:00
Colin Cross 126a25cb3d Propagate PRODUCT_MINIMIZE_JAVA_DEBUG_INFO to soong and use it
Strip debug info in javac when PRODUCT_MINIMIZE_JAVA_DEBUG_INFO
is set.

Test: m with PRODUCT_MINIMIZE_JAVA_DEBUG_INFO=true
Change-Id: I167e742662801291c516bf1ff826486560d22147
2017-11-01 12:51:16 -07:00
Colin Cross face4e4563 Import AAPT-related product variables from make
Test: m checkbuild
Change-Id: I22113c17d240ff26652cea7df801a183343faebd
2017-10-30 17:36:41 -07:00
Colin Cross 99967a7b34 Allow arch-specific modules to be disabled in the PDK
Modules may need to be disabled in the PDK for the device but not
the host.

Test: m checkbuild
Change-Id: Ie40555d1437d9f36ceec753884dc4045132998eb
2017-10-17 16:25:26 -07:00
Colin Cross 595a406f88 Pass --min-sdk-version to dx
Pass the sdk_version property, the platform sdk version, or 10000
to dx as --min-sdk-version.

Test: m -j checkbuild
Change-Id: I5fae03f44153dc2d6244c33f4c055e746980aefe
2017-08-31 13:48:52 -07:00
Dmitry Shmidt dba5419dea Add product_variables.uml
Bug: 64985489
Test: Manual

Change-Id: Ief6f06770b4df54c3630fb8f1904da2336f294ff
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2017-08-23 15:57:20 -07:00
Dan Albert 7e73d5f3c6 Adapt to PLATFORM_VERSION_FUTURE_CODENAMES.
am: 31384debd7

Change-Id: Ib27259053a381f98a73b4dbc0421efce3ef31516
2017-08-03 02:27:44 +00:00
Dan Albert 31384debd7 Adapt to PLATFORM_VERSION_FUTURE_CODENAMES.
Don't preserve the confusing names from make. Rename AllCodenames to
ActiveCodenames, add FutureCodenames, and add CombinedCodenames to
fetch the *real* AllCodenames.

To allow `introduced=P` in NDK library definitions, we need to know
that P exists. Use the combined list of current and future API
codenames generating stubs.

Test: make ndk
Test: check out/soong/api_levels.json
Bug: None
Change-Id: I435f9ce7446236edc268a84e33474044a55a6302
2017-08-02 17:14:10 -07:00
Ivan Lozano 9f32b6b23b Merge "Allow integer_overflow sanitizer path exclusion."
am: 335565d300

Change-Id: Id19a2328970b540fcbcddb9421a2973eada302a7
2017-07-19 01:14:29 +00:00
Ivan Lozano 5f59553bca Allow integer_overflow sanitizer path exclusion.
Add support for excluding paths from having integer_overflow applied to
them when using SANITIZE_TARGET=integer_overflow via an
INTEGER_OVERFLOW_EXCLUDE_PATHS make variable. This covers the soong side
of the change.

Bug: 30969751
Test: Build with SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow
INTEGER_OVERFLOW_EXCLUDE_PATHS=<path> and confirmed this was no
longer being applied to binaries in that path.

Change-Id: I298b772f5425da28dff1cf007825be19558db3a8
2017-07-18 13:38:20 -07:00
Jiyong Park fc728d9598 add device_kernel_headers module for vendor-specific kernel headers
am: d773eb3e86

Change-Id: I5df3aded9d8ba25cde31eee61ca337eb74113ef4
2017-07-08 03:18:59 +00:00
Jiyong Park d773eb3e86 add device_kernel_headers module for vendor-specific kernel headers
device_kernel_headers is a built-in heder-only lib that provides device-specific
kernel headers. The header path is configured via a new product variable
SystemIncludeDirs, which is currently the mirror of
TARGET_PROJECT_SYSTEM_INCLUDES in the make world.

Note: generic kernel headers (bionic/libc/kernel) have been added to the
include path by default. "device_kernel_headers" module is for device-specific
kernel headers such as /device/*/*/kernel-headers.

Note 2: this is opt-in for Android.bp modules (i.e. header_libs :
["device_kernel_headers"] required.) while it is always provided to
Android.mk modules.

Bug: 62939405
Test: choosecombo to aosp_sailfish (or any other Pixel/Nexus targets)
BOARD_VNDK_VERSION=current m -j gralloc.msm8996 (or any other vendor
libs using vendor-specific kernel headers)

Change-Id: I81c60abc13942c89fff723d1544b27a81b300db0
2017-07-08 09:29:04 +09:00
Ivan Lozano 1523dadc8b Add integer_overflow sanitization build option.
am: 0c3a1efae4

Change-Id: I5fcdec7b89b8104e532b945f30a966dc95c80518
2017-07-07 20:12:58 +00:00
Ivan Lozano 0c3a1efae4 Add integer_overflow sanitization build option.
Adds the SANITIZE_TARGET=integer_overflow build option to apply signed and
unsigned integer overflow sanitization globally. This implements the
Soong side of the build option.

An additional build option is provided to control whether or not to run
in diagnostics mode, controlled by SANITIZE_TARGET_DIAG. This works the
same way that SANITIZE_TARGET does and currently only supports
'integer_overflow' as an option.

A default sanitizer blacklist is added to avoid applying sanitization
to functions that are likely to exhibit benign overflows.

Bug: 30969751
Test: Building with and without the new flags, device boot-up, tested
various permutations of controlling the new flags from build files.

Change-Id: Ibc8a8615d3132f1a23faaf1cb4861f24c5ef734a
2017-07-07 09:52:23 -07:00
Colin Cross 550b646480 Merge "Add pdk product variable" am: e5598169b3 am: 8a328382bf
am: 6a30684b33

Change-Id: Ie60495934426998d523f5f2c670c052fb08c22fb
2017-05-26 19:45:26 +00:00
Colin Cross dab550d68b Add pdk product variable
The pdk product variable will be set by make when TARGET_BUILD_PDK
is set, and can be used to disable modules that won't build in the
PDK.

Test: builds
Bug: 62086238
Change-Id: I2191a57b9b06680fd741308e7464275a89773530
2017-05-25 10:18:24 -07:00
Steven Moreland 35d1479b03 Merge "Add Treble as soong variable." am: a9ec71f54f am: 8fc756987e
am: b3d3ced720

Change-Id: Icbb81962f6a735c2da22b1d0ee2c4fa8a93d9250
2017-05-20 00:19:37 +00:00
Steven Moreland e24bc204c9 Add Treble as soong variable.
This exposes PRODUCT_FULL_TREBLE.

This is required so that we can add sane defaults to Treble code.

Test: manual
Bug: 38415912
Change-Id: Ia3ea4aeee799b998380a1600026075dab66286a3
2017-05-19 15:19:57 -07:00
Colin Cross 5df13dd03d Add product_sdk_version.cflags property am: ceeff0fd39 am: 782f1fe809
am: bc69b90e3e

Change-Id: I1e92ff58a8eecb5c52f76a0426fab615402e3e24
2017-05-08 23:09:23 +00:00
Colin Cross ceeff0fd39 Add product_sdk_version.cflags property
libwilhelm needs PRODUCT_SDK_VERSION=%d.

Test: builds
Change-Id: Ie3caf9e4fdcb8e241c8743b1675520e93cf20cae
2017-05-08 15:57:05 -07:00
Colin Cross 3c7e86ef69 Add a variable to disable modules in the PDK am: b2123aa1df am: dd62f877b6
am: 89d5ff5865

Change-Id: I39bd7cfba20583487dd0b69a9ef89a610e6f5d02
2017-05-06 01:48:11 +00:00
Colin Cross 5097cb6135 Support %s in product variable properties am: 7e0eaf15b9 am: d75b9109cc
am: a4ca1b6caf

Change-Id: Iaa65bd0e000f79b4ec4c13d0f6d1955d08cb601d
2017-05-06 01:48:01 +00:00
Colin Cross b2123aa1df Add a variable to disable modules in the PDK
Not plumbed through yet, but will at least prevent us from losing
track of which modules will not build in the PDK.

Test: builds
Change-Id: I4c1a0e39104b104dc1ff23c4391d5e83b3002d3a
2017-05-05 18:22:30 -07:00
Colin Cross 7e0eaf15b9 Support %s in product variable properties
Support using strings as product variable substitutions, and
add tests for printfIntoProperty.

Test: varaible_test.go
Change-Id: I06cfadfb1d3fc81da72fb71323706df20426c8b7
2017-05-05 18:22:30 -07:00
Colin Cross 4ed57d5a47 Merge "Support override_rs_driver product variable" am: 2030a8cbcb am: 9b9be28895
am: 00b7cd4810

Change-Id: I05da4da322741dc6704ad7baa1d5d39766821666
2017-05-06 00:50:00 +00:00
Colin Cross 954364256f Support override_rs_driver product variable
Test: builds
Change-Id: Ifd9bf09bb54418d62f6886b0d8ed84dd493a3162
2017-05-04 15:44:11 -07:00
Colin Cross 8f8e7b6257 Add device_uses_hwc2 product variable am: 0e409a2810 am: 2bc8871dac
am: b3b0c9bcf1

Change-Id: I75b55df02409556bbbc2c62a0dd901c51b02a90b
2017-05-02 20:13:29 +00:00
Colin Cross 0e409a2810 Add device_uses_hwc2 product variable
TARGET_USES_HWC2 is going away, but propagate it to soong for now
to unblock converting dependency chains that end in libhwui.

Test: soong tests
Change-Id: I20f1269caea1b5f5fc39239daa6b2e610bd36eb9
2017-05-02 11:17:45 -07:00
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