Commit Graph

3749 Commits

Author SHA1 Message Date
Mitch Phillips
f65eec9963 Merge "Move fuzz phony to be make-defined, and add to dist." am: ec3b133b8b am: 8c70324d2a am: 59d64c3e57
am: 292137ed19

Change-Id: I9ba5ec81ca007c42b07fc7c98c4aa6742c85f2d4
2019-09-30 14:13:53 -07:00
Treehugger Robot
ec3b133b8b Merge "Move fuzz phony to be make-defined, and add to dist." 2019-09-30 20:24:19 +00:00
Mitch Phillips
a0a5e19140 Move fuzz phony to be make-defined, and add to dist.
Add the fuzz packages to dist. This requires that the phony for 'make'
be define in make itself, rather than in Soong. See comments on other
patch in topic for more information.

Bug: 141026328
Test: m fuzz dist

Change-Id: I4cd476adcfa42e4b40911c4a32427a7b00c67cc3
2019-09-30 10:36:11 -07:00
Jesse Pai
4d33666639 Creation of C Flags Build Variables
Modifications made to soong/cc to look for specific C Flags used by
Android modules and store name of module into a build variable array.

Bug: 140442588
Test: Executed m dist and presubmit
Change-Id: If46a11462369c43bbcd445156aff0641514c58b1
2019-09-30 16:24:16 +00:00
Sasha Smundak
3e63610ec6 Merge "Pass filename mappings to C++ and Java extractors." am: 318c9c5d17 am: e306a4832d am: d8775ebd49
am: 5e122865ca

Change-Id: I45c970c55b55eab826ebf76d250349f758bb63fa
2019-09-27 13:42:13 -07:00
Peter Collingbourne
96c1a7e4a6 Merge "Allow sanitize attribute on cc_objects and propagate sanitize attributes into them." am: bcb5ca006c am: 714f705bc0 am: d8ef18668d
am: 8f63bc37e2

Change-Id: Iaceeebe372d22844ce4f31d98fb5b5f1661f3e0b
2019-09-27 13:29:54 -07:00
Treehugger Robot
318c9c5d17 Merge "Pass filename mappings to C++ and Java extractors." 2019-09-27 20:00:44 +00:00
Peter Collingbourne
bcb5ca006c Merge "Allow sanitize attribute on cc_objects and propagate sanitize attributes into them." 2019-09-27 19:31:13 +00:00
Sasha Smundak
651436460a Pass filename mappings to C++ and Java extractors.
Android builds by default put artifacts into out/ subdirectory of
the source tree, causing the extractor to record their names as
relative. The indexer considers such files as sources, which is wrong.
Fortunately, the extractor can be fed a set of filename rewriting
rules (see build/tools/vnames.json).
Also, undo previous unsuccessful attempt use to absolute path for the
output directory to distinguish between source code and artifacts.

Bug: 141385476
Test: run the build, inspect compilation units of the kzip file
Change-Id: I89ec3aed8fd14f43ea6e0b226d54f643346f6125
2019-09-27 10:28:11 -07:00
Dan Shi
57d4de8490 Merge "Allow test to specify whether or not to auto-generate test config" am: 933b619383 am: acc7f753f6 am: adb37a2239
am: 58f5b5eae5

Change-Id: I832b1fbb96650bd4f87b728405aea320e03b76db
2019-09-26 17:39:55 -07:00
Dan Shi
6ffaaa830d Allow test to specify whether or not to auto-generate test config
Attribute `auto_gen_config` is added to test modules.
Test config will be generated if:
the attribute is not set and AndroidTest.xml doesn't exists
or
the attribute is set to true, whether or not AndroidTest.xml exists.

Test config will NOT be auto-generated if:
the attribute is not set and AndroidTest.xml exists
or
the attribute is set to false, whether or not AndroidTest.xml exists.

Bug: 141684102
Test: build test module with auto_gen_config set to true
Change-Id: I64fb003a83d8c32a967835e5f8d12fe4476043be
2019-09-26 13:29:28 -07:00
Peter Collingbourne
1c648b8936 Allow sanitize attribute on cc_objects and propagate sanitize attributes into them.
Without this change, we can end up failing to sanitize parts of libraries
that are compiled as cc_objects, such as bcm_object.o in boringssl. This
is normally harmless (except that the sanitizer would fail to detect bugs
in unsanitized code), however boringssl in particular needs to be compiled
with HWASAN enabled in all translation units in order to avoid link errors
with newer toolchains that support HWASAN global instrumentation.

