Commit graph

1116 commits

Author SHA1 Message Date
Treehugger Robot
9194d8076c Merge changes from topic 'soong-clang-tidy'
* changes:
  Add clang-tidy support
  Start using "struct Objects" to store object Paths
2016-11-01 01:19:00 +00: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
5cb580f407 Start using "struct Objects" to store object Paths
So that we can represent other files that get generated along with the
objects, like the gcno coverage information, and per-file clang-tidy
runs.

Test: Soong's build.ninja identical before/after
Change-Id: I5c553a153c436d5403549f62c73fe79c5f101779
2016-10-31 16:18:49 -07:00
Evgenii Stepanov
1e405e160a [soong] Enable LOCAL_SANITIZE:=cfi and add LOCAL_SANITIZE_DIAG.
LOCAL_SANITIZE_DIAG works for ubsan, too.

Bug: 22033465
Test: build a test target with cfi and diag { cfi } properties.

Change-Id: I9cd8e8df9b330430b321709d7f05b4da0294e771
2016-10-31 15:29:08 -07:00
Treehugger Robot
5d5db02bf6 Merge "Remove support for building with OSX 10.8/9 SDKs" 2016-10-28 22:50:20 +00:00
Dan Willemsen
85e3d0110f Remove support for building with OSX 10.8/9 SDKs
Our minimum build version listed on source.android.com is 10.10. Change
the minimum used SDK to 10.10, but keep the deployed version at 10.8 so
that our distributed tools still work on older versions.

CoreBluetooth/CoreBluetooth.h isn't available directly in older SDKs,
but we need to include it in the 10.12 SDK.

Test: `m -j` with 10.11, 10.12 SDKs.
Test: Verified the builders all have at least 10.10 sdk available.
Change-Id: I82321875b8b3a4099ea829ce2d75e1af29cb38c6
2016-10-28 13:57:34 -07:00
Treehugger Robot
d41935f34d Merge changes from topic 'proto'
* changes:
  Add support for .proto files
  Add Path.Base helper
  Simplify compileObjs
2016-10-28 20:04:51 +00:00
Colin Cross
0c461f1f6e Add support for .proto files
.proto files are translated to .pb.cc and .pb.h files, which are then
compiled normally.

Bug: 32286026
Test: mmma -j system/extras/perfprofd
Change-Id: I538071424d667aacf35b4b8bfebe217f5f092726
2016-10-27 15:28:09 -07:00
Colin Cross
4f6fc9c1d8 Add Path.Base helper
Add Path.Base to return the basename of a Path object.

Test: builds
Change-Id: I2bf1519dc5039bedb1586e7ec18297a293e32e11
2016-10-27 15:18:17 -07:00
Colin Cross
2f33635542 Simplify compileObjs
None of the direct users of compileObjs were using any of its
complexity (generated sources, excluded sources, extra sources).  Move
the complexity back in to baseCompiler.compile.

Test: m -j
Change-Id: I2e59d216682c00dd12a1395cf2448827d1c48023
2016-10-27 15:18:13 -07:00
Treehugger Robot
0cca777715 Merge "Support MacOS SDK version 10.12" 2016-10-26 22:54:03 +00:00
Dan Willemsen
11fa52208d Update build.ninja.in
This was causing extra rebuilds for fresh builds. Update with the latest
blueprint changes.

Test: m blueprint_tools, fewer rebuilds
Change-Id: I6b82e9cafa6e84f4089c6f90372bddcd6f85b0ea
2016-10-25 16:08:37 -07:00
Colin Cross
46974e2457 Don't pass -Wl,--no-undefined to host targets
Host builds were compiling without -Wl,--no-undefined because of an ASAN
issue.  Pass -Wl,--no-undefined for host builds unless sanitzers are
enabled.  Also fix LOCAL_ALLOW_UNDEFINED_SYMBOLS on darwin, where
disallowing undefined symbols is the default.

Test: m -j host
Test: m -j SANITIZE_HOST=address host
Bug: 32305815
Change-Id: Ia4bb305a50b1c1048b119f75726d52f82e21438c
2016-10-21 18:20:23 +00:00
Treehugger Robot
001276f6e0 Merge "Fix gofmt problems and add gofmt to preupload checks" 2016-10-21 03:54:26 +00:00
Dan Willemsen
78ffeea24e Fix gofmt problems and add gofmt to preupload checks
Test: gofmt -d .
Test: <bad change>, repo upload
Change-Id: I5ca0676461616f166a842d307c600dc50a50ec48
2016-10-20 18:48:20 -07:00
Treehugger Robot
8815351118 Merge "Add a "license" property to ndk_headers." 2016-10-20 22:12:40 +00:00
Colin Cross
83dec15971 Merge changes from topic 'std'
* changes:
  Allow disabling gnu extensions
  Consolidate -std flags
