Commit graph

13 commits

Author SHA1 Message Date
Colin Cross
b916a38233 Refactor cc modules to use decorators instead of inheritance
For example , instead of trying to have libraryLinker inherit from
baseLinker and libraryCompiler inherit from baseCompiler, create a
single decorator object that wraps both baseLinker and baseCompiler.

Test: Builds, no unexpected changes to build.ninja
Change-Id: I2468adaea8466c203a240259ba5694b8b1df7a52
2016-08-05 10:25:09 -07:00
Colin Cross
b98c8b0595 Move toolchain and global variables into separate package
Move all of the configuration into a cc/config package

Change-Id: If56fc7242062ed1ce3cb297f78a1e0ef7537373c
2016-08-01 13:37:01 -07:00
Colin Cross
3c344ef29e Disable asan for static binaries
build/core/executable.mk has an extra check to disable asan for static
binaries, do the same in soong.

Bug: 30191800
Change-Id: Ia78063264f3280eb889ba9e45c45dd66e4c64a96
2016-07-18 16:14:12 -07:00
Colin Cross
263abbd5e9 Support global and local sanitizers
Mixing undefined and address sanitizers requires updating cflags.
Matches makefile change Ifee350da4877008fb061bc7f6c700e7fade405bc

Bug: 30163657
Change-Id: Iea4364b912b496400581a475bc79bd9b9c4dd76d
2016-07-15 13:12:58 -07:00
Evgenii Stepanov
fcfe56d194 Target sanitize properties can disable the global sanitizer.
With this change, sanitize: { address: false } disables
SANITIZE_TARGET=address for one target.

Also rename SafeStack to Safestack, because the former can not be
used as a target property.

Bug: 27729263
2016-07-07 10:54:42 -07:00
Evgenii Stepanov
05bafd3784 Revert "Target sanitize properties can disable the global sanitizer."
This reverts commit bb02886451.

Breaks SANITIZE_HOST=address

Change-Id: I9791a034e32a83d567b8739a7ec7b61890cb1b97
2016-07-07 17:38:41 +00:00
Evgenii Stepanov
bb02886451 Target sanitize properties can disable the global sanitizer.
With this change, sanitize: { address: false } disables
SANITIZE_TARGET=address for one target.

Also rename SafeStack to Safestack, because the former can not be
used as a target property.

Bug: 27729263
Change-Id: I20f55c0e62b2fdd191ba66c0f661a039109bd78f
2016-07-06 16:38:58 -07:00
Colin Cross
b36ab1a1a0 Fix sanitize host builds
Host builds don't have a separate place to install asan modules, so only
create a single variant for them.

Change-Id: I81f7090debd7935db778f8600d8cbc86dd53b1cb
2016-05-25 12:35:53 -07:00
Colin Cross
bc6fb16b26 Support sanitizer variants inside make builds
Create both sanitized and unsanitized variants inside make builds with
sanitizers enabled.  Only export the sanitized version to make, and
always install the sanitized version in /data to match the make build.

Change-Id: I5a17bcbddc7a9d871c929c84d3c116228ef3258f
2016-05-24 17:14:15 -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
Evgenii Stepanov
0a8a0d09d1 Support SANITIZE_TARGET=safe-stack in soong.
Change-Id: I570a7033ece82c5e76815dc1b81622b481930de4
2016-05-12 13:54:53 -07:00
Colin Cross
30d5f514dd Support sanitizer builds inside make
Make expects libraries built with address sanitizer to be installed into
/data, and can't handle multiple variants of modules.

Change-Id: Ice575ff6f0788a88f296e7b3ee521a2b9771f55f
2016-05-03 18:02:42 -07:00
Colin Cross
16b2349190 Add support for sanitizer property
Add a new feature to cc modules that adds the cflags and libraries
necessary to implement AddressSanitizer, ThreadSanitizer, and
UndefinedBehaviorSanitizer.

Change-Id: Ibe5ffadc7ece56080a2521f2c7c00da9ef712584
2016-04-21 16:42:08 -07:00