Commit graph

3807 commits

Author SHA1 Message Date
George Burgess IV
33dc73e707 Merge "Add to cflags in compilerFlags()"
am: cad076b16b

Change-Id: I4e9b45f48df594ab7e2b864c776ec9973dc31221
2017-07-19 21:43:44 +00:00
Treehugger Robot
cad076b16b Merge "Add to cflags in compilerFlags()" 2017-07-19 21:36:33 +00:00
George Burgess IV
f5310e3f88 Add to cflags in compilerFlags()
These compiler flags weren't being properly added to ToolingCFlags,
which was causing clang-tidy to complain a lot about incompatible
redeclarations of library functions. Moving them to compilerFlags()
causes them to be added to ToolingCFlags.

Bug: None
Test: mma in bionic/. clang-tidy now shows 7,142 fewer high-severity
warnings.

Change-Id: If5148858d9db143a3dd9b0ce6c970258ec4ff9cb
2017-07-19 11:53:54 -07:00
Dan Willemsen
737623108d Merge "Switch owner to *string to disable concat"
am: 1651953ca5

Change-Id: I020d7e1ed733ccfc3035aca98fda0417771ecfda
2017-07-19 04:33:38 +00:00
Treehugger Robot
1651953ca5 Merge "Switch owner to *string to disable concat" 2017-07-19 04:28:31 +00:00
Justin Yun
d16117330c Merge "Install VNDK libs in /system instead of /vendor"
am: 57b314daba

Change-Id: Ica58764411c46466f6fed4db561d2e5c0d8de048
2017-07-19 02:58:03 +00:00
Treehugger Robot
57b314daba Merge "Install VNDK libs in /system instead of /vendor" 2017-07-19 02:51:16 +00:00
Dan Willemsen
efac4a87ee Switch owner to *string to disable concat
If owner is specified in a defaults module, we shouldn't concat that
with the owner specified in a module using that defaults module. A
string pointer will produce the correct behavior (overriding the default)

Bug: 37330627
Test: out/soong/Android-*.mk looks correct after this change
Change-Id: I64574e2ba81c11b042248d7a44702ec4534ee932
2017-07-18 19:42:09 -07:00
Steven Moreland
2646b8f313 Merge "Move default libnativehelper include to mock dir."
am: 3c8ba15bdd

Change-Id: I3a3d773765893a97055c60616710ed147042911d
2017-07-19 01:40:37 +00:00
Treehugger Robot
3c8ba15bdd Merge "Move default libnativehelper include to mock dir." 2017-07-19 01:33:50 +00: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
335565d300 Merge "Allow integer_overflow sanitizer path exclusion." 2017-07-19 01:06:28 +00:00
Colin Cross
6b28bd7a48 Regenerate build.ninja.in
am: a40331cdc9

Change-Id: I56ce456d8ec4c624c21acb7e1214638135b3717c
2017-07-19 01:05:27 +00:00
Colin Cross
a40331cdc9 Regenerate build.ninja.in
Ie922dfc59787514b55fd15e7b97728732714e939 updates
build/blueprint/build.ninja.in, update soongs to match to avoid
rebuilding minibp after every bootstrap.

Bug: 63720725
Test: m -j && m -j
Change-Id: Ib06bc39efae148aaa6d5d8c2ac1b1d41d8ec00d9
2017-07-18 16:02:22 -07:00
Steven Moreland
3cf6306f96 Move default libnativehelper include to mock dir.
Also export the corresponding variable to make.

libnativehelper's include_deprecated contains all of the
headers that are currently used by libraries without
the "nativehelper/" prefix.

The current count of this is this:
      2 ScopedLocalFrame.h
      4 JniInvocation.h
      4 ScopedBytes.h
      5 AsynchronousCloseMonitor.h
      6 toStringArray.h
      7 ScopedStringChars.h
     38 JniConstants.h
     41 ScopedPrimitiveArray.h
     79 ScopedUtfChars.h
     80 UniquePtr.h
    100 ScopedLocalRef.h
    467 JNIHelp.h

Now we can remove each file from the global header include
on a file by file basis.

Bug: 63762847
Test: libs find their headers

Change-Id: Iffc0c1ceb55cc59dc4a70c75d7c0b9ce8397b2cf
2017-07-18 14:44:33 -07: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
Justin Yun
8effde47de Install VNDK libs in /system instead of /vendor
If BOARD_VNDK_VERSION is set, and a module is set to
`vendor_available: true` it is installed in /system and /vendor.

However, if the module is a VNDK library, it must be
installed at `/system/${LIB}/vndk` instead of /vendor/${LIB}.
For those modules, need following to set.

vendor_available: true,
vndk: {
    enabled: true,
    support_system_process: true,
},

`support_system_process` is optional to define.
If it is defined to true, the module is regarded as vndk-sp.