2016-10-20 21:40:55 +00:00
Treehugger Robot
a4af8ab16b Merge changes I3c930d2e,I2ee3ebbf
* changes:
  Add a script to build the NDK prebuilts.
  Add an NDK ABIs mega build configuration.
2016-10-20 21:25:33 +00:00
Treehugger Robot
b96f352534 Merge "Only use -read_only_relocs on darwin x86" 2016-10-20 21:04:56 +00:00
Dan Albert
c6345fb7ec Add a "license" property to ndk_headers.
This field points to the license file for the headers being shipped.

Test: make ndk && less $SOONG_OUT/ndk/NOTICE
Bug: None
Change-Id: I386f4e6f6d9776f422ffc09b8dab69e1911b08a4
2016-10-20 13:30:07 -07:00
Colin Cross
7863cf53a8 Only use -read_only_relocs on darwin x86
Darwin x86_64 warns with -read_only_relocs:
ld: warning: -read_only_relocs cannot be used with x86_64

Only pass it for darwin x86.

Test: m -j on darwin
Change-Id: I080afb83d777587d14b60c8cd24b59005a275275
2016-10-20 10:47:21 -07:00
Dan Albert
65780b2c24 Add a script to build the NDK prebuilts.
Test: OUT_DIR=ndk-out DIST_DIR=ndk-dist \
          ./build/soong/scripts/build-ndk-prebuilts.sh
Bug: None

Change-Id: I3c930d2ec4d73196e355b90766eb14f0f0361460
2016-10-19 14:35:15 -07:00
Dan Albert
4098deb0b8 Add an NDK ABIs mega build configuration.
The NDK needs generic prebuilts for all architectures.

Test: echo '{ "Ndk_abis": true }' > soong.config && \
          ./soong $OUT_DIR/ndk.timestamp
Bug: None

Change-Id: I2ee3ebbf4cbd1bc593f9e4e9fb44fb66711da9d5
2016-10-19 14:33:37 -07:00
Eyal Lezmy
94d7543b14 Support MacOS SDK version 10.12
This adds the new macOS SDK version to the supported version list.
Surprisingly it simply works like this.
Test: make adb aapt

Change-Id: Ic72cee7345b5f49b6a743c70bd266866a06bc459
2016-10-19 00:59:05 +02:00
Colin Cross
948f0cb9ea Allow disabling gnu extensions
Pass -std=c++14 instead of -std=gnu++14 (or whatever the current default
is) when "gnu_extensions: false" is specified in the blueprints files.

Bug: 32159540
Test: builds
Change-Id: If206228a972129d9574bcf50ddff283b7e7d3fd7
2016-10-18 12:41:17 -07:00
Colin Cross
6f6a428760 Consolidate -std flags
Define the default -std values in global.go, export them in makevars.go,
and use them in compiler.go.

Test: builds
Change-Id: Ia2ae01f63e182d0ad7f371e6d32184bff35a8897
2016-10-18 12:40:51 -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
0d614dd222 Re-enable prebuilt_test
Use a temporary directory as the build directory during tests so files
don't get written to the source tree.

Also add a few more tests for prebuilts with no file specified.

Bug: 31800129
Test: m -j, make sure .soong.environment is not written to the source tree
Change-Id: I623bc114b2ff534c8df9fb3ce273e804711f8f05
2016-10-14 17:07:49 -07:00
Treehugger Robot
6efa287aea Merge "Disable prebuilt_test" 2016-10-14 02:42:47 +00:00
Colin Cross
b778a9cb4e Disable prebuilt_test
The prebuilt tests are accidentally writing a .soong.environment file to
the build/soong/android directory, disable them until TestConfig() is
fixed to prevent writing to the source tree.

Bug: 31800129
Test: m -j, make sure .soong.environment is not written to the source tree
Change-Id: I3b7d47e42111ecababe275b7a9ff0d08bcebfc7a
2016-10-13 18:09:51 -07:00
Dan Willemsen
cbceaab39c Export asan configuration to make
Test: Ninja files for ASAN'd aosp_flounder-eng identical
Change-Id: Ib29cac0bc391dadd9ff27992c7b356415182767f
2016-10-13 23:46:10 +00:00
Treehugger Robot
556566e5ad Merge changes I6e84da66,Ie9e3ed09
* changes:
  Initial prebuilt support
  Only register mutators once