Change-Id: Ib8bd325f76b7852cab435bff79d6945768298a5c
2019-09-26 12:35:06 -07:00
Jooyung Han
43b06095dc Merge "fix: "no_apex" can be put in defaults" am: 5e493d5660 am: edcce88102 am: 3182fbea54
am: 069520e466

Change-Id: I18e141464352ea7239ed0f7f2a4e5ffb6d185d1b
2019-09-25 22:34:06 -07:00
Daniel Norman
1bf12dceec Merge "Performs same checks as aidl_interface.go before stripping leading "I"." am: 488e7e02a2 am: 1d0ceef5cf am: e325f660ed
am: 54b0409ce9

Change-Id: Ic64478b11e720ed571efbd192402d8a9dfa468e0
2019-09-25 21:43:42 -07:00
Jooyung Han
5e493d5660 Merge "fix: "no_apex" can be put in defaults" 2019-09-26 01:07:21 +00:00
Daniel Norman
488e7e02a2 Merge "Performs same checks as aidl_interface.go before stripping leading "I"." 2019-09-26 00:33:57 +00:00
Mitch Phillips
e42b395a67 Merge "Add 'make fuzz' build rule." am: 72b43adb56 am: 4e0f885ead am: 47d17f4062
am: 539694c75f

Change-Id: I43ab20f95bac7d045cc429503938aad1c9c03a57
2019-09-24 23:52:53 -07:00
Jooyung Han
cc372c5b1d fix: "no_apex" can be put in defaults
Currently, putting no_apex in defaults module doesn't work.

To fix this,
* 'no_apex' property is added as 'defaultable'.
* apex module doesn't follow beyond 'defaults' module.

Bug: 141560644
Test: m (soong tests added)
Change-Id: I8410785f7f83d843689a33b1241d74086c6a7671
2019-09-25 15:27:47 +09:00
Treehugger Robot
72b43adb56 Merge "Add 'make fuzz' build rule." 2019-09-25 06:14:41 +00:00
Mitch Phillips
d3254b4899 Add 'make fuzz' build rule.
Adds the `make fuzz` build rule. This offers a few features on top of
`make haiku`:
 1. Identifies all fuzz targets through the build system, rather than
 having to maintain a golden file.
 2. Packages now exist in out/soong/ and are packaged on a per-architecture
 basis. Packages also now contain fuzzer seed corpus && dictionary.
 3. This gives us further extension options:
  - Packaging shared libraries for shared library fuzzing.
  - Presubmit tests for fuzzing. Each fuzz target could be made into a
  regression test by adding the crash testcase to the corpus. We can
  also ensure that example_fuzzer finds a bug with an ASan report as a
  presubmit smoke test.

Bug: 141026328
Test: m fuzz && unzip -l out/soong/fuzz-$ARCH.zip

Change-Id: I7aaad616d6b194a3beaf908241a9817df9dfdce1
2019-09-24 20:48:00 -07:00
Daniel Norman
10b743509e Performs same checks as aidl_interface.go before stripping leading "I".
Test: building AIDL interface named IntEnum.aidl. Leading I is not
removed.
Change-Id: Ia40cbdf9b8936f6f58a99971eae1b2138a678c91
2019-09-24 17:41:15 -07:00
Ivan Lozano
22021c76b4 Merge changes from topic "add_rust_arm64_devices" am: f23f6d20f0 am: a34fe6bbe3 am: 422ecea9de
am: 1d39413813

Change-Id: I3b4b20240cbc6eca400d7f6eda6afc6ecec4b6ae
2019-09-24 15:46:07 -07:00
Colin Cross
e1bb5d092a Hide static from cc_library_shared and vice versa
The static properties don't make sense for cc_library_shared
modules, and the shared properties don't make sense for
cc_library_static modules.  Move them into separate property
structs so they can be added conditionally.

Test: m nothing
Test: DefaultsTest
Change-Id: I0b0cedf9eba07deb721fae138ffa7bedcfbfe71e
2019-09-24 15:05:57 -07:00
Ivan Lozano
f23f6d20f0 Merge changes from topic "add_rust_arm64_devices"
* changes:
  Add ARM32 device Rust toolchain.
  Add AArch64 device Rust toolchain.