link-type check for VNDK modules is added to make sure that VNDK
modules only link to other VNDK shared libraries or LL-NDKs.

move the ABI checks to VNDK from all of vendor_available.

Bug: 38304436
Test: attempt to compile with BOARD_VNDK_VERSION:=current
Test: Use `vendor_available_vndk: true` for VNDK modules and compile
      with BOARD_VNDK_VERSION:=current
Change-Id: I409268e0b7f05a9d01697bf9f9f4726b5aac631f
2017-07-18 14:48:29 +09:00
Colin Cross
86763f3c5a Merge "Add support for data field in cc_benchmark."
am: da4a7257b5

Change-Id: I4a91db2f804e5518a9799b53305286dc4a5e49c0
2017-07-18 02:42:01 +00:00
Colin Cross
da4a7257b5 Merge "Add support for data field in cc_benchmark." 2017-07-18 02:37:03 +00:00
Colin Cross
daf9154992 Merge "Add integration testing infrastructure"
am: dddf50039a

Change-Id: I7e378c07ae859e45ad461545401f69fade6137f0
2017-07-18 00:07:20 +00:00
Treehugger Robot
dddf50039a Merge "Add integration testing infrastructure" 2017-07-18 00:03:59 +00:00
Anders Lewis
b97e818201 Add support for data field in cc_benchmark.
Test: mm -j at source root; Run on blueprint with data in cc_benchmark.
Change-Id: I6647fe95c96a6df27a54633f6a520a032487ca97
2017-07-17 14:42:58 -07:00
Dan Willemsen
509edcd9a9 Regenerate soong's build.ninja.in
am: 71771078f6

Change-Id: I4b07702ca84a0a67dc1cd6d7f6477bc56c97db81
2017-07-15 07:15:58 +00:00
Dan Willemsen
71771078f6 Regenerate soong's build.ninja.in
This was causing us to rerun minibootstrap every build.

Bug: 63720725
Test: m -j nothing; m -j nothing
Change-Id: Iedd18b54d34f3f20580d0522a4a7d9c5f216caaa
2017-07-14 22:16:51 -07:00
Colin Cross
40299567f8 Fix incorrect package for variable
am: eb54da6ebe

Change-Id: I04f6058c6379ad483b48e52445fdcd3b3769ace5
2017-07-15 03:42:19 +00:00
Colin Cross
13f561d932 Use ExistentPathForSource
am: d48633a564

Change-Id: I3ce1bc12307e580ebc5c8394a6b1e3f158cf7065
2017-07-15 03:42:16 +00:00
Colin Cross
cec8171420 Add integration testing infrastructure
Fix mutator registration for tests to allow different tests
in the same package to register different mutators.