2016-10-13 23:27:32 +00:00
Colin Cross
ce75d2c6a2 Initial prebuilt support
Support prebuilt shared libraries as an initial proof-of-concept of
prebuilts.  Future changes will support binaries and static libraries,
and the ability to select which to use based on something besides
blueprint properties.

Test: TestPrebuilts run during m -j
Change-Id: I6e84da667e9005ae11844bad01d25cbe4ced1ce3
2016-10-13 14:52:47 -07:00
Colin Cross
4498afc55b Only register mutators once
Mutators are registered into a global variable, and then into the
context when it is created.  Only call registerMutators once so that the
same mutator is not listed multiple times in the global variable when
multiple contexts are created.

Test: go test -v android/soong/android
Change-Id: Ie9e3ed09a89b848462b898476cdfb81a90c64bd3
2016-10-13 14:23:17 -07:00
Elliott Hughes
5a0401ab9c Consistently use -std=gnu99 for gcc as well as clang.
This matters for C files that are also built for Windows. Previously they'd
be compiled with -std=gnu99 for the host but [effectively] -std=gnu89 for
Windows.

Bug: http://b/32019064
Test: builds, and can build libcrypto_utils without a manual -std= line
Change-Id: I9c5cc7832220b5c3d6a007ff10d076e26fd8c75d
2016-10-13 14:41:31 +00:00
Colin Cross
fc754581fc Add a Name property
Blueprint is going to abdicate responsibility for determining the name
of a module.  Add a name property, and a method to retreive the name.

Test: build.ninja identical
Change-Id: I09c6f5283cd6e28ad4b04c24c5ab8b00f71ae2ab
2016-10-12 17:24:49 -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
Colin Cross
798bfce9d0 Move registration into android package
Mutator registration is tightly coupled with the android package, move
all registration from the soong package to the android package.

Test: build.ninja identical
Change-Id: Ie183d0b52cc7431c9e05b231934d189208ef1efe
2016-10-12 14:30:44 -07:00
Treehugger Robot
3f9bde87fb Merge "Move hardware/libhardware/include from -isystem to -I" 2016-10-09 01:05:31 +00:00
Treehugger Robot
44266e97f8 Merge "Move system/media/audio/include from -isystem to -I" 2016-10-07 20:40:54 +00:00
Colin Cross
2d44c2c716 Move hardware/libhardware/include from -isystem to -I
-isystem hides all warnings.  The warnings in hardware/libhardware/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j
Bug: 32018017
Change-Id: I9a602d5e1bd021638d3a92d93af3d2a18ab4caa7
2016-10-07 11:40:04 -07:00
Colin Cross
1928093246 Move system/media/audio/include from -isystem to -I
-isystem hides all warnings.  The warnings in system/media/audio/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j
Bug: 31997134
Change-Id: I1c0b68935d643992dd9fc7f76583bed286e49325
2016-10-07 11:39:58 -07:00
Josh Gao
15d523b933 Merge "Allow -lobjc and -framework IOKit in darwin host_ldlibs." 2016-10-06 23:59:58 +00:00
Dan Willemsen
46ae20b0e8 Add frameworks/rs to root.bp
Test: m -j blueprint_tools (just to generate build.ninja)
Change-Id: I26c36d2e9af13df07a3ea2240b85ae9bf2e6e80b
2016-10-06 15:13:17 -07:00
Treehugger Robot
15f6099b80 Merge "Add frameworks/wilhelm to Android.bp." 2016-10-06 17:42:08 +00:00
Treehugger Robot
6648ab0143 Merge "Mark Soong-exported make variables as readonly" 2016-10-06 00:13:27 +00:00
Dan Willemsen
de18f47250 Mark Soong-exported make variables as readonly
Using new .KATI_READONLY extension.

Test: build/tooks/kati_all_products.sh on AOSP master and internal
Change-Id: I71794c1268456c3403a351c1b242f1e78b060355
2016-10-05 15:21:41 -07:00
Colin Cross
315a6ffc99 Move frameworks/native/include from -isystem to -I
-isystem hides all warnings.  The warnings in frameworks/native/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j checkbuild
Bug: 31752268
Change-Id: Ie3656348b5b2a1828dec790aa047635ac0fe6d86
2016-10-05 12:58:29 -07:00
Dan Albert
12ae79c935 Add frameworks/wilhelm to Android.bp.
Test: make native
Bug: http://b/30465923
Change-Id: I97d736deb5f1b56f0492ece4afb635539bc34610
2016-10-04 17:26:03 -07:00
Dan Willemsen
0b24c74fcb Disable cc_benchmark for Darwin hosts
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
2016-10-04 15:20:16 -07:00