2019-09-24 21:39:51 +00:00
Ivan Lozano
f1c8433b40 Add AArch64 device Rust toolchain.
Bug: 141207434
Test: build example rust device module.
Change-Id: I0932a614942bf4a4d4b6c153fcc4fc79c7f202bd
2019-09-24 10:35:28 -07:00
Yi Kong
7bcb89909c Merge "Remove -Wno-format-pedantic cflag" am: aefd0af575 am: 65fcfa1fc1 am: 14007d89e2
am: 3a248c70aa

Change-Id: Ia4fb0d1434233d4e2b0a1487dad5542bed7b4fe1
2019-09-23 11:25:44 -07:00
Yi Kong
aefd0af575 Merge "Remove -Wno-format-pedantic cflag" 2019-09-23 17:48:21 +00:00
Jiyong Park
3f5c6cfa89 Merge "Introduce module type 'sdk'" am: b1102ba828 am: 303b2992af am: d284cd8894
am: 5b3a626407

Change-Id: Ic4a173e9db31a2cb0d744e193d4515c5ca3949b2
2019-09-22 22:23:15 -07:00
Treehugger Robot
b1102ba828 Merge "Introduce module type 'sdk'" 2019-09-23 04:38:24 +00:00
Jiyong Park
d1063c1586 Introduce module type 'sdk'
This change introduces a new module type named 'sdk'. It is a logical
group of prebuilt modules that together provide a context (e.g. APIs)
in which Mainline modules (such as APEXes) are built.

A prebuilt module (e.g. java_import) can join an sdk by adding it to the
sdk module as shown below:

sdk {
    name: "mysdk#20",
    java_libs: ["myjavalib_mysdk_20"],
}

java_import {
    name: "myjavalib_mysdk_20",
    srcs: ["myjavalib-v20.jar"],
    sdk_member_name: "myjavalib",
}

sdk {
    name: "mysdk#21",
    java_libs: ["myjavalib_mysdk_21"],
}

java_import {
    name: "myjavalib_mysdk_21",
    srcs: ["myjavalib-v21.jar"],
    sdk_member_name: "myjavalib",
}

java_library {
    name: "myjavalib",
    srcs: ["**/*/*.java"],
}

An APEX can specify the SDK(s) that it wants to build with via the new
'uses_sdks' property.

apex {
    name: "myapex",
    java_libs: ["libX", "libY"],
    uses_sdks: ["mysdk#20"],
}

With this, libX, libY, and their transitive dependencies are all built
with the version 20 of myjavalib (the first java_import module) instead
of the other one (which is for version 21) and java_library having the
same name (which is for ToT).

Bug: 138182343
Test: m (sdk_test.go added)
Change-Id: I7e14c524a7d6a0d9f575fb20822080f39818c01e
2019-09-22 08:21:27 +09:00
George Burgess IV
e1bddb2799 Merge "soong: -Werror=fortify-source" am: 83dcee3094 am: bf6c16ad48 am: 28601812b9
am: 95428ce162

Change-Id: I3bf5390975ede10b9d78cb37c1c05a33025c1ddd
2019-09-20 17:29:12 -07:00
Yi Kong
011aaa46c5 Remove -Wno-format-pedantic cflag
This is no longer needed.

Test: presubmit
Bug: 20148343
Change-Id: Ie377b3cd183ae89bc159c3b31c64960bce3bc753
2019-09-20 17:24:21 -07:00
Treehugger Robot
83dcee3094 Merge "soong: -Werror=fortify-source" 2019-09-20 23:49:33 +00:00
George Burgess IV
6c691644f7 soong: -Werror=fortify-source
Recently, we started deferring to clang for some of its built-in
FORTIFY-like warnings. We should always treat these as errors, since
they represent potential security vulnerabilities.

Bug: 131861088
Test: m. Also made a compilation in Bionic fail; verified the build
  command had -Werror=fortify-source in it.

Change-Id: I2715ea411ef067f801534dab4d306fef5431f290
2019-09-20 11:15:40 -07:00
Dan Willemsen
d0b231c116 Merge "Fix missing deps found through RBE" am: 9f6cbaca21 am: 46c91e3e6a am: b7aae6cc2a
am: bd0c662310

Change-Id: I4e7348e87808f3f8979e3bf8b7d8b35178a41851
2019-09-19 14:17:18 -07:00
Treehugger Robot
9f6cbaca21 Merge "Fix missing deps found through RBE" 2019-09-19 20:34:05 +00:00
Colin Cross
3b19f5d71d Remove old-style support for translated second architectures
Translated second architectures now go in NativeBridgeArch instead
of DeviceSecondaryArch.