Allow tests to track the resulting ModuleBuildParams objects
to use in assertions, and provide helpers for getting them.
For example:
    config := android.TestConfig(buildDir)
    ctx := android.NewTestContext()
    ctx.RegisterModuleType(...)
    ctx.MockFileSystem(...)
    ctx.ParseBlueprintsFile("Android.bp")
    ctx.PrepareBuildActions(config)
    ctx.Register()
    // Get the Inputs value passed to the javac rule for the foo module
    inputs := ctx.ModuleForTests("foo".Rule("javac").Inputs

Test: java_test.go
Change-Id: I10c82967f5f3586d2c176f169906b571ed82fc73
2017-07-14 14:19:51 -07:00
Colin Cross
c6f07f00da Remove java version checks
The build now uses a prebuilt javac binary distributed with the
source, checking the host java version is no longer required.

Test: m -j checkbuild
Bug: 62956999
Change-Id: Ieef83481d0e6d68371bbd8a422f870ffe2bbb428
2017-07-14 14:01:29 -07:00
Colin Cross
eb54da6ebe Fix incorrect package for variable
java doesn't use a config package for its variables

Test: java_test.go
Change-Id: I84c396b794d6eef971b1ef174a6f6e529071c452
2017-07-14 08:24:36 -07:00
Colin Cross
d48633a564 Use ExistentPathForSource
Converting java to use Path objects incorrectly used PathForModuleSrc
for a path that might not exist, use ExistentPathForSource instead.

Test: java_test.go
Change-Id: I50e4e315a10ab08c4e72065094ae29844874f5e4
2017-07-14 08:24:36 -07:00
Dan Willemsen
069f526cdb microfactory: Sort dependencies
am: 38cef8ac39

Change-Id: I3ef5e8e324373798f7a89614180ec8443d024c67
2017-07-14 02:02:42 +00:00
Dan Willemsen
0baef6da41 Add microfactory tracing
am: cae59bc29d

Change-Id: I9163a2519715986646f072b89d1e407730341689
2017-07-14 02:02:40 +00:00
Dan Willemsen
38cef8ac39 microfactory: Sort dependencies
This was causing android/soong/ui/build to rebuild sometimes when it
didn't need to.

Test: `m -j nothing; grep "B compile" out/.soong_ui.trace` repeatedly
Change-Id: I5d33271a7b037f53674a0d312d8da1746eed8eaa
2017-07-13 15:09:44 -07:00
Dan Willemsen
cae59bc29d Add microfactory tracing
Test: m clean; load out/build.trace.gz in chrome://tracing
Test: m -j nothing; load again
Change-Id: I67d4e006a4bdde593b54c20d6d93a48278fe696d
2017-07-13 15:09:44 -07:00
Dan Willemsen
1a5a707ab6 Support running soong_ui.bash from anywhere in the tree
am: 1b82286736

Change-Id: Ibb81f6ae7be7d6fbcb8332565948a6e2d7305ccb
2017-07-13 21:41:30 +00:00
Dan Willemsen
1b82286736 Support running soong_ui.bash from anywhere in the tree
It will cd to $TOP before running soong_ui itself, so that soong_ui
still runs from the top of the tree. ORIGINAL_PWD is saved so that we
can reference that later (for example, to move 'mma' implementation into
Go).

Test: cd system; ../build/soong/soong_ui.bash
Test: Set absolute / relative OUT_DIR or OUT_DIR_COMMON_BASE and repeat
Change-Id: Icb67a3ee6a3358cca50300755c8953419fc19437
2017-07-12 16:41:09 -07:00
Dan Willemsen
09f24cbc16 Drop make flags in soong_ui
am: c40e10bd6b

Change-Id: I3d52a04d4d30b56a444a166b9a7bcc69aa3991be
2017-07-12 20:17:24 +00:00
Dan Willemsen
87f7eb60d1 Parse environment options from the command line
am: 091525e15c

Change-Id: Ibfb31ac90b0dfaf90c4766606fab894ee3abea0c
2017-07-12 20:17:21 +00:00
Dan Willemsen
12e23c33f5 Support more ways to pass -j/-k
am: 9b58749f30

Change-Id: I5deca4508891fa0805a386e51bd8da91cd3f90ee
2017-07-12 20:17:17 +00:00
Dan Willemsen
c40e10bd6b Drop make flags in soong_ui
MAKELEVEL and MAKEFLAGS were are both unset by makeparallel when invoked
from Make. In preparation for removing the Make wrapper (and
makeparallel), strip them in soong_ui as well.

Add MFLAGS for completeness.

Test: m -j
Change-Id: I029f9464d11b432e979b32ede360450f4facb038
2017-07-11 15:23:55 -07:00
Dan Willemsen
091525e15c Parse environment options from the command line
Make supports specifying all types of variables on the command line
(using =, :=, +=, and other variable references. When running soong_ui
through make/makeparallel these all effectively become environment
variables.

So in preparation to remove the Make wrapper, support a simplified form
of this syntax, roughly equivalent to what the shell supports if
specified before the command (<NAME>=<VALUE>).

Test: m -j blueprint_tools
Change-Id: I08fa2b86710f282e619b0cc324a3e5bbaf62d26e
2017-07-11 15:23:51 -07:00
Dan Willemsen
9b58749f30 Support more ways to pass -j/-k
In preparation to remove Make/makeparallel from soong_ui startup, we
need to preserve compatibility with the different ways that make
supports the -j option.

Nothing changes unless Make/makeparallel is removed from the startup.
Once that is removed, not specifying a -j value will be equivalent to
'-j' instead of '-j1', like Ninja. A value will also be supported when
specifying -k, like Ninja (though specifying it alone will be equivalent
to '-k 0').

Test: m -j blueprint_tools
Change-Id: I9d5d59bedd4f6e5cca76bdb4cd47e0b5b7d523f0
2017-07-11 14:51:26 -07:00
Dan Willemsen
458e5cad5e Fix kernel_headers module registration
am: fd7310d95a

Change-Id: Ie3841db98848172545447d4c8a58e7d184b99c2f
2017-07-10 22:13:08 +00:00
Dan Willemsen
fd7310d95a Fix kernel_headers module registration
This was breaking SANITIZE_TARGET (and likely others)

Test: SANITIZE_TARGET=address m -j nothing
Test: out/soong/build.ninja is identical before/after
Test: out/soong/Android-aosp_arm64.mk is identical before/after
Change-Id: Ic0d6774025761ec9ae9240c109895ab8032e4784
2017-07-10 12:30:35 -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
Dan Willemsen
b24b042eee Merge "Fix install location for vendor tests"
am: e9425b0277

Change-Id: Ia44a50350f0980cb1bec364088e53b6e0d39a388
2017-07-07 03:38:25 +00:00
Treehugger Robot
e9425b0277 Merge "Fix install location for vendor tests" 2017-07-07 03:30:13 +00:00