This reapplies I568046330abc002d4eed582cb999b62a5eaba790 with
ctx.Config().HasMulitlibConflict() added to fix the NDK build,
which has arm64, arm, x86_64, and x86 architectures enabled.

Test: m checkbuild
Test: OUT_DIR=out_ndk build/soong/scripts/build-ndk-prebuilts.sh
Test: no change to build.ninja or Android-aosp_cf_x86_phone.mk
Change-Id: Iadcafbd64bfb9579ae7c86914927c43a062b0c8e
2019-09-19 12:54:32 -07:00
Dan Willemsen
724ab5d5f7 Fix missing deps found through RBE
Bug: 130111713
Test: run with RBE, no longer see error about file not found
Change-Id: Ib6192f2a537f49efdb69b3f3bf28aef1660dec01
2019-09-19 10:51:03 -07:00
nelsonli
119a33c7c2 Merge "Add option test_min_api_level and test_min_sdk_version for auto-generated test config" am: de8b140bf6 am: adc424d9d2 am: 948bfa5686
am: 60a77dc9a5

Change-Id: I4af84e1efbf4f1db56275ae9d5e40fdd5e4a00cb
2019-09-19 10:24:30 -07:00
Treehugger Robot
de8b140bf6 Merge "Add option test_min_api_level and test_min_sdk_version for auto-generated test config" 2019-09-19 16:48:48 +00:00
Mitch Phillips
3842791711 Merge "Add corpus and dictionary properties to cc_fuzz." am: 4e839ec3a5 am: a1be84a806 am: 520b313b3d
am: f81d3c9bc4

Change-Id: I7dd22995913cc3700df96bdbae528beddf287f5f
2019-09-19 07:30:00 -07:00
Treehugger Robot
4e839ec3a5 Merge "Add corpus and dictionary properties to cc_fuzz." 2019-09-19 13:51:17 +00:00
nelsonli
0d7111ec0f Add option test_min_api_level and test_min_sdk_version for auto-generated test config
The new option will allow the auto-generated test config for cc_test to
include MinApiLevelModuleController and check the api-level before test.

Bug: 140912549
Test: 1. $vi platform_testing/tests/example/native/Android.bp
      2. add
          test_min_api_level: 29,
          or
          test_min_sdk_version: 29,
      3. $m -j hello_world_test
      4. check hello_world_test.config

Change-Id: Ic742d41898928df1637890bec87796d90e886516
2019-09-19 12:14:16 +08:00
Mitch Phillips
4e4ab8a141 Add corpus and dictionary properties to cc_fuzz.
Adds the corpus and dictionary properties to the cc_fuzz target.
Propagates these entries to the makefile backend via LOCAL_FUZZ_DATA, in
a similar manner to LOCAL_TEST_DATA.

Bug: 141026328
Test: m example_fuzzer, fuzz target should have adjacent corpus/dict
files.

Change-Id: If5add5a597cc479f4e084bdafbd0fc175cfd6321
2019-09-18 18:55:27 -07:00
Inseob Kim
6f05ee90b4 Merge "Add version to vendor variants" am: 362e9ce427 am: befa10bc9e am: cb8665e67d
am: 93442a6297

Change-Id: I984c06aecf29dda86971e3703217ebb35f6cd79a
2019-09-18 16:57:33 -07:00
Colin Cross
6ea023e579 Merge "Revert "Remove old-style support for translated second architectures"" am: 4c5032bb66 am: 39293b4068 am: 2cc88baaa0
am: 4a017dffb5

Change-Id: Ib1c16811731313086bc452341e380e269a9162e8
2019-09-18 14:44:05 -07:00
Colin Cross
b88fe4be9b Merge "Remove old-style support for translated second architectures" am: da62bf96ce am: 94bac35d78 am: b60d2c245a
am: f757e18734

Change-Id: I034da2151297d396b6cb0c19b7fe4a1b17768c04
2019-09-18 14:19:19 -07:00
Colin Cross
4c5032bb66 Merge "Revert "Remove old-style support for translated second architectures"" 2019-09-18 21:12:45 +00:00
Colin Cross
402be41aa8 Revert "Remove old-style support for translated second architectures"
This reverts commit fe6330c7d2.

Reason for revert: this was accidentally propping up NDK builds
Bug: 141242600
Change-Id: Ie9f8e31479a74e8e9e14d720a5936da6b1d5d113
2019-09-18 21:12:31 +00:00
Treehugger Robot
da62bf96ce Merge "Remove old-style support for translated second architectures" 2019-09-18 20:47:43 +00